Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 44ba66b

Browse files
author
Witold Wasiczko
committed
Falling test
1 parent 3d41b61 commit 44ba66b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/EventManagerTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,21 @@ public function testTriggerSetsStopPropagationFlagToFalse()
675675
$this->assertFalse($event->propagationIsStopped());
676676
}
677677

678+
public function testTriggerEventSetsStopPropagationFlagToFalse()
679+
{
680+
$marker = (object) ['propagationIsStopped' => true];
681+
$this->events->attach('foo', function ($e) use ($marker) {
682+
$marker->propagationIsStopped = $e->propagationIsStopped();
683+
});
684+
685+
$event = new Event();
686+
$event->stopPropagation(true);
687+
$this->events->triggerEvent($event);
688+
689+
$this->assertFalse($marker->propagationIsStopped);
690+
$this->assertFalse($event->propagationIsStopped());
691+
}
692+
678693
public function testTriggerUntilSetsStopPropagationFlagToFalse()
679694
{
680695
$marker = (object) ['propagationIsStopped' => true];
@@ -693,6 +708,24 @@ public function testTriggerUntilSetsStopPropagationFlagToFalse()
693708
$this->assertFalse($event->propagationIsStopped());
694709
}
695710

711+
public function testTriggerEventUntilSetsStopPropagationFlagToFalse()
712+
{
713+
$marker = (object) ['propagationIsStopped' => true];
714+
$this->events->attach('foo', function ($e) use ($marker) {
715+
$marker->propagationIsStopped = $e->propagationIsStopped();
716+
});
717+
718+
$criteria = function ($r) {
719+
return false;
720+
};
721+
$event = new Event();
722+
$event->stopPropagation(true);
723+
$this->events->triggerEventUntil($criteria, $event);
724+
725+
$this->assertFalse($marker->propagationIsStopped);
726+
$this->assertFalse($event->propagationIsStopped());
727+
}
728+
696729
public function testTriggerUntilDeprecated()
697730
{
698731
$deprecated = null;

0 commit comments

Comments
 (0)