Skip to content
Snippets Groups Projects
Commit 334ca4b6 authored by Prem Suthar's avatar Prem Suthar Committed by Andrei Ivnitskii
Browse files

Issue #3316465: Using a string as the assertion passed to assert()

parent 4ea2796c
No related branches found
No related tags found
1 merge request!88Addedd the MR Form the Patch #2 as per the suggestion.
Pipeline #316903 passed with warnings
......@@ -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()));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment