BookLocalTasksTest.php in Drupal 8
File
core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php
View source
<?php
namespace Drupal\Tests\book\Unit\Menu;
use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
protected function setUp() {
$this->directoryList = [
'book' => 'core/modules/book',
'node' => 'core/modules/node',
];
parent::setUp();
}
public function testBookAdminLocalTasks($route) {
$this
->assertLocalTasks($route, [
0 => [
'book.admin',
'book.settings',
],
]);
}
public function getBookAdminRoutes() {
return [
[
'book.admin',
],
[
'book.settings',
],
];
}
public function testBookNodeLocalTasks($route) {
$this
->assertLocalTasks($route, [
0 => [
'entity.node.book_outline_form',
'entity.node.canonical',
'entity.node.edit_form',
'entity.node.delete_form',
'entity.node.version_history',
],
]);
}
public function getBookNodeRoutes() {
return [
[
'entity.node.canonical',
],
[
'entity.node.book_outline_form',
],
];
}
}