class TaxonomyLocalTasksTest
Same name and namespace in other branches
- 11.x core/modules/taxonomy/tests/src/Unit/Menu/TaxonomyLocalTasksTest.php \Drupal\Tests\taxonomy\Unit\Menu\TaxonomyLocalTasksTest
Tests existence of taxonomy local tasks.
@group taxonomy
Hierarchy
- class \Drupal\Tests\UnitTestCase uses \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase implements \Drupal\Tests\UnitTestCase
- class \Drupal\Tests\taxonomy\Unit\Menu\TaxonomyLocalTasksTest implements \Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase
- class \Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase implements \Drupal\Tests\UnitTestCase
Expanded class hierarchy of TaxonomyLocalTasksTest
File
-
core/
modules/ taxonomy/ tests/ src/ Unit/ Menu/ TaxonomyLocalTasksTest.php, line 12
Namespace
Drupal\Tests\taxonomy\Unit\MenuView source
class TaxonomyLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() : void {
$this->directoryList = [
'taxonomy' => 'core/modules/taxonomy',
];
parent::setUp();
}
/**
* Checks taxonomy edit local tasks.
*
* @dataProvider getTaxonomyPageRoutes
*/
public function testTaxonomyPageLocalTasks($route, $subtask = []) {
$tasks = [
0 => [
'entity.taxonomy_term.canonical',
'entity.taxonomy_term.edit_form',
'entity.taxonomy_term.delete_form',
],
];
if ($subtask) {
$tasks[] = $subtask;
}
$this->assertLocalTasks($route, $tasks);
}
/**
* Provides a list of routes to test.
*/
public function getTaxonomyPageRoutes() {
return [
[
'entity.taxonomy_term.canonical',
],
[
'entity.taxonomy_term.edit_form',
],
];
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.