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);
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');
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');
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');
62 $r->
get(
'-some-info',
'admin-some-info');
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);
105 $route = $this->currentGroupPrefix . $route;
106 $this->routes[] = [$method, $route,
$handler];
get($route, $handler)
Adds a GET route to the collection.
addRoute($method, $route, $handler)
head($route, $handler)
Adds a HEAD route to the collection.
patch($route, $handler)
Adds a PATCH route to the collection.
delete($route, $handler)
Adds a DELETE route to the collection.
post($route, $handler)
Adds a POST route to the collection.
put($route, $handler)
Adds a PUT route to the collection.
addGroup($prefix, callable $callback)
Create a route group with a common prefix.