Skip to content

Commit

Permalink
Add test case for PHP-DI#76
Browse files Browse the repository at this point in the history
  • Loading branch information
juherr committed Jun 29, 2023
1 parent 9374b67 commit 3794f5d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/RoutingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ public function injects_route_placeholder()
$this->assertEquals('Hello matt', (string) $response->getBody());
}

/**
* @test
*/
public function injects_route_placeholder_from_request()
{
$app = Bridge::create();
$app->get('/{name}', function ($request, $response) {
$response->getBody()->write('Hello ' . $request->getAttribute('name'));
return $response;
});

$response = $app->handle(RequestFactory::create('/matt'));
$this->assertEquals('Hello matt', (string) $response->getBody());
}

/**
* @test
*/
Expand Down

0 comments on commit 3794f5d

Please sign in to comment.