diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php index 957bd1e..501363d 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php @@ -40,9 +40,15 @@ public static function getInfo() { */ public function testRemoveRoute() { $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'); + + $value_map = array( + array('enabled', TRUE), + array('disabled', FALSE), + ); + $module_handler->expects($this->any()) ->method('moduleExists') - ->will($this->returnCallback(array($this, 'moduleExistsCallback'))); + ->will($this->returnValueMap($value_map)); $collection = new RouteCollection(); $route_1 = new Route('', array(), array(), array('_module_dependency' => array('enabled'))); @@ -67,19 +73,4 @@ public function testRemoveRoute() { $this->assertInstanceOf('Symfony\Component\Routing\Route', $collection->get('no_module_dependency')); } - /** - * Test return callback for mock moduleExists callback. - * - * @param string $dependency - * The name of the module dependency. - * - * @return bool - * A boolean representing whether or not a module exists. - * - * @see testRemoveRoute() - */ - public function moduleExistsCallback($dependency) { - return $dependency == 'enabled'; - } - }