summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2014-06-13 02:49:19 (GMT)
committerwebchick2014-06-13 02:49:19 (GMT)
commitd4ac8181c8c7d549a1e1629219f40127ffc297d0 (patch)
tree36332af814f250c674b4fbbc4080f3b80a34e614
parented310e10602159d07226f302074a3985a4c6b9a7 (diff)
Issue #2250325 by jhodgdon, azinck, splatio: Fixed Route book.render (path /book) does not seem to work.
-rw-r--r--core/modules/book/src/Controller/BookController.php2
-rw-r--r--core/modules/book/src/Tests/BookTest.php15
2 files changed, 16 insertions, 1 deletions
diff --git a/core/modules/book/src/Controller/BookController.php b/core/modules/book/src/Controller/BookController.php
index dec592c..305a0b9 100644
--- a/core/modules/book/src/Controller/BookController.php
+++ b/core/modules/book/src/Controller/BookController.php
@@ -105,7 +105,7 @@ class BookController implements ContainerInjectionInterface {
public function bookRender() {
$book_list = array();
foreach ($this->bookManager->getAllBooks() as $book) {
- $book_list[] = l($book['title'], $book['href'], $book['options']);
+ $book_list[] = l($book['title'], $book['link_path']);
}
return array(
'#theme' => 'item_list',
diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php
index cfd7559..6d8b321 100644
--- a/core/modules/book/src/Tests/BookTest.php
+++ b/core/modules/book/src/Tests/BookTest.php
@@ -605,4 +605,19 @@ class BookTest extends WebTestBase {
$this->assertEqual($return, $link);
}
+ /**
+ * Tests the listing of all books.
+ */
+ public function testBookListing() {
+ // Create a new book.
+ $this->createBook();
+
+ // Must be a user with 'node test view' permission since node_access_test is enabled.
+ $this->drupalLogin($this->web_user);
+
+ // Load the book page and assert the created book title is displayed.
+ $this->drupalGet('book');
+
+ $this->assertText($this->book->label(), 'The book title is displayed on the book listing page.');
+ }
}