Skip to content

Commit e799055

Browse files
Witold Wasiczkoweierophinney
authored andcommitted
Falling test
1 parent a60b19e commit e799055

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/ApplicationTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PHPUnit\Framework\TestCase;
1111
use ReflectionMethod;
1212
use ReflectionProperty;
13+
use Zend\EventManager\EventInterface;
1314
use Zend\EventManager\EventManager;
1415
use Zend\Http\PhpEnvironment;
1516
use Zend\Mvc\MvcEvent;
@@ -121,4 +122,24 @@ public function testRouteListenerRaisingExceptionTriggersDispatchErrorAndSkipsDi
121122
$this->assertTrue($finishTriggered);
122123
$this->assertSame($response, $this->app->getResponse());
123124
}
125+
126+
public function testStopPropagationFromPrevEventShouldBeCleared()
127+
{
128+
$events = $this->app->getEventManager();
129+
$response = $this->prophesize(PhpEnvironment\Response::class)->reveal();
130+
131+
$events->attach('route', function (EventInterface $e) use ($response) {
132+
$e->stopPropagation(true);
133+
return $response;
134+
});
135+
136+
$isStopPropagation = null;
137+
$events->attach('finish', function (EventInterface $e) use (&$isStopPropagation) {
138+
$isStopPropagation = $e->propagationIsStopped();
139+
});
140+
141+
$this->app->run();
142+
143+
$this->assertFalse($isStopPropagation);
144+
}
124145
}

0 commit comments

Comments
 (0)