894232344b7ae1f5c889bc77d8e05408de9f0a33
[yaffs-website] / web / core / modules / taxonomy / tests / src / Unit / Menu / TaxonomyLocalTasksTest.php
1 <?php
2
3 namespace Drupal\Tests\taxonomy\Unit\Menu;
4
5 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
6
7 /**
8  * Tests existence of taxonomy local tasks.
9  *
10  * @group taxonomy
11  */
12 class TaxonomyLocalTasksTest extends LocalTaskIntegrationTestBase {
13
14   protected function setUp() {
15     $this->directoryList = ['taxonomy' => 'core/modules/taxonomy'];
16     parent::setUp();
17   }
18
19   /**
20    * Checks taxonomy edit local tasks.
21    *
22    * @dataProvider getTaxonomyPageRoutes
23    */
24   public function testTaxonomyPageLocalTasks($route, $subtask = []) {
25     $tasks = [
26       0 => ['entity.taxonomy_term.canonical', 'entity.taxonomy_term.edit_form'],
27     ];
28     if ($subtask) {
29       $tasks[] = $subtask;
30     }
31     $this->assertLocalTasks($route, $tasks);
32   }
33
34   /**
35    * Provides a list of routes to test.
36    */
37   public function getTaxonomyPageRoutes() {
38     return [
39       ['entity.taxonomy_term.canonical'],
40       ['entity.taxonomy_term.edit_form'],
41     ];
42   }
43
44 }