summaryrefslogtreecommitdiff
path: root/tests/Unit/Middleware
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Middleware')
-rw-r--r--tests/Unit/Middleware/LegacyMiddlewareTest.php30
1 files changed, 10 insertions, 20 deletions
diff --git a/tests/Unit/Middleware/LegacyMiddlewareTest.php b/tests/Unit/Middleware/LegacyMiddlewareTest.php
index 0589340a..f14a38ed 100644
--- a/tests/Unit/Middleware/LegacyMiddlewareTest.php
+++ b/tests/Unit/Middleware/LegacyMiddlewareTest.php
@@ -46,37 +46,29 @@ class LegacyMiddlewareTest extends TestCase
->disableOriginalConstructor()
->getMock();
- $middleware->expects($this->exactly(2))
+ $middleware->expects($this->once())
->method('loadPage')
- ->withConsecutive(['user_worklog'], ['login'])
- ->willReturnOnConsecutiveCalls(
- ['title', 'content'],
- ['title2', 'content2']
- );
+ ->with('user_worklog')
+ ->willReturn(['title', 'content']);
- $middleware->expects($this->exactly(3))
+ $middleware->expects($this->exactly(2))
->method('renderPage')
->withConsecutive(
['user_worklog', 'title', 'content'],
- ['404', 'Page not found', 'It\'s not available!'],
- ['login', 'title2', 'content2']
+ ['404', 'Page not found', 'It\'s not available!']
)
->willReturn($response);
- $container->expects($this->exactly(4))
+ $container->expects($this->exactly(3))
->method('get')
- ->withConsecutive(['request'], ['request'], ['translator'], ['request'])
+ ->withConsecutive(['request'], ['request'], ['translator'])
->willReturnOnConsecutiveCalls(
$defaultRequest,
$defaultRequest,
- $translator,
- $defaultRequest
+ $translator
);
$auth->expects($this->atLeastOnce())
- ->method('user')
- ->willReturn(false);
- $auth->expects($this->atLeastOnce())
->method('can')
->willReturn(false);
@@ -92,17 +84,15 @@ class LegacyMiddlewareTest extends TestCase
->method('path')
->willReturn('user-worklog');
- $parameters->expects($this->exactly(3))
+ $parameters->expects($this->exactly(2))
->method('get')
->with('p')
->willReturnOnConsecutiveCalls(
null,
- 'foo',
- '/'
+ 'foo'
);
$middleware->process($request, $handler);
$middleware->process($request, $handler);
- $middleware->process($request, $handler);
}
}