Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
flag
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
flag
Commits
334ca4b6
Commit
334ca4b6
authored
4 months ago
by
Prem Suthar
Committed by
Andrei Ivnitskii
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3316465
: Using a string as the assertion passed to assert()
parent
4ea2796c
No related branches found
No related tags found
1 merge request
!88
Addedd the MR Form the Patch #2 as per the suggestion.
Pipeline
#316903
passed with warnings
4 months ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/modules/flag_event_test/src/EventSubscriber/FlagEvents.php
+2
-2
2 additions, 2 deletions
...odules/flag_event_test/src/EventSubscriber/FlagEvents.php
with
2 additions
and
2 deletions
tests/modules/flag_event_test/src/EventSubscriber/FlagEvents.php
+
2
−
2
View file @
334ca4b6
...
...
@@ -59,7 +59,7 @@ class FlagEvents implements EventSubscriberInterface {
public
function
onFlag
(
FlaggingEvent
$event
)
{
if
(
$flag_id
=
$this
->
state
->
get
(
'flag_test.react_flag_event'
,
FALSE
))
{
$flag
=
$this
->
flagService
->
getFlagById
(
$flag_id
);
assert
(
'
$event->getFlagging()->getFlag()->id() !== $flag->id()
'
,
'Should not test the flagging event with the same flag that is being flagged.'
);
assert
(
$event
->
getFlagging
()
->
getFlag
()
->
id
()
!==
$flag
->
id
(),
'Should not test the flagging event with the same flag that is being flagged.'
);
$this
->
state
->
set
(
'flag_test.is_flagged'
,
$flag
->
isFlagged
(
$event
->
getFlagging
()
->
getFlaggable
(),
$event
->
getFlagging
()
->
getOwner
()));
}
}
...
...
@@ -74,7 +74,7 @@ class FlagEvents implements EventSubscriberInterface {
if
(
$flag_id
=
$this
->
state
->
get
(
'flag_test.react_unflag_event'
,
FALSE
))
{
$flag
=
$this
->
flagService
->
getFlagById
(
$flag_id
);
foreach
(
$event
->
getFlaggings
()
as
$flagging
)
{
assert
(
'
$flagging->getFlag()->id() != $flag->id()
'
,
'Should not test the unflagging event with the same flag that is being unflagged.'
);
assert
(
$flagging
->
getFlag
()
->
id
()
!=
$flag
->
id
(),
'Should not test the unflagging event with the same flag that is being unflagged.'
);
$this
->
state
->
set
(
'flag_test.is_unflagged'
,
$flag
->
isFlagged
(
$flagging
->
getFlaggable
(),
$flagging
->
getOwner
()));
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment