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

Commit 5a914bd

Browse files
committed
Removing route match mock - not needed
1 parent c27997f commit 5a914bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/MiddlewareListenerTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Zend\Mvc\MvcEvent;
2828
use Zend\Router\RouteMatch;
2929
use Zend\ServiceManager\ServiceManager;
30+
use Zend\View\Model\ModelInterface;
3031

3132
class MiddlewareListenerTest extends TestCase
3233
{
@@ -344,8 +345,7 @@ public function testNullMiddlewareThrowsInvalidMiddlewareException()
344345
public function testValidMiddlewareDispatchCancelsPreviousDispatchFailures()
345346
{
346347
$middlewareName = uniqid('middleware', true);
347-
/* @var $routeMatch RouteMatch|\PHPUnit_Framework_MockObject_MockObject */
348-
$routeMatch = $this->createMock(RouteMatch::class);
348+
$routeMatch = new RouteMatch(['middleware' => $middlewareName]);
349349
$response = new DiactorosResponse();
350350
/* @var $application Application|\PHPUnit_Framework_MockObject_MockObject */
351351
$application = $this->createMock(Application::class);
@@ -361,8 +361,6 @@ public function testValidMiddlewareDispatchCancelsPreviousDispatchFailures()
361361

362362
$serviceManager->expects(self::any())->method('has')->with($middlewareName)->willReturn(true);
363363
$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([]);
366364

367365
$event = new MvcEvent();
368366

0 commit comments

Comments
 (0)