Commit aa6b7fb9 authored by Guillermo's avatar Guillermo

Added a test for the small fix

parent 0b4d3d5d
...@@ -142,4 +142,19 @@ class RouterTest extends \PHPUnit_Framework_TestCase ...@@ -142,4 +142,19 @@ class RouterTest extends \PHPUnit_Framework_TestCase
$response = $framework->handle($request); $response = $framework->handle($request);
$this->assertEquals($expectedContent, $response->getContent(), $message); $this->assertEquals($expectedContent, $response->getContent(), $message);
} }
public function testRequestShouldBeStoredRegardlessOfRouting() {
$framework = new Framework();
$framework->get('/foo', function() use ($framework) {
return new Response($framework->getRequest()->getRequestUri());
});
$framework->error(function($e) use ($framework) {
return new Response($framework->getRequest()->getRequestUri());
});
foreach(array('/foo', '/bar') as $path) {
$request = Request::create($path);
$response = $framework->handle($request);
$this->assertContains($path, $response->getContent());
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment