Commit 16fb258c authored by alexpott's avatar alexpott

Issue #2208325 by mcjim, anksy: Incorrect error message when changing the outline of a book page.

parent 797c8de1
......@@ -818,6 +818,7 @@ public function saveBookLink(array $link, $new) {
foreach ($affected_bids as $bid) {
\Drupal::cache('data')->deleteTags(array('bid' => $bid));
}
return $link;
}
/**
......
......@@ -585,4 +585,24 @@ public function testBookOutline() {
$this->assertOptionSelected('edit-book-bid', $node->id());
}
/**
* Tests that saveBookLink() returns something.
*/
public function testSaveBookLink() {
$book_manager = \Drupal::service('book.manager');
// Mock a link for a new book.
$link = array('nid' => 1, 'has_children' => 0, 'original_bid' => 0, 'parent_depth_limit' => 8, 'pid' => 0, 'weight' => 0, 'bid' => 1);
$new = TRUE;
// Save the link.
$return = $book_manager->saveBookLink($link, $new);
// Add the link defaults to $link so we have something to compare to the return from saveBookLink().
$link += $book_manager->getLinkDefaults($link['nid']);
// Test the return from saveBookLink.
$this->assertEqual($return, $link);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment