Checks the order of CRUD hook execution messages.
entity_crud_hook_test.module implements all core entity CRUD hooks and stores a message for each in $_SESSION['entity_crud_hook_test'].
$messages: An array of plain-text messages in the order they should appear.
protected function assertHookMessageOrder($messages) {
$positions = array();
foreach ($messages as $message) {
// Verify that each message is found and record its position.
$position = array_search($message, $_SESSION['entity_crud_hook_test']);
if ($this
->assertTrue($position !== FALSE, $message)) {
$positions[] = $position;
}
}
// Sort the positions and ensure they remain in the same order.
$sorted = $positions;
sort($sorted);
$this
->assertTrue($sorted == $positions, 'The hook messages appear in the correct order.');
}