Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
178
Issues
178
List
Boards
Labels
Service Desk
Milestones
Merge Requests
30
Merge Requests
30
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Compare Revisions
3b319cfb02f7326eabe28e53a636090c948b8b83...2f9601c076cdb143ffa252beaabb2d67f75b2abf
Source
2f9601c076cdb143ffa252beaabb2d67f75b2abf
Select Git revision
...
Target
3b319cfb02f7326eabe28e53a636090c948b8b83
Select Git revision
Compare
Commits (2)
(feature): Steward changes
· 61be5521
Nicholas Lewis
authored
34 minutes ago
61be5521
Merge branch 'stewardChanges' into 'master'
· 2f9601c0
Mark Harding
authored
34 minutes ago
(feature): Steward changes See merge request
!225
2f9601c0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
1 deletion
+58
-1
AutoReporter.php
Core/Steward/AutoReporter.php
+34
-1
AutoReporterSpec.php
Spec/Core/Steward/AutoReporterSpec.php
+24
-0
No files found.
Core/Steward/AutoReporter.php
View file @
2f9601c0
This diff is collapsed.
Click to expand it.
Spec/Core/Steward/AutoReporterSpec.php
View file @
2f9601c0
...
...
@@ -116,6 +116,30 @@ class AutoReporterSpec extends ObjectBehavior
expect
(
$scoredReason
->
getSubreasonCode
())
->
toEqual
(
Reason
::
REASON_NSFW_PORNOGRAPHY
);
expect
(
$scoredReason
->
getWeight
())
->
toEqual
(
4
);
}
public
function
it_should_report_more_bad_words
()
{
$entity
=
(
new
Entity
())
->
set
(
'guid'
,
456
)
->
set
(
'owner_guid'
,
789
)
->
set
(
'message'
,
'this is only a test: anilingus'
);
$report
=
(
new
Reports\Report
())
->
setEntityGuid
(
$entity
->
guid
)
->
setEntityOwnerGuid
(
$entity
->
get
(
'owner_guid'
));
$autoReport
=
(
new
Reports\UserReports\UserReport
())
->
setReport
(
$report
)
->
setReporterGuid
(
$this
->
stewardUser
->
guid
)
->
setReasonCode
(
Reason
::
REASON_NSFW
)
->
setSubReasonCode
(
Reason
::
REASON_NSFW_PORNOGRAPHY
)
->
setTimestamp
(
1
);
$this
->
reportManager
->
add
(
$autoReport
)
->
shouldBeCalled
();
$scoredReason
=
$this
->
validate
(
$entity
,
1
)
->
getWrappedObject
();
expect
(
$scoredReason
->
getReasonCode
())
->
toEqual
(
Reason
::
REASON_NSFW
);
expect
(
$scoredReason
->
getSubreasonCode
())
->
toEqual
(
Reason
::
REASON_NSFW_PORNOGRAPHY
);
expect
(
$scoredReason
->
getWeight
())
->
toEqual
(
4
);
}
public
function
it_should_not_report_words
()
{
...
...
This diff is collapsed.
Click to expand it.