1414use MiladRahimi \PhpRouter \Tests \Classes \SampleMiddleware ;
1515use Throwable ;
1616
17- class GroupedMappingTest extends TestCase
17+ class GroupingTest extends TestCase
1818{
1919 /**
2020 * @throws Throwable
2121 */
22- public function test_simple_group_routing ()
22+ public function test_simple_group ()
2323 {
24- $ router = $ this ->createRouterWithMockedProperties ();
24+ $ router = $ this ->createRouter ();
2525
2626 $ router ->group ([], function (Router $ router ) {
2727 $ router ->map ('GET ' , '/ ' , $ this ->simpleController ());
@@ -35,15 +35,15 @@ public function test_simple_group_routing()
3535 /**
3636 * @throws Throwable
3737 */
38- public function test_group_routing_with_middleware ()
38+ public function test_middleware_object ()
3939 {
4040 $ groupMiddleware = new SampleMiddleware (777 );
4141
4242 $ groupAttributes = [
4343 RouteAttributes::MIDDLEWARE => $ groupMiddleware ,
4444 ];
4545
46- $ router = $ this ->createRouterWithMockedProperties ();
46+ $ router = $ this ->createRouter ();
4747
4848 $ router ->group ($ groupAttributes , function (Router $ router ) {
4949 $ router ->map ('GET ' , '/ ' , $ this ->simpleController ());
@@ -58,13 +58,13 @@ public function test_group_routing_with_middleware()
5858 /**
5959 * @throws Throwable
6060 */
61- public function test_group_routing_with_string_middleware ()
61+ public function test_string_middleware ()
6262 {
6363 $ groupAttributes = [
6464 RouteAttributes::MIDDLEWARE => SampleMiddleware::class,
6565 ];
6666
67- $ router = $ this ->createRouterWithMockedProperties ();
67+ $ router = $ this ->createRouter ();
6868
6969 $ router ->group ($ groupAttributes , function (Router $ router ) {
7070 $ router ->map ('GET ' , '/ ' , $ this ->simpleController ());
@@ -78,7 +78,7 @@ public function test_group_routing_with_string_middleware()
7878 /**
7979 * @throws Throwable
8080 */
81- public function test_group_routing_with_a_group_and_a_route_middleware ()
81+ public function test_middleware_it_should_ignore_group_middleware_where_route_middleware_is_present ()
8282 {
8383 $ groupMiddleware = new SampleMiddleware (1001 );
8484 $ routeMiddleware = new SampleMiddleware (1002 );
@@ -87,7 +87,7 @@ public function test_group_routing_with_a_group_and_a_route_middleware()
8787 RouteAttributes::MIDDLEWARE => $ groupMiddleware ,
8888 ];
8989
90- $ router = $ this ->createRouterWithMockedProperties ();
90+ $ router = $ this ->createRouter ();
9191
9292 $ router ->group ($ groupAttributes , function (Router $ router ) use ($ routeMiddleware ) {
9393 $ router ->map ('GET ' , '/ ' , $ this ->simpleController (), $ routeMiddleware );
@@ -103,15 +103,15 @@ public function test_group_routing_with_a_group_and_a_route_middleware()
103103 /**
104104 * @throws Throwable
105105 */
106- public function test_group_routing_with_prefix ()
106+ public function test_prefix ()
107107 {
108108 $ this ->mockRequest (HttpMethods::GET , 'http://example.com/group/page ' );
109109
110110 $ groupAttributes = [
111111 RouteAttributes::PREFIX => '/group ' ,
112112 ];
113113
114- $ router = $ this ->createRouterWithMockedProperties ();
114+ $ router = $ this ->createRouter ();
115115
116116 $ router ->group ($ groupAttributes , function (Router $ router ) {
117117 $ router ->map ('GET ' , '/page ' , $ this ->simpleController ());
@@ -125,15 +125,15 @@ public function test_group_routing_with_prefix()
125125 /**
126126 * @throws Throwable
127127 */
128- public function test_group_routing_with_domain ()
128+ public function test_domain ()
129129 {
130130 $ this ->mockRequest (HttpMethods::GET , 'http://sub.domain.tld/ ' );
131131
132132 $ groupAttributes = [
133133 RouteAttributes::DOMAIN => 'sub.domain.tld ' ,
134134 ];
135135
136- $ router = $ this ->createRouterWithMockedProperties ();
136+ $ router = $ this ->createRouter ();
137137
138138 $ router ->group ($ groupAttributes , function (Router $ router ) {
139139 $ router ->map ('GET ' , '/ ' , $ this ->simpleController ());
@@ -147,15 +147,15 @@ public function test_group_routing_with_domain()
147147 /**
148148 * @throws Throwable
149149 */
150- public function test_group_routing_with_domains_it_should_ignore_group_domain_when_the_route_has_one ()
150+ public function test_domain_it_should_ignore_group_domain_where_route_domain_is_present ()
151151 {
152152 $ this ->mockRequest (HttpMethods::GET , 'http://sub2.domain.tld/ ' );
153153
154154 $ groupAttributes = [
155155 RouteAttributes::DOMAIN => 'sub1.domain.tld ' ,
156156 ];
157157
158- $ router = $ this ->createRouterWithMockedProperties ();
158+ $ router = $ this ->createRouter ();
159159
160160 $ router ->group ($ groupAttributes , function (Router $ router ) {
161161 $ router ->map ('GET ' , '/ ' , $ this ->simpleController (), [], 'sub2.domain.tld ' );
@@ -169,9 +169,9 @@ public function test_group_routing_with_domains_it_should_ignore_group_domain_wh
169169 /**
170170 * @throws Throwable
171171 */
172- public function test_simple_group_routing_it_should_remove_existing_name_before_the_group ()
172+ public function test_naming_it_should_remove_existing_name_before_the_group ()
173173 {
174- $ router = $ this ->createRouterWithMockedProperties ();
174+ $ router = $ this ->createRouter ();
175175
176176 $ router ->useName ('NameForNothing ' );
177177
0 commit comments