Definition at line 7 of file RouteCollectorTest.php.
◆ testGroups()
FastRoute\RouteCollectorTest::testGroups |
( |
| ) |
|
Definition at line 32 of file RouteCollectorTest.php.
References $r, FastRoute\RouteCollector\addGroup(), FastRoute\RouteCollector\delete(), FastRoute\RouteCollector\get(), FastRoute\RouteCollector\head(), FastRoute\RouteCollector\patch(), FastRoute\RouteCollector\post(), and FastRoute\RouteCollector\put().
34 $r =
new DummyRouteCollector();
36 $r->delete(
'/delete',
'delete');
37 $r->get(
'/get',
'get');
38 $r->head(
'/head',
'head');
39 $r->patch(
'/patch',
'patch');
40 $r->post(
'/post',
'post');
41 $r->put(
'/put',
'put');
43 $r->addGroup(
'/group-one',
function (DummyRouteCollector
$r) {
44 $r->delete(
'/delete',
'delete');
45 $r->get(
'/get',
'get');
46 $r->head(
'/head',
'head');
47 $r->patch(
'/patch',
'patch');
48 $r->post(
'/post',
'post');
49 $r->put(
'/put',
'put');
51 $r->addGroup(
'/group-two',
function (DummyRouteCollector $r) {
52 $r->delete(
'/delete',
'delete');
53 $r->get(
'/get',
'get');
54 $r->head(
'/head',
'head');
55 $r->patch(
'/patch',
'patch');
56 $r->post(
'/post',
'post');
57 $r->put(
'/put',
'put');
61 $r->addGroup(
'/admin',
function (DummyRouteCollector $r) {
62 $r->get(
'-some-info',
'admin-some-info');
64 $r->addGroup(
'/admin-',
function (DummyRouteCollector $r) {
65 $r->get(
'more-info',
'admin-more-info');
69 [
'DELETE',
'/delete',
'delete'],
70 [
'GET',
'/get',
'get'],
71 [
'HEAD',
'/head',
'head'],
72 [
'PATCH',
'/patch',
'patch'],
73 [
'POST',
'/post',
'post'],
74 [
'PUT',
'/put',
'put'],
75 [
'DELETE',
'/group-one/delete',
'delete'],
76 [
'GET',
'/group-one/get',
'get'],
77 [
'HEAD',
'/group-one/head',
'head'],
78 [
'PATCH',
'/group-one/patch',
'patch'],
79 [
'POST',
'/group-one/post',
'post'],
80 [
'PUT',
'/group-one/put',
'put'],
81 [
'DELETE',
'/group-one/group-two/delete',
'delete'],
82 [
'GET',
'/group-one/group-two/get',
'get'],
83 [
'HEAD',
'/group-one/group-two/head',
'head'],
84 [
'PATCH',
'/group-one/group-two/patch',
'patch'],
85 [
'POST',
'/group-one/group-two/post',
'post'],
86 [
'PUT',
'/group-one/group-two/put',
'put'],
87 [
'GET',
'/admin-some-info',
'admin-some-info'],
88 [
'GET',
'/admin-more-info',
'admin-more-info'],
91 $this->assertSame($expected, $r->routes);
◆ testShortcuts()
FastRoute\RouteCollectorTest::testShortcuts |
( |
| ) |
|
Definition at line 9 of file RouteCollectorTest.php.
References $r.
11 $r =
new DummyRouteCollector();
13 $r->delete(
'/delete',
'delete');
14 $r->get(
'/get',
'get');
15 $r->head(
'/head',
'head');
16 $r->patch(
'/patch',
'patch');
17 $r->post(
'/post',
'post');
18 $r->put(
'/put',
'put');
21 [
'DELETE',
'/delete',
'delete'],
22 [
'GET',
'/get',
'get'],
23 [
'HEAD',
'/head',
'head'],
24 [
'PATCH',
'/patch',
'patch'],
25 [
'POST',
'/post',
'post'],
26 [
'PUT',
'/put',
'put'],
29 $this->assertSame($expected,
$r->routes);
The documentation for this class was generated from the following file: