public function BookTest::testAdminBookNodeListing in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/book/src/Tests/BookTest.php \Drupal\book\Tests\BookTest::testAdminBookNodeListing()
Tests the administrative listing of all book pages in a book.
File
- core/
modules/ book/ src/ Tests/ BookTest.php, line 634 - Contains \Drupal\book\Tests\BookTest.
Class
- BookTest
- Create a book, add pages, and test book interface.
Namespace
Drupal\book\TestsCode
public function testAdminBookNodeListing() {
// Create a new book.
$this
->createBook();
$this
->drupalLogin($this->adminUser);
// Load the book page list and assert the created book title is displayed
// and action links are shown on list items.
$this
->drupalGet('admin/structure/book/' . $this->book
->id());
$this
->assertText($this->book
->label(), 'The book title is displayed on the administrative book listing page.');
$elements = $this
->xpath('//table//ul[@class="dropbutton"]/li/a');
$this
->assertEqual((string) $elements[0], 'View', 'View link is found from the list.');
}