Skip to content

Commit 3794f5d

Browse files
committed
Add test case for #76
1 parent 9374b67 commit 3794f5d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/RoutingTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ public function injects_route_placeholder()
4444
$this->assertEquals('Hello matt', (string) $response->getBody());
4545
}
4646

47+
/**
48+
* @test
49+
*/
50+
public function injects_route_placeholder_from_request()
51+
{
52+
$app = Bridge::create();
53+
$app->get('/{name}', function ($request, $response) {
54+
$response->getBody()->write('Hello ' . $request->getAttribute('name'));
55+
return $response;
56+
});
57+
58+
$response = $app->handle(RequestFactory::create('/matt'));
59+
$this->assertEquals('Hello matt', (string) $response->getBody());
60+
}
61+
4762
/**
4863
* @test
4964
*/

0 commit comments

Comments
 (0)