// Try to move the child to a different book while saving it as a pending
// revision.
/** @var \Drupal\book\BookManagerInterface $book_manager */
$book_manager =
$this->container->
get('book.manager'
);
// Check that the API doesn't allow us to change the book outline for
// pending revisions.
$child->book
['bid'
] =
$book_2->
id();
$child->
setNewRevision(TRUE
);
$child->
isDefaultRevision(FALSE
);
$this->
assertFalse($book_manager->
updateOutline($child), 'A pending revision can not change the book outline.'
);
// Check that the API doesn't allow us to change the book parent for
// pending revisions.
$child = \Drupal::
entityTypeManager()->
getStorage('node'
)->
loadUnchanged($child->
id());
$child->book
['pid'
] =
$book_1_child->
id();
$child->
setNewRevision(TRUE
);
$child->
isDefaultRevision(FALSE
);
$this->
assertFalse($book_manager->
updateOutline($child), 'A pending revision can not change the book outline.'
);
// Check that the API doesn't allow us to change the book weight for