This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 27
27
use Zend \Mvc \MvcEvent ;
28
28
use Zend \Router \RouteMatch ;
29
29
use Zend \ServiceManager \ServiceManager ;
30
+ use Zend \View \Model \ModelInterface ;
30
31
31
32
class MiddlewareListenerTest extends TestCase
32
33
{
@@ -344,8 +345,7 @@ public function testNullMiddlewareThrowsInvalidMiddlewareException()
344
345
public function testValidMiddlewareDispatchCancelsPreviousDispatchFailures ()
345
346
{
346
347
$ middlewareName = uniqid ('middleware ' , true );
347
- /* @var $routeMatch RouteMatch|\PHPUnit_Framework_MockObject_MockObject */
348
- $ routeMatch = $ this ->createMock (RouteMatch::class);
348
+ $ routeMatch = new RouteMatch (['middleware ' => $ middlewareName ]);
349
349
$ response = new DiactorosResponse ();
350
350
/* @var $application Application|\PHPUnit_Framework_MockObject_MockObject */
351
351
$ application = $ this ->createMock (Application::class);
@@ -361,8 +361,6 @@ public function testValidMiddlewareDispatchCancelsPreviousDispatchFailures()
361
361
362
362
$ serviceManager ->expects (self ::any ())->method ('has ' )->with ($ middlewareName )->willReturn (true );
363
363
$ serviceManager ->expects (self ::any ())->method ('get ' )->with ($ middlewareName )->willReturn ($ middleware );
364
- $ routeMatch ->expects (self ::any ())->method ('getParam ' )->with ('middleware ' )->willReturn ($ middlewareName );
365
- $ routeMatch ->expects (self ::any ())->method ('getParams ' )->willReturn ([]);
366
364
367
365
$ event = new MvcEvent ();
368
366
You can’t perform that action at this time.
0 commit comments