
| Current Path : /var/www/html/rocksensor1/web/core/modules/book/tests/src/Unit/Menu/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php |
<?php
declare(strict_types=1);
namespace Drupal\Tests\book\Unit\Menu;
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
/**
* Tests existence of book local tasks.
*
* @group book
* @group legacy
*/
class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
/**
* {@inheritdoc}
*/
protected function setUp(): void {
$this->directoryList = [
'book' => 'core/modules/book',
'node' => 'core/modules/node',
];
parent::setUp();
}
/**
* Tests local task existence.
*
* @dataProvider getBookAdminRoutes
*/
public function testBookAdminLocalTasks($route): void {
$this->assertLocalTasks($route, [
0 => ['book.admin', 'book.settings'],
]);
}
/**
* Provides a list of routes to test.
*/
public static function getBookAdminRoutes() {
return [
['book.admin'],
['book.settings'],
];
}
/**
* Tests local task existence.
*
* @dataProvider getBookNodeRoutes
*/
public function testBookNodeLocalTasks($route): void {
$this->assertLocalTasks($route, [
0 => ['entity.node.book_outline_form', 'entity.node.canonical', 'entity.node.edit_form', 'entity.node.delete_form', 'entity.node.version_history'],
]);
}
/**
* Provides a list of routes to test.
*/
public static function getBookNodeRoutes() {
return [
['entity.node.canonical'],
['entity.node.book_outline_form'],
];
}
}