More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / modules / book / tests / src / Unit / Menu / BookLocalTasksTest.php
1 <?php
2
3 namespace Drupal\Tests\book\Unit\Menu;
4
5 use Drupal\Tests\Core\Menu\LocalTaskIntegrationTestBase;
6
7 /**
8  * Tests existence of book local tasks.
9  *
10  * @group book
11  */
12 class BookLocalTasksTest extends LocalTaskIntegrationTestBase {
13
14   protected function setUp() {
15     $this->directoryList = [
16       'book' => 'core/modules/book',
17       'node' => 'core/modules/node',
18     ];
19     parent::setUp();
20   }
21
22   /**
23    * Tests local task existence.
24    *
25    * @dataProvider getBookAdminRoutes
26    */
27   public function testBookAdminLocalTasks($route) {
28
29     $this->assertLocalTasks($route, [
30       0 => ['book.admin', 'book.settings'],
31     ]);
32   }
33
34   /**
35    * Provides a list of routes to test.
36    */
37   public function getBookAdminRoutes() {
38     return [
39       ['book.admin'],
40       ['book.settings'],
41     ];
42   }
43
44   /**
45    * Tests local task existence.
46    *
47    * @dataProvider getBookNodeRoutes
48    */
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'],
52     ]);
53   }
54
55   /**
56    * Provides a list of routes to test.
57    */
58   public function getBookNodeRoutes() {
59     return [
60       ['entity.node.canonical'],
61       ['entity.node.book_outline_form'],
62     ];
63   }
64
65 }