@@ -1145,10 +1145,10 @@ public function testWithDotCoSubdomain()
1145
1145
1146
1146
public function testWithDifferentSubdomainMissing ()
1147
1147
{
1148
- $ routes = $ this ->getCollector ();
1149
-
1150
1148
$ _SERVER ['HTTP_HOST ' ] = 'adm.example.com ' ;
1151
1149
1150
+ $ routes = $ this ->getCollector ();
1151
+
1152
1152
$ routes ->add ('/objects/(:alphanum) ' , 'Admin::objectsList/$1 ' , ['subdomain ' => 'nothere ' ]);
1153
1153
$ routes ->add ('/objects/(:alphanum) ' , 'App::objectsList/$1 ' , ['subdomain ' => '* ' ]);
1154
1154
@@ -1178,10 +1178,10 @@ public function testWithNoSubdomainAndDot()
1178
1178
*/
1179
1179
public function testWithSubdomainOrdered ()
1180
1180
{
1181
- $ routes = $ this ->getCollector ();
1182
-
1183
1181
$ _SERVER ['HTTP_HOST ' ] = 'adm.example.com ' ;
1184
1182
1183
+ $ routes = $ this ->getCollector ();
1184
+
1185
1185
$ routes ->add ('/objects/(:alphanum) ' , 'App::objectsList/$1 ' );
1186
1186
$ routes ->add ('/objects/(:alphanum) ' , 'Admin::objectsList/$1 ' , ['subdomain ' => 'adm ' ]);
1187
1187
@@ -1422,10 +1422,10 @@ public function testRouteToWithSubdomainMismatch()
1422
1422
1423
1423
public function testRouteToWithSubdomainNot ()
1424
1424
{
1425
- $ routes = $ this ->getCollector ();
1426
-
1427
- Services::request ()->setMethod ('get ' );
1428
1425
$ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
1426
+ Services::request ()->setMethod ('get ' );
1427
+
1428
+ $ routes = $ this ->getCollector ();
1429
1429
1430
1430
$ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => 'doc ' , 'as ' => 'doc_item ' ]);
1431
1431
@@ -1434,10 +1434,10 @@ public function testRouteToWithSubdomainNot()
1434
1434
1435
1435
public function testRouteToWithGenericSubdomainMatch ()
1436
1436
{
1437
- $ routes = $ this ->getCollector ();
1438
-
1439
- Services::request ()->setMethod ('get ' );
1440
1437
$ _SERVER ['HTTP_HOST ' ] = 'doc.example.com ' ;
1438
+ Services::request ()->setMethod ('get ' );
1439
+
1440
+ $ routes = $ this ->getCollector ();
1441
1441
1442
1442
$ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => '* ' , 'as ' => 'doc_item ' ]);
1443
1443
@@ -1446,10 +1446,10 @@ public function testRouteToWithGenericSubdomainMatch()
1446
1446
1447
1447
public function testRouteToWithGenericSubdomainMismatch ()
1448
1448
{
1449
- $ routes = $ this ->getCollector ();
1450
-
1451
- Services::request ()->setMethod ('get ' );
1452
1449
$ _SERVER ['HTTP_HOST ' ] = 'dev.example.com ' ;
1450
+ Services::request ()->setMethod ('get ' );
1451
+
1452
+ $ routes = $ this ->getCollector ();
1453
1453
1454
1454
$ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => '* ' , 'as ' => 'doc_item ' ]);
1455
1455
@@ -1458,10 +1458,10 @@ public function testRouteToWithGenericSubdomainMismatch()
1458
1458
1459
1459
public function testRouteToWithGenericSubdomainNot ()
1460
1460
{
1461
- $ routes = $ this ->getCollector ();
1462
-
1463
- Services::request ()->setMethod ('get ' );
1464
1461
$ _SERVER ['HTTP_HOST ' ] = 'example.com ' ;
1462
+ Services::request ()->setMethod ('get ' );
1463
+
1464
+ $ routes = $ this ->getCollector ();
1465
1465
1466
1466
$ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['subdomain ' => '* ' , 'as ' => 'doc_item ' ]);
1467
1467
@@ -1482,10 +1482,10 @@ public function testRouteToWithoutSubdomainMatch()
1482
1482
1483
1483
public function testRouteToWithoutSubdomainMismatch ()
1484
1484
{
1485
- $ routes = $ this ->getCollector ();
1486
-
1487
- Services::request ()->setMethod ('get ' );
1488
1485
$ _SERVER ['HTTP_HOST ' ] = 'dev.example.com ' ;
1486
+ Services::request ()->setMethod ('get ' );
1487
+
1488
+ $ routes = $ this ->getCollector ();
1489
1489
1490
1490
$ routes ->get ('i/(:any) ' , 'App\Controllers\Site\CDoc::item/$1 ' , ['hostname ' => 'example.com ' , 'as ' => 'doc_item ' ]);
1491
1491
@@ -1532,8 +1532,8 @@ public function testRouteOverwritingDifferentSubdomains()
1532
1532
1533
1533
public function testRouteOverwritingTwoRules ()
1534
1534
{
1535
- Services::request ()->setMethod ('get ' );
1536
1535
$ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1536
+ Services::request ()->setMethod ('get ' );
1537
1537
1538
1538
$ routes = $ this ->getCollector ();
1539
1539
$ router = new Router ($ routes , Services::request ());
@@ -1553,8 +1553,8 @@ public function testRouteOverwritingTwoRules()
1553
1553
1554
1554
public function testRouteOverwritingTwoRulesLastApplies ()
1555
1555
{
1556
- Services::request ()->setMethod ('get ' );
1557
1556
$ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1557
+ Services::request ()->setMethod ('get ' );
1558
1558
1559
1559
$ routes = $ this ->getCollector ();
1560
1560
$ router = new Router ($ routes , Services::request ());
@@ -1573,8 +1573,8 @@ public function testRouteOverwritingTwoRulesLastApplies()
1573
1573
1574
1574
public function testRouteOverwritingMatchingSubdomain ()
1575
1575
{
1576
- Services::request ()->setMethod ('get ' );
1577
1576
$ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1577
+ Services::request ()->setMethod ('get ' );
1578
1578
1579
1579
$ routes = $ this ->getCollector ();
1580
1580
$ router = new Router ($ routes , Services::request ());
@@ -1593,8 +1593,8 @@ public function testRouteOverwritingMatchingSubdomain()
1593
1593
1594
1594
public function testRouteOverwritingMatchingHost ()
1595
1595
{
1596
- Services::request ()->setMethod ('get ' );
1597
1596
$ _SERVER ['HTTP_HOST ' ] = 'doc.domain.com ' ;
1597
+ Services::request ()->setMethod ('get ' );
1598
1598
1599
1599
$ routes = $ this ->getCollector ();
1600
1600
$ router = new Router ($ routes , Services::request ());
0 commit comments