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

Commit

Permalink
Merge branch 'hotfix/168-out-of-sync'
Browse files Browse the repository at this point in the history
Close #170
  • Loading branch information
weierophinney committed Apr 16, 2018
2 parents c390cd4 + 26afcbd commit 52e2ab8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/Middleware/PathMiddlewareDecoratorTest.php
Expand Up @@ -457,4 +457,30 @@ public function testUpdatesInPathInsideNestedMiddlewareAreRespected()

$middleware->process($request, $handler->reveal());
}

public function testProcessesMatchedPathsWithoutCaseSensitivity()
{
$finalHandler = $this->prophesize(RequestHandlerInterface::class);
$finalHandler->handle(Argument::any())->willReturn(new Response());

// Note that the path requested is ALL CAPS:
$request = new ServerRequest([], [], 'http://local.example.com/MYADMIN', 'GET', 'php://memory');

$middleware = $this->prophesize(MiddlewareInterface::class);
$middleware
->process(
Argument::that(function (ServerRequestInterface $req) {
Assert::assertSame('', $req->getUri()->getPath());

return true;
}),
Argument::any()
)
->willReturn(new Response())
->shouldBeCalledTimes(1);

// Note that the path to match is lowercase:
$decorator = new PathMiddlewareDecorator('/myadmin', $middleware->reveal());
$decorator->process($request, $finalHandler->reveal());
}
}

0 comments on commit 52e2ab8

Please sign in to comment.