Fixed regression bug while processing versionning for rest paths

This commit is contained in:
Alejandro Celaya
2016-10-23 10:29:54 +02:00
parent bf7c760ca9
commit a15b17e08b
2 changed files with 17 additions and 0 deletions

View File

@@ -44,4 +44,16 @@ class PathVersionMiddlewareTest extends TestCase
$this->assertEquals('/rest/v1/bar/baz', $req->getUri()->getPath());
});
}
/**
* @test
*/
public function nonRestPathsAreNotProcessed()
{
$request = ServerRequestFactory::fromGlobals()->withUri(new Uri('/non-rest'));
$test = $this;
$this->middleware->__invoke($request, new Response(), function ($req) use ($request, $test) {
$test->assertSame($request, $req);
});
}
}