You are here

protected function EntityCrudHookTestCase::assertHookMessage in Drupal 7

Pass if the message $text was set by one of the CRUD hooks in entity_crud_hook_test.module, i.e., if the $text is an element of $_SESSION['entity_crud_hook_test'].

Parameters

$text: Plain text to look for.

$message: Message to display.

$group: The group this message belongs to, defaults to 'Other'.

Return value

TRUE on pass, FALSE on fail.

6 calls to EntityCrudHookTestCase::assertHookMessage()
EntityCrudHookTestCase::testCommentHooks in modules/simpletest/tests/entity_crud_hook_test.test
Tests hook invocations for CRUD operations on comments.
EntityCrudHookTestCase::testFileHooks in modules/simpletest/tests/entity_crud_hook_test.test
Tests hook invocations for CRUD operations on files.
EntityCrudHookTestCase::testNodeHooks in modules/simpletest/tests/entity_crud_hook_test.test
Tests hook invocations for CRUD operations on nodes.
EntityCrudHookTestCase::testTaxonomyTermHooks in modules/simpletest/tests/entity_crud_hook_test.test
Tests hook invocations for CRUD operations on taxonomy terms.
EntityCrudHookTestCase::testTaxonomyVocabularyHooks in modules/simpletest/tests/entity_crud_hook_test.test
Tests hook invocations for CRUD operations on taxonomy vocabularies.

... See full list

File

modules/simpletest/tests/entity_crud_hook_test.test, line 49
CRUD hook tests for the Entity CRUD API.

Class

EntityCrudHookTestCase
Tests invocation of hooks when performing an action.

Code

protected function assertHookMessage($text, $message = NULL, $group = 'Other') {
  if (!isset($message)) {
    $message = $text;
  }
  return $this
    ->assertTrue(array_search($text, $_SESSION['entity_crud_hook_test']) !== FALSE, $message, $group);
}