Skip to content

Commit 4f3b802

Browse files
committed
update route tests
1 parent ab15293 commit 4f3b802

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

tests/RoutingTest.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ public function test_a_simple_get_route()
2424
{
2525
$this->mockRequest(HttpMethods::GET, 'http://example.com/');
2626

27-
$router = $this->router();
28-
$router->map('GET', '/', $this->controller());
29-
$router->dispatch();
27+
$router = $this->router()->map('GET', '/', $this->controller())->dispatch();
3028

3129
$this->assertEquals('OK', $this->outputOf($router));
3230
}
@@ -100,23 +98,21 @@ public function test_the_any_method()
10098
{
10199
$this->mockRequest(HttpMethods::GET, 'http://example.com/');
102100

103-
$router = $this->router()
104-
->any('/', function () {
105-
return 'Test any-get method';
106-
})
107-
->dispatch();
101+
$router = $this->router()->any('/', function () {
102+
return 'Test any for get';
103+
})->dispatch();
108104

109-
$this->assertEquals('Test any-get method', $this->outputOf($router));
105+
$this->assertEquals('Test any for get', $this->outputOf($router));
110106

111107
$this->mockRequest(HttpMethods::POST, 'http://example.com/');
112108

113109
$router = $this->router()
114110
->any('/', function () {
115-
return 'Test any-post method';
111+
return 'Test any for post';
116112
})
117113
->dispatch();
118114

119-
$this->assertEquals('Test any-post method', $this->outputOf($router));
115+
$this->assertEquals('Test any for post', $this->outputOf($router));
120116
}
121117

122118
/**

0 commit comments

Comments
 (0)