You are here

public function BookTest::testBookListing in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/book/src/Tests/BookTest.php \Drupal\book\Tests\BookTest::testBookListing()

Tests the listing of all books.

File

core/modules/book/src/Tests/BookTest.php, line 605
Contains \Drupal\book\Tests\BookTest.

Class

BookTest
Create a book, add pages, and test book interface.

Namespace

Drupal\book\Tests

Code

public function testBookListing() {

  // Create a new book.
  $this
    ->createBook();

  // Must be a user with 'node test view' permission since node_access_test is installed.
  $this
    ->drupalLogin($this->webUser);

  // 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.');
}