summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-26 20:49:31 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-26 20:49:31 +0200
commitaa2124f655788dea3f15c3040f3201f2b64e14b0 (patch)
tree0419bd6c4fdf13104169a451eab37489833d1b71 /tests
parent66038eda14d5d4e624b6636a6156570e3e940e49 (diff)
RouteDispatcher: Allow installation into sub directory
Diffstat (limited to 'tests')
-rw-r--r--tests/Unit/Middleware/RouteDispatcherTest.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/Unit/Middleware/RouteDispatcherTest.php b/tests/Unit/Middleware/RouteDispatcherTest.php
index 1e920f06..611d3b7c 100644
--- a/tests/Unit/Middleware/RouteDispatcherTest.php
+++ b/tests/Unit/Middleware/RouteDispatcherTest.php
@@ -2,6 +2,7 @@
namespace Engelsystem\Test\Unit\Middleware;
+use Engelsystem\Http\Request;
use Engelsystem\Middleware\RouteDispatcher;
use FastRoute\Dispatcher as FastRouteDispatcher;
use PHPUnit\Framework\MockObject\MockObject;
@@ -127,7 +128,7 @@ class RouteDispatcherTest extends TestCase
/** @var ResponseInterface|MockObject $response */
$response = $this->getMockForAbstractClass(ResponseInterface::class);
/** @var ServerRequestInterface|MockObject $request */
- $request = $this->getMockForAbstractClass(ServerRequestInterface::class);
+ $request = $this->createMock(Request::class);
/** @var RequestHandlerInterface|MockObject $handler */
$handler = $this->getMockForAbstractClass(RequestHandlerInterface::class);
/** @var UriInterface|MockObject $uriInterface */
@@ -139,9 +140,12 @@ class RouteDispatcherTest extends TestCase
$request->expects($this->atLeastOnce())
->method('getUri')
->willReturn($uriInterface);
+ $request->expects($this->atLeastOnce())
+ ->method('getPathInfo')
+ ->willReturn('/foo%21bar');
$uriInterface->expects($this->atLeastOnce())
->method('getPath')
- ->willReturn('/foo%21bar');
+ ->willReturn('/lorem/foo%21bar');
return [$dispatcher, $response, $request, $handler];
}