@@ -1145,10 +1145,10 @@ public function testWithDotCoSubdomain()
11451145
11461146 public function testWithDifferentSubdomainMissing ()
11471147 {
1148- $ routes = $ this ->getCollector ();
1149-
11501148 $ _SERVER ['HTTP_HOST ' ] = 'adm.example.com ' ;
11511149
1150+ $ routes = $ this ->getCollector ();
1151+
11521152 $ routes ->add ('/objects/(:alphanum) ' , 'Admin::objectsList/$1 ' , ['subdomain ' => 'nothere ' ]);
11531153 $ routes ->add ('/objects/(:alphanum) ' , 'App::objectsList/$1 ' , ['subdomain ' => '* ' ]);
11541154
@@ -1178,10 +1178,10 @@ public function testWithNoSubdomainAndDot()
11781178 */
11791179 public function testWithSubdomainOrdered ()
11801180 {
1181- $ routes = $ this ->getCollector ();
1182-
11831181 $ _SERVER ['HTTP_HOST ' ] = 'adm.example.com ' ;
11841182
1183+ $ routes = $ this ->getCollector ();
1184+
11851185 $ routes ->add ('/objects/(:alphanum) ' , 'App::objectsList/$1 ' );
11861186 $ routes ->add ('/objects/(:alphanum) ' , 'Admin::objectsList/$1 ' , ['subdomain ' => 'adm ' ]);
11871187
@@ -1422,10 +1422,10 @@ public function testRouteToWithSubdomainMismatch()
14221422
14231423 public function testRouteToWithSubdomainNot ()
14241424 {
1425- $ routes = $ this ->getCollector ();
1426-
1427- Services::request ()->setMethod ('get ' );
14281425 $ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
1426+ Services::request ()->setMethod ('get ' );
1427+
1428+ $ routes = $ this ->getCollector ();
14291429
14301430 $ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => 'doc ' , 'as ' => 'doc_item ' ]);
14311431
@@ -1434,10 +1434,10 @@ public function testRouteToWithSubdomainNot()
14341434
14351435 public function testRouteToWithGenericSubdomainMatch ()
14361436 {
1437- $ routes = $ this ->getCollector ();
1438-
1439- Services::request ()->setMethod ('get ' );
14401437 $ _SERVER ['HTTP_HOST ' ] = 'doc.example.com ' ;
1438+ Services::request ()->setMethod ('get ' );
1439+
1440+ $ routes = $ this ->getCollector ();
14411441
14421442 $ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => '* ' , 'as ' => 'doc_item ' ]);
14431443
@@ -1446,10 +1446,10 @@ public function testRouteToWithGenericSubdomainMatch()
14461446
14471447 public function testRouteToWithGenericSubdomainMismatch ()
14481448 {
1449- $ routes = $ this ->getCollector ();
1450-
1451- Services::request ()->setMethod ('get ' );
14521449 $ _SERVER ['HTTP_HOST ' ] = 'dev.example.com ' ;
1450+ Services::request ()->setMethod ('get ' );
1451+
1452+ $ routes = $ this ->getCollector ();
14531453
14541454 $ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => '* ' , 'as ' => 'doc_item ' ]);
14551455
@@ -1458,10 +1458,10 @@ public function testRouteToWithGenericSubdomainMismatch()
14581458
14591459 public function testRouteToWithGenericSubdomainNot ()
14601460 {
1461- $ routes = $ this ->getCollector ();
1462-
1463- Services::request ()->setMethod ('get ' );
14641461 $ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
1462+ Services::request ()->setMethod ('get ' );
1463+
1464+ $ routes = $ this ->getCollector ();
14651465
14661466 $ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => '* ' , 'as ' => 'doc_item ' ]);
14671467
@@ -1482,10 +1482,10 @@ public function testRouteToWithoutSubdomainMatch()
14821482
14831483 public function testRouteToWithoutSubdomainMismatch ()
14841484 {
1485- $ routes = $ this ->getCollector ();
1486-
1487- Services::request ()->setMethod ('get ' );
14881485 $ _SERVER ['HTTP_HOST ' ] = 'dev.example.com ' ;
1486+ Services::request ()->setMethod ('get ' );
1487+
1488+ $ routes = $ this ->getCollector ();
14891489
14901490 $ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['hostname ' => 'example.com ' , 'as ' => 'doc_item ' ]);
14911491
@@ -1532,8 +1532,8 @@ public function testRouteOverwritingDifferentSubdomains()
15321532
15331533 public function testRouteOverwritingTwoRules ()
15341534 {
1535- Services::request ()->setMethod ('get ' );
15361535 $ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1536+ Services::request ()->setMethod ('get ' );
15371537
15381538 $ routes = $ this ->getCollector ();
15391539 $ router = new Router ($ routes , Services::request ());
@@ -1553,8 +1553,8 @@ public function testRouteOverwritingTwoRules()
15531553
15541554 public function testRouteOverwritingTwoRulesLastApplies ()
15551555 {
1556- Services::request ()->setMethod ('get ' );
15571556 $ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1557+ Services::request ()->setMethod ('get ' );
15581558
15591559 $ routes = $ this ->getCollector ();
15601560 $ router = new Router ($ routes , Services::request ());
@@ -1573,8 +1573,8 @@ public function testRouteOverwritingTwoRulesLastApplies()
15731573
15741574 public function testRouteOverwritingMatchingSubdomain ()
15751575 {
1576- Services::request ()->setMethod ('get ' );
15771576 $ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1577+ Services::request ()->setMethod ('get ' );
15781578
15791579 $ routes = $ this ->getCollector ();
15801580 $ router = new Router ($ routes , Services::request ());
@@ -1593,8 +1593,8 @@ public function testRouteOverwritingMatchingSubdomain()
15931593
15941594 public function testRouteOverwritingMatchingHost ()
15951595 {
1596- Services::request ()->setMethod ('get ' );
15971596 $ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1597+ Services::request ()->setMethod ('get ' );
15981598
15991599 $ routes = $ this ->getCollector ();
16001600 $ router = new Router ($ routes , Services::request ());
0 commit comments