diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php index 66edec9..d81b370 100644 --- a/core/modules/book/tests/src/Functional/BookTest.php +++ b/core/modules/book/tests/src/Functional/BookTest.php @@ -749,4 +749,21 @@ public function testBookNavigationBlockOnUnpublishedBook() { $this->assertText($this->book->label(), 'Unpublished book with "Show block only on book pages" book navigation settings.'); } + /** + * Tests that forward revisions can not modify the book outline. + */ + public function testBookWithForwardRevisions() { + $this->drupalLogin($this->bookAuthor); + $this->book = $this->createBookNode('new'); + + /** @var \Drupal\book\BookManagerInterface $book_manager */ + $book_manager = $this->container->get('book.manager'); + + $this->book->setNewRevision(TRUE); + $this->book->isDefaultRevision(FALSE); + + $return = $book_manager->updateOutline($this->book); + $this->assertFalse($return, 'A forward revision can not change the book outline.'); + } + }