|
@@ -56,17 +56,17 @@ class RouteMatcherTest extends TestCase
|
|
|
$routeRules[0]['match']['prefixes'] = ['*'];
|
|
|
|
|
|
$routeRules[0]['match']['domains'] = ['*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(12, $routes);
|
|
|
|
|
|
$routeRules[0]['match']['domains'] = ['domain1.*', 'domain2.*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(12, $routes);
|
|
|
|
|
|
$routeRules[0]['match']['domains'] = ['domain1.*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(6, $routes);
|
|
|
foreach ($routes as $route) {
|
|
@@ -74,7 +74,7 @@ class RouteMatcherTest extends TestCase
|
|
|
}
|
|
|
|
|
|
$routeRules[0]['match']['domains'] = ['domain2.*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(6, $routes);
|
|
|
foreach ($routes as $route) {
|
|
@@ -121,17 +121,17 @@ class RouteMatcherTest extends TestCase
|
|
|
$routeRules[0]['match']['domains'] = ['*'];
|
|
|
|
|
|
$routeRules[0]['match']['prefixes'] = ['*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(12, $routes);
|
|
|
|
|
|
$routeRules[0]['match']['prefixes'] = ['prefix1/*', 'prefix2/*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(8, $routes);
|
|
|
|
|
|
$routeRules[0]['match']['prefixes'] = ['prefix1/*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(4, $routes);
|
|
|
foreach ($routes as $route) {
|
|
@@ -139,7 +139,7 @@ class RouteMatcherTest extends TestCase
|
|
|
}
|
|
|
|
|
|
$routeRules[0]['match']['prefixes'] = ['prefix2/*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(4, $routes);
|
|
|
foreach ($routes as $route) {
|
|
@@ -154,7 +154,7 @@ class RouteMatcherTest extends TestCase
|
|
|
$routeRules[0]['match']['versions'] = ['v2'];
|
|
|
$routeRules[0]['match']['domains'] = ['*'];
|
|
|
$routeRules[0]['match']['prefixes'] = ['*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(6, $routes);
|
|
|
foreach ($routes as $route) {
|
|
@@ -164,7 +164,7 @@ class RouteMatcherTest extends TestCase
|
|
|
$routeRules[0]['match']['versions'] = ['v1', 'v2'];
|
|
|
$routeRules[0]['match']['domains'] = ['*'];
|
|
|
$routeRules[0]['match']['prefixes'] = ['*'];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(18, $routes);
|
|
|
}
|
|
@@ -200,7 +200,7 @@ class RouteMatcherTest extends TestCase
|
|
|
'include' => [$mustInclude],
|
|
|
],
|
|
|
];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$oddRuleOut = collect($routes)->filter(function ($route) use ($mustInclude) {
|
|
|
return $route['route']->getName() === $mustInclude;
|
|
@@ -241,7 +241,7 @@ class RouteMatcherTest extends TestCase
|
|
|
'include' => [$includePattern],
|
|
|
],
|
|
|
];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$oddRuleOut = collect($routes)->filter(function ($route) use ($mustInclude) {
|
|
|
return in_array($route['route']->getName(), $mustInclude);
|
|
@@ -280,7 +280,7 @@ class RouteMatcherTest extends TestCase
|
|
|
'exclude' => [$mustNotInclude],
|
|
|
],
|
|
|
];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$oddRuleOut = collect($routes)->filter(function ($route) use ($mustNotInclude) {
|
|
|
return $route['route']->getName() === $mustNotInclude;
|
|
@@ -321,7 +321,7 @@ class RouteMatcherTest extends TestCase
|
|
|
'exclude' => [$excludePattern],
|
|
|
],
|
|
|
];
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$oddRuleOut = collect($routes)->filter(function ($route) use ($mustNotInclude) {
|
|
|
return in_array($route['route']->getName(), $mustNotInclude);
|
|
@@ -386,7 +386,7 @@ class RouteMatcherTest extends TestCase
|
|
|
],
|
|
|
];
|
|
|
|
|
|
- $matcher = new RouteMatcher($routeRules, "dingo");
|
|
|
+ $matcher = new RouteMatcher($routeRules, 'dingo');
|
|
|
$routes = $matcher->getRoutes();
|
|
|
$this->assertCount(18, $routes);
|
|
|
|