diff --git a/core/modules/book/tests/src/Functional/BookContentModerationTest.php b/core/modules/book/tests/src/Functional/BookContentModerationTest.php index a6101c4..35af282 100644 --- a/core/modules/book/tests/src/Functional/BookContentModerationTest.php +++ b/core/modules/book/tests/src/Functional/BookContentModerationTest.php @@ -56,6 +56,15 @@ public function testBookWithForwardRevisions() { $this->checkBookNode($book_1, [$book_1_nodes[0], $book_1_nodes[3], $book_1_nodes[4]], FALSE, FALSE, $book_1_nodes[0], []); $this->checkBookNode($book_1_nodes[0], [$book_1_nodes[1], $book_1_nodes[2]], $book_1, $book_1, $book_1_nodes[1], [$book_1]); + // Create a new book page without actually attaching it to a book and create + // a draft. + $edit = ['title[0][value]' => $this->randomString()]; + $this->drupalPostForm('node/add/book', $edit, t('Save and Publish')); + $node = $this->drupalGetNodeByTitle($edit['title[0][value]']); + $this->assertTrue($node); + $this->drupalPostForm('node/' . $node->id() . '/edit', [], t('Save and Create New Draft')); + $this->assertSession()->pageTextNotContains('You can only change the book outline for the published version of this content.'); + // Create a book draft with no changes, then publish it. $this->drupalPostForm('node/' . $book_1->id() . '/edit', [], t('Save and Create New Draft')); $this->assertSession()->pageTextNotContains('You can only change the book outline for the published version of this content.');