function BookTest::testAdminBookListing

Same name in other branches
  1. 9 core/modules/book/tests/src/Functional/BookTest.php \Drupal\Tests\book\Functional\BookTest::testAdminBookListing()
  2. 10 core/modules/book/tests/src/Functional/BookTest.php \Drupal\Tests\book\Functional\BookTest::testAdminBookListing()
  3. 11.x core/modules/book/tests/src/Functional/BookTest.php \Drupal\Tests\book\Functional\BookTest::testAdminBookListing()

Tests the administrative listing of all books.

File

core/modules/book/tests/src/Functional/BookTest.php, line 560

Class

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

Namespace

Drupal\Tests\book\Functional

Code

public function testAdminBookListing() {
    // Create a new book.
    $this->createBook();
    // Load the book page and assert the created book title is displayed.
    $this->drupalLogin($this->adminUser);
    $this->drupalGet('admin/structure/book');
    $this->assertText($this->book
        ->label(), 'The book title is displayed on the administrative book listing page.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.