File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1010use PHPUnit \Framework \TestCase ;
1111use ReflectionMethod ;
1212use ReflectionProperty ;
13+ use Zend \EventManager \EventInterface ;
1314use Zend \EventManager \EventManager ;
1415use Zend \Http \PhpEnvironment ;
1516use 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}
You can’t perform that action at this time.
0 commit comments