diff --git a/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
index d096531..765a968 100644
--- a/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
@@ -44,14 +44,10 @@ protected function alterRoutes(RouteCollection $collection) {
    *
    * @param \Drupal\Core\Routing\RouteBuildEvent $event
    *   The route build event.
-   *
-   * @return bool
-   *   Returns TRUE if the variables were successfully replaced, otherwise
-   *   FALSE.
    */
   public function onAlterRoutes(RouteBuildEvent $event) {
     $collection = $event->getRouteCollection();
-    return $this->alterRoutes($collection);
+    $this->alterRoutes($collection);
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
index 4b94055..b4e67d9 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
@@ -12,7 +12,6 @@
 use Drupal\Tests\UnitTestCase;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\Routing\Route;
-use Symfony\Component\Routing\RouteCollection;
 
 /**
  * @coversDefaultClass \Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber
@@ -21,36 +20,27 @@
 class SpecialAttributesRouteSubscriberTest extends UnitTestCase {
 
   /**
-   * The tested route subscriber.
-   *
-   * @var \Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber
-   */
-  protected  $specialAttributesRouteSubscriber;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-
-    $this->specialAttributesRouteSubscriber = new SpecialAttributesRouteSubscriber();
-  }
-
-  /**
    * Provides a list of routes with invalid route variables.
    *
    * @return array
    *   An array of invalid routes.
    */
   public function providerTestOnRouteBuildingInvalidVariables() {
-    $routes = array();
-    $routes[] = array(new Route('/test/{system_path}'));
-    $routes[] = array(new Route('/test/{_legacy}'));
-    $routes[] = array(new Route('/test/{' . RouteObjectInterface::ROUTE_OBJECT . '}'));
-    $routes[] = array(new Route('/test/{' . RouteObjectInterface::ROUTE_NAME . '}'));
-    $routes[] = array(new Route('/test/{_content}'));
-    $routes[] = array(new Route('/test/{_form}'));
-    $routes[] = array(new Route('/test/{_raw_variables}'));
+    // Build an array of mock route objects based on paths.
+    $routes = [];
+    $paths = [
+      '/test/{system_path}',
+      '/test/{_legacy}',
+      '/test/{' . RouteObjectInterface::ROUTE_OBJECT . '}',
+      '/test/{' . RouteObjectInterface::ROUTE_NAME . '}',
+      '/test/{_content}',
+      '/test/{_form}',
+      '/test/{_raw_variables}',
+    ];
+
+    foreach ($paths as $path) {
+      $routes[] = [new Route($path)];
+    }
 
     return $routes;
   }
@@ -62,11 +52,18 @@ public function providerTestOnRouteBuildingInvalidVariables() {
    *   An array of valid routes.
    */
   public function providerTestOnRouteBuildingValidVariables() {
-    $routes = array();
-    $routes[] = array(new Route('/test/{account}'));
-    $routes[] = array(new Route('/test/{node}'));
-    $routes[] = array(new Route('/test/{user}'));
-    $routes[] = array(new Route('/test/{entity_test}'));
+    // Build an array of mock route objects based on paths.
+    $routes = [];
+    $paths = [
+      '/test/{account}',
+      '/test/{node}',
+      '/test/{user}',
+      '/test/{entity_test}',
+    ];
+
+    foreach ($paths as $path) {
+      $routes[] = [new Route($path)];
+    }
 
     return $routes;
   }
@@ -78,12 +75,16 @@ public function providerTestOnRouteBuildingValidVariables() {
    *   The route to check.
    *
    * @dataProvider providerTestOnRouteBuildingValidVariables
+   *
+   * @covers ::onAlterRoutes
    */
   public function testOnRouteBuildingValidVariables(Route $route) {
-    $route_collection = new RouteCollection();
+    $route_collection = $this->getMock('Symfony\Component\Routing\RouteCollection', NULL);
     $route_collection->add('test', $route);
+
     $event = new RouteBuildEvent($route_collection, 'test');
-    $this->specialAttributesRouteSubscriber->onAlterRoutes($event);
+    $subscriber = new SpecialAttributesRouteSubscriber();
+    $this->assertNull($subscriber->onAlterRoutes($event));
   }
 
   /**
@@ -95,12 +96,16 @@ public function testOnRouteBuildingValidVariables(Route $route) {
    * @dataProvider providerTestOnRouteBuildingInvalidVariables
    * @expectedException \PHPUnit_Framework_Error_Warning
    * @expectedExceptionMessage uses reserved variable names
+   *
+   * @covers ::onAlterRoutes
    */
   public function testOnRouteBuildingInvalidVariables(Route $route) {
-    $route_collection = new RouteCollection();
+    $route_collection = $this->getMock('Symfony\Component\Routing\RouteCollection', NULL);
     $route_collection->add('test', $route);
+
     $event = new RouteBuildEvent($route_collection, 'test');
-    $this->specialAttributesRouteSubscriber->onAlterRoutes($event);
+    $subscriber = new SpecialAttributesRouteSubscriber();
+    $subscriber->onAlterRoutes($event);
   }
 
 }
