X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fbook%2Ftests%2Fsrc%2FUnit%2FMenu%2FBookLocalTasksTest.php;fp=web%2Fcore%2Fmodules%2Fbook%2Ftests%2Fsrc%2FUnit%2FMenu%2FBookLocalTasksTest.php;h=7abbc5c0ea8a015ab7f673904342e53a44025946;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php b/web/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php new file mode 100644 index 000000000..7abbc5c0e --- /dev/null +++ b/web/core/modules/book/tests/src/Unit/Menu/BookLocalTasksTest.php @@ -0,0 +1,65 @@ +directoryList = [ + 'book' => 'core/modules/book', + 'node' => 'core/modules/node', + ]; + parent::setUp(); + } + + /** + * Tests local task existence. + * + * @dataProvider getBookAdminRoutes + */ + public function testBookAdminLocalTasks($route) { + + $this->assertLocalTasks($route, [ + 0 => ['book.admin', 'book.settings'], + ]); + } + + /** + * Provides a list of routes to test. + */ + public function getBookAdminRoutes() { + return [ + ['book.admin'], + ['book.settings'], + ]; + } + + /** + * Tests local task existence. + * + * @dataProvider getBookNodeRoutes + */ + 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'], + ]); + } + + /** + * Provides a list of routes to test. + */ + public function getBookNodeRoutes() { + return [ + ['entity.node.canonical'], + ['entity.node.book_outline_form'], + ]; + } + +}