Skip to content

Commit b58c211

Browse files
committed
add tests for current route
1 parent 1e395be commit b58c211

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/RouteTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,24 @@ public function test_current_route_for_a_route_with_all_attributes()
4848

4949
$this->assertEquals(json_encode($expected), $this->output($router));
5050
}
51+
52+
public function test_lately_added_attributes_of_route()
53+
{
54+
$this->mockRequest('POST', 'http://shop.com/admin/profile/666');
55+
56+
$router = $this->router();
57+
58+
$router->post('/admin/profile/{id}', function (Route $route) {
59+
return [
60+
$route->getParameters(),
61+
$route->getUri(),
62+
];
63+
}, 'admin.profile');
64+
65+
$router->dispatch();
66+
67+
$expected = [['id' => '666'], '/admin/profile/666'];
68+
69+
$this->assertEquals(json_encode($expected), $this->output($router));
70+
}
5171
}

0 commit comments

Comments
 (0)