diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index c5cf8ed..0861a3b 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -756,8 +756,10 @@ public function testHookNodeLoadAccess() { * Tests that an unpublished parent node does not result in an error when viewing its child. */ public function testUnpublishedHierarchy() { - // Create a new book. - $this->createBook(); + // Create new book. + + $nodes = $this->createBook(); + $book = $this->book; /* * Add Node 5 under Node 2. @@ -770,23 +772,19 @@ public function testUnpublishedHierarchy() { * |- Node 5 * |- Node 4 */ + //$nodes = array(); $nodes[] = $this->createBookNode($book->id(), $nodes[2]->book['nid']); // Node 5. // Unpublish Node 2 $node_storage = $this->container->get('entity.manager')->getStorage('node'); $unpublished_node = $node_storage->load($nodes[2]->id()); $unpublished_node->status = 0; - node_save($unpublished_node); - - // Test existance of error - + $unpublished_node->save(); // Log in as public user. $this->drupalLogin($this->webUser); - $this->drupalGet('node/'.load($this->book->id($nodes[5]->id()))); + $this->drupalGet('node/'.$node_storage->load($nodes[5]->id())); $this->assertNoText(t('Undefined index: title in template_preprocess_book_navigation()'), 'The text "Undefined index: title in template_preprocess_book_navigation()" does NOT appear on the page node/5.'); - - } }