diff --git a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php index 95dc74c..d28ca5e 100644 --- a/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php +++ b/core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php @@ -185,8 +185,7 @@ function testOutlinePathMatch() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile() - ->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); + $this->assertEqual($route->compile()->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); @@ -215,8 +214,7 @@ function testOutlinePathMatchTrailingSlash() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile() - ->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); + $this->assertEqual($route->compile()->getPatternOutline(), '/path/%/one', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); @@ -251,13 +249,13 @@ function testOutlinePathMatchDefaults() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile() - ->getPatternOutline(), '/some/path', 'Found path has correct pattern'); + $this->assertEqual($route->compile()->getPatternOutline(), '/some/path', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 1, 'The correct number of routes was found.'); $this->assertNotNull($routes->get('poink'), 'The first matching route was found.'); - } catch (ResourceNotFoundException $e) { + } + catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -290,13 +288,13 @@ function testOutlinePathMatchDefaultsCollision() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile() - ->getPatternOutline(), '/some/path', 'Found path has correct pattern'); + $this->assertEqual($route->compile()->getPatternOutline(), '/some/path', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 1, 'The correct number of routes was found.'); $this->assertNotNull($routes->get('poink'), 'The first matching route was found.'); - } catch (ResourceNotFoundException $e) { + } + catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -330,14 +328,12 @@ function testOutlinePathMatchDefaultsCollision2() { $routes_array = $routes->all(); $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); - $this->assertEqual(array( - 'narf', - 'poink' - ), array_keys($routes_array), 'Ensure the fitness was taken into account.'); + $this->assertEqual(array('narf', 'poink'), array_keys($routes_array), 'Ensure the fitness was taken into account.'); $this->assertNotNull($routes->get('narf'), 'The first matching route was found.'); $this->assertNotNull($routes->get('poink'), 'The second matching route was found.'); $this->assertNull($routes->get('eep'), 'Non-matching route was not found.'); - } catch (ResourceNotFoundException $e) { + } + catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -371,14 +367,12 @@ function testOutlinePathMatchDefaultsCollision3() { $routes_array = $routes->all(); $this->assertEqual(count($routes), 2, 'The correct number of routes was found.'); - $this->assertEqual(array( - 'poink', - 'poink2' - ), array_keys($routes_array), 'Ensure the fitness and name were taken into account in the sort.'); + $this->assertEqual(array('poink', 'poink2'), array_keys($routes_array), 'Ensure the fitness and name were taken into account in the sort.'); $this->assertNotNull($routes->get('poink'), 'The first matching route was found.'); $this->assertNotNull($routes->get('poink2'), 'The second matching route was found.'); $this->assertNull($routes->get('eep'), 'Non-matching route was not found.'); - } catch (ResourceNotFoundException $e) { + } + catch (ResourceNotFoundException $e) { $this->fail('No matching route found with default argument value.'); } } @@ -408,12 +402,12 @@ public function testOutlinePathMatchZero() { // All of the matching paths have the correct pattern. foreach ($routes as $route) { - $this->assertEqual($route->compile() - ->getPatternOutline(), '/some/path/%', 'Found path has correct pattern'); + $this->assertEqual($route->compile()->getPatternOutline(), '/some/path/%', 'Found path has correct pattern'); } $this->assertEqual(count($routes), 1, 'The correct number of routes was found.'); - } catch (ResourceNotFoundException $e) { + } + catch (ResourceNotFoundException $e) { $this->fail('No matchout route found with 0 as argument value'); } } @@ -528,16 +522,13 @@ public function testRouteByName() { $exception_thrown = FALSE; try { $provider->getRouteByName('invalid_name'); - } catch (RouteNotFoundException $e) { + } + catch (RouteNotFoundException $e) { $exception_thrown = TRUE; } $this->assertTrue($exception_thrown, 'Random route was not found.'); - $routes = $provider->getRoutesByNames(array( - 'route_c', - 'route_d', - $this->randomMachineName() - )); + $routes = $provider->getRoutesByNames(array('route_c', 'route_d', $this->randomMachineName())); $this->assertEqual(count($routes), 2, 'Only two valid routes found.'); $this->assertEqual($routes['route_c']->getPath(), '/path/two'); $this->assertEqual($routes['route_d']->getPath(), '/path/three');