3 namespace Drupal\Tests\book\Unit\Menu;
5 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
8 * Tests existence of book local tasks.
12 class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
14 protected function setUp() {
15 $this->directoryList = [
16 'book' => 'core/modules/book',
17 'node' => 'core/modules/node',
23 * Tests local task existence.
25 * @dataProvider getBookAdminRoutes
27 public function testBookAdminLocalTasks($route) {
29 $this->assertLocalTasks($route, [
30 0 => ['book.admin', 'book.settings'],
35 * Provides a list of routes to test.
37 public function getBookAdminRoutes() {
45 * Tests local task existence.
47 * @dataProvider getBookNodeRoutes
49 public function testBookNodeLocalTasks($route) {
50 $this->assertLocalTasks($route, [
51 0 => ['entity.node.book_outline_form', 'entity.node.canonical', 'entity.node.edit_form', 'entity.node.delete_form', 'entity.node.version_history'],
56 * Provides a list of routes to test.
58 public function getBookNodeRoutes() {
60 ['entity.node.canonical'],
61 ['entity.node.book_outline_form'],