diff --git a/core/modules/action/tests/Drupal/action/Tests/Menu/ActionLocalTasksTest.php b/core/modules/action/tests/Drupal/action/Tests/Menu/ActionLocalTasksTest.php index a9b380f..891db5b 100644 --- a/core/modules/action/tests/Drupal/action/Tests/Menu/ActionLocalTasksTest.php +++ b/core/modules/action/tests/Drupal/action/Tests/Menu/ActionLocalTasksTest.php @@ -26,7 +26,7 @@ public static function getInfo() { } public function setUp() { - $this->moduleList = array('action' => 'core/modules/action/action.info'); + $this->moduleList = array('action' => 'core/modules/action/action.info.yml'); parent::setUp(); } diff --git a/core/modules/aggregator/tests/Drupal/aggregator/Tests/Menu/AggregatorLocalTasksTest.php b/core/modules/aggregator/tests/Drupal/aggregator/Tests/Menu/AggregatorLocalTasksTest.php index 95d551b..67bedd8 100644 --- a/core/modules/aggregator/tests/Drupal/aggregator/Tests/Menu/AggregatorLocalTasksTest.php +++ b/core/modules/aggregator/tests/Drupal/aggregator/Tests/Menu/AggregatorLocalTasksTest.php @@ -26,7 +26,7 @@ public static function getInfo() { } public function setUp() { - $this->moduleList = array('aggregator' => 'core/modules/aggregator/aggregator.info'); + $this->moduleList = array('aggregator' => 'core/modules/aggregator/aggregator.info.yml'); parent::setUp(); } diff --git a/core/modules/block/custom_block/tests/Drupal/custom_blocks/Tests/Menu/CustomBlockLocalTasksTest.php b/core/modules/block/custom_block/tests/Drupal/custom_blocks/Tests/Menu/CustomBlockLocalTasksTest.php index ab22751..96866fd 100644 --- a/core/modules/block/custom_block/tests/Drupal/custom_blocks/Tests/Menu/CustomBlockLocalTasksTest.php +++ b/core/modules/block/custom_block/tests/Drupal/custom_blocks/Tests/Menu/CustomBlockLocalTasksTest.php @@ -27,8 +27,8 @@ public static function getInfo() { public function setUp() { $this->moduleList = array( - 'block' => 'core/modules/block/block.info', - 'custom_block' => 'core/modules/block/custom_block/custom_block.info', + 'block' => 'core/modules/block/block.info.yml', + 'custom_block' => 'core/modules/block/custom_block/custom_block.info.yml', ); parent::setUp(); } diff --git a/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php index 0c221da..59b26f8 100644 --- a/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php +++ b/core/modules/block/tests/Drupal/block/Tests/Menu/BlockLocalTasksTest.php @@ -26,7 +26,7 @@ public static function getInfo() { } public function setUp() { - $this->moduleList = array('block' => 'core/modules/block/block.info'); + $this->moduleList = array('block' => 'core/modules/block/block.info.yml'); parent::setUp(); $config_factory = $this->getConfigFactoryStub(array('system.theme' => array( diff --git a/core/modules/book/tests/Drupal/book/Tests/Menu/BookLocalTasksTest.php b/core/modules/book/tests/Drupal/book/Tests/Menu/BookLocalTasksTest.php index 83bae97..2f8d749 100644 --- a/core/modules/book/tests/Drupal/book/Tests/Menu/BookLocalTasksTest.php +++ b/core/modules/book/tests/Drupal/book/Tests/Menu/BookLocalTasksTest.php @@ -27,8 +27,8 @@ public static function getInfo() { public function setUp() { $this->moduleList = array( - 'book' => 'core/modules/book/book.info', - 'node' => 'core/modules/node/node.info', + 'book' => 'core/modules/book/book.info.yml', + 'node' => 'core/modules/node/node.info.yml', ); parent::setUp(); } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php index 7325a68..558bdfd 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/Derivative/ContentTranslationLocalTasks.php @@ -84,7 +84,6 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { $this->derivatives[$translation_tab]['route_name'] = $translation_route_name; } } - debug($this->derivatives); return parent::getDerivativeDefinitions($base_plugin_definition); } @@ -107,7 +106,6 @@ public function alterLocalTasks(array &$local_tasks) { } } } - debug($local_tasks); } /** diff --git a/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php b/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php index de463e6..cde6985 100644 --- a/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php +++ b/core/modules/content_translation/tests/Drupal/content_translation/Tests/Menu/ContentTranslationLocalTasksTest.php @@ -27,8 +27,8 @@ public static function getInfo() { public function setUp() { $this->moduleList = array( - 'content_translation' => 'core/modules/content_translation/content_translation.info', - 'node' => 'core/modules/node/node.info', + 'content_translation' => 'core/modules/content_translation/content_translation.info.yml', + 'node' => 'core/modules/node/node.info.yml', ); parent::setUp(); @@ -59,22 +59,21 @@ public function setUp() { $collection->expects($this->any()) ->method('all') ->will($this->returnValue(array('node.view' => array()))); - $route_provider = $this->getMockBuilder('Drupal\Core\Routing\RouteProvider') - ->disableOriginalConstructor() - ->getMock(); + $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface'); $route_provider->expects($this->any()) ->method('getRoutesByPattern') ->will($this->returnValue($collection)); \Drupal::getContainer()->set('router.route_provider', $route_provider); // Stub for t(). - $string_translation = $this->getMockBuilder('Drupal\Core\StringTranslation\TranslationManager') - ->disableOriginalConstructor() - ->getMock(); + $string_translation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface'); $string_translation->expects($this->any()) ->method('translate') ->will($this->returnCallback(function($string) {return $string;})); \Drupal::getContainer()->set('string_translation', $string_translation); + + // Load the content_translation.module file in order to run the alter hook. + require_once DRUPAL_ROOT . '/core/modules/content_translation/content_translation.module'; } /** diff --git a/core/modules/locale/tests/Drupal/locale/Tests/Menu/LocaleLocalTasksTest.php b/core/modules/locale/tests/Drupal/locale/Tests/Menu/LocaleLocalTasksTest.php index fcfa785..4c18831 100644 --- a/core/modules/locale/tests/Drupal/locale/Tests/Menu/LocaleLocalTasksTest.php +++ b/core/modules/locale/tests/Drupal/locale/Tests/Menu/LocaleLocalTasksTest.php @@ -27,7 +27,7 @@ public static function getInfo() { public function setUp() { $this->moduleList = array( - 'locale' => 'core/modules/locale/locale.info', + 'locale' => 'core/modules/locale/locale.info.yml', ); parent::setUp(); } diff --git a/core/modules/shortcut/tests/Drupal/shortcut/Tests/Menu/ShortcutLocalTasksTest.php b/core/modules/shortcut/tests/Drupal/shortcut/Tests/Menu/ShortcutLocalTasksTest.php index 71943ad..ff8bd7e 100644 --- a/core/modules/shortcut/tests/Drupal/shortcut/Tests/Menu/ShortcutLocalTasksTest.php +++ b/core/modules/shortcut/tests/Drupal/shortcut/Tests/Menu/ShortcutLocalTasksTest.php @@ -27,8 +27,8 @@ public static function getInfo() { public function setUp() { $this->moduleList = array( - 'shortcut' => 'core/modules/shortcut/shortcut.info', - 'user' => 'core/modules/user/user.info', + 'shortcut' => 'core/modules/shortcut/shortcut.info.yml', + 'user' => 'core/modules/user/user.info.yml', ); parent::setUp(); } diff --git a/core/modules/user/tests/Drupal/user/Tests/Menu/UserLocalTasksTest.php b/core/modules/user/tests/Drupal/user/Tests/Menu/UserLocalTasksTest.php index ae2637e..a978178 100644 --- a/core/modules/user/tests/Drupal/user/Tests/Menu/UserLocalTasksTest.php +++ b/core/modules/user/tests/Drupal/user/Tests/Menu/UserLocalTasksTest.php @@ -26,7 +26,7 @@ public static function getInfo() { } public function setUp() { - $this->moduleList = array('user' => 'core/modules/user/user.info'); + $this->moduleList = array('user' => 'core/modules/user/user.info.yml'); parent::setUp(); } diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php index 705347e..61ee601 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTest.php @@ -80,6 +80,10 @@ protected function getLocalTaskManager($modules, $route_name, $route_params) { $property->setAccessible(TRUE); $property->setValue($manager, $pluginDiscovery); + $method = new \ReflectionMethod('Drupal\Core\Menu\LocalTaskManager', 'alterInfo'); + $method->setAccessible(TRUE); + $method->invoke($manager, $module_handler, 'local_tasks'); + $plugin_stub = $this->getMock('Drupal\Core\Menu\LocalTaskInterface'); $factory = $this->getMock('Drupal\Component\Plugin\Factory\FactoryInterface'); $factory->expects($this->any())