diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php index 28ccb5d..729b4f6 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/LocalTasksTest.php @@ -199,9 +199,11 @@ public function testPluginLocalTask() { $this->assertEqual($definitions['menu_local_task_test_tasks_settings_sub2']['provider'], 'menu_test'); $this->assertEqual($definitions['menu_local_task_test_tasks_settings_sub3']['provider'], 'menu_test'); + // Create an entity which will be used in the following upcasting tests. $entity = \Drupal::entityManager()->getStorageController('entity_test')->create(array('bundle' => 'test')); $entity->save(); + // Check the sub1 tab is the only active tab. $this->drupalGet('menu-local-task-test-upcasting/1/sub1'); $tasks = array( @@ -211,9 +213,11 @@ public function testPluginLocalTask() { $this->assertLocalTasks($tasks, 0); $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]'); - $this->assertEqual(1, count($result), 'There are tabs active on both levels.'); - $this->assertEqual('upcasting sub1', (string) $result[0]->a, 'The settings tab is active.'); + $this->assertEqual(1, count($result), 'There is just a single active tab.'); + $this->assertEqual('upcasting sub1', (string) $result[0]->a, 'The sub1 tab is active.'); + // Switch tabs to check that the sub1 tab is no longer active and that the + // sub2 tab is the only active tab. $this->drupalGet('menu-local-task-test-upcasting/1/sub2'); $tasks = array( @@ -223,8 +227,8 @@ public function testPluginLocalTask() { $this->assertLocalTasks($tasks, 0); $result = $this->xpath('//ul[contains(@class, "tabs")]//li[contains(@class, "active")]'); - $this->assertEqual(1, count($result), 'There are tabs active on both levels.'); - $this->assertEqual('upcasting sub2', (string) $result[0]->a, 'The settings tab is active.'); + $this->assertEqual(1, count($result), 'There is just a single active tab.'); + $this->assertEqual('upcasting sub2', (string) $result[0]->a, 'The sub2 tab is active.'); } }