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
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
131
Issues
131
List
Boards
Labels
Service Desk
Milestones
Merge Requests
26
Merge Requests
26
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
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
Commits
e1f76dbc
Commit
e1f76dbc
authored
45 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): spec test issues
parent
c0411b84
epic/ReportingAndModeration
1 merge request
!100
Epic/reporting and moderation
Pipeline
#61524804
passed with stages
in 4 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
5 deletions
+37
-5
ActionDelegateSpec.php
Spec/Core/Reports/Verdict/Delegates/ActionDelegateSpec.php
+25
-5
RepositorySpec.php
Spec/Core/Reports/Verdict/RepositorySpec.php
+12
-0
No files found.
Spec/Core/Reports/Verdict/Delegates/ActionDelegateSpec.php
View file @
e1f76dbc
...
...
@@ -9,6 +9,7 @@ use Minds\Core\Reports\Report;
use
Minds\Core\Reports\Actions
;
use
Minds\Core\Reports\Strikes\Manager
as
StrikesManager
;
use
Minds\Entities\Entity
;
use
Minds\Core\Entities\Actions\Save
as
SaveAction
;
use
PhpSpec\ObjectBehavior
;
use
Prophecy\Argument
;
...
...
@@ -17,17 +18,20 @@ class ActionDelegateSpec extends ObjectBehavior
private
$entitiesBuilder
;
private
$actions
;
private
$strikesManager
;
private
$saveAction
;
function
let
(
EntitiesBuilder
$entitiesBuilder
,
Actions
$actions
,
StrikesManager
$strikesManager
StrikesManager
$strikesManager
,
SaveAction
$saveAction
)
{
$this
->
beConstructedWith
(
$entitiesBuilder
,
$actions
,
null
,
$strikesManager
);
$this
->
beConstructedWith
(
$entitiesBuilder
,
$actions
,
null
,
$strikesManager
,
$saveAction
);
$this
->
entitiesBuilder
=
$entitiesBuilder
;
$this
->
actions
=
$actions
;
$this
->
strikesManager
=
$strikesManager
;
$this
->
saveAction
=
$saveAction
;
}
function
it_is_initializable
()
...
...
@@ -64,7 +68,10 @@ class ActionDelegateSpec extends ObjectBehavior
$entity
->
setNsfwLock
([
1
])
->
shouldBeCalled
();
$entity
->
save
()
$this
->
saveAction
->
setEntity
(
$entity
)
->
willReturn
(
$this
->
saveAction
);
$this
->
saveAction
->
save
()
->
shouldBeCalled
();
$this
->
strikesManager
->
countStrikesInTimeWindow
(
Argument
::
any
(),
Argument
::
any
())
...
...
@@ -87,7 +94,7 @@ class ActionDelegateSpec extends ObjectBehavior
$verdict
=
new
Verdict
;
$verdict
->
setReport
(
$report
)
->
set
Action
(
'1.2'
);
->
set
Uphold
(
true
);
$this
->
entitiesBuilder
->
single
(
123
)
->
shouldBeCalled
()
...
...
@@ -97,7 +104,13 @@ class ActionDelegateSpec extends ObjectBehavior
->
shouldBeCalled
()
->
willReturn
(
$user
);
$this
->
actions
->
setDeletedFlag
(
Argument
::
type
(
Entity
::
class
),
true
)
$this
->
actions
->
setDeletedFlag
(
$entity
,
true
)
->
shouldBeCalled
();
$this
->
saveAction
->
setEntity
(
$entity
)
->
willReturn
(
$this
->
saveAction
);
$this
->
saveAction
->
save
()
->
shouldBeCalled
();
$this
->
onAction
(
$verdict
);
...
...
@@ -111,6 +124,7 @@ class ActionDelegateSpec extends ObjectBehavior
$verdict
=
new
Verdict
;
$verdict
->
setReport
(
$report
)
->
setUphold
(
true
)
->
setAction
(
'4'
);
$this
->
entitiesBuilder
->
single
(
123
)
...
...
@@ -120,6 +134,12 @@ class ActionDelegateSpec extends ObjectBehavior
$this
->
actions
->
setDeletedFlag
(
Argument
::
type
(
Entity
::
class
),
true
)
->
shouldBeCalled
();
$this
->
saveAction
->
setEntity
(
$entity
)
->
willReturn
(
$this
->
saveAction
);
$this
->
saveAction
->
save
()
->
shouldBeCalled
();
$this
->
onAction
(
$verdict
);
}
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Reports/Verdict/RepositorySpec.php
View file @
e1f76dbc
...
...
@@ -48,6 +48,9 @@ class RepositorySpec extends ObjectBehavior
$verdict
->
isAppeal
()
->
shouldBeCalled
()
->
willReturn
(
false
);
$verdict
->
isUpheld
()
->
willReturn
(
true
);
$this
->
add
(
$verdict
)
->
shouldBe
(
true
);
...
...
@@ -73,6 +76,9 @@ class RepositorySpec extends ObjectBehavior
$verdict
->
isAppeal
()
->
shouldBeCalled
()
->
willReturn
(
false
);
$verdict
->
isUpheld
()
->
willReturn
(
true
);
$this
->
add
(
$verdict
)
->
shouldBe
(
true
);
...
...
@@ -98,6 +104,9 @@ class RepositorySpec extends ObjectBehavior
$verdict
->
isAppeal
()
->
shouldBeCalled
()
->
willReturn
(
true
);
$verdict
->
isUpheld
()
->
willReturn
(
true
);
$this
->
add
(
$verdict
)
->
shouldBe
(
true
);
...
...
@@ -123,6 +132,9 @@ class RepositorySpec extends ObjectBehavior
$verdict
->
isAppeal
()
->
shouldBeCalled
()
->
willReturn
(
true
);
$verdict
->
isUpheld
()
->
willReturn
(
false
);
$this
->
add
(
$verdict
)
->
shouldBe
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment