// Create two books.
$book_1_nodes =
$this->
createBook(['moderation_state[0][state]' => 'published'
]);
$book_1 =
$this->book;
$this->
createBook(['moderation_state[0][state]' => 'published'
]);
$book_2 =
$this->book;
$this->
drupalLogin($this->bookAuthor
);
// Check that book pages display along with the correct outlines.
$this->book =
$book_1;
$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(),
'moderation_state[0][state]' => 'published',
];
$this->
drupalGet('node/add/book'
);
$this->
submitForm($edit, 'Save'
);
$node =
$this->
drupalGetNodeByTitle($edit['title[0][value]'
]);