You are here

function ModuleBuilderModuleGenerationTestCase::assertHookDocblock in Module Builder 8.3

Assert a string contains a PHP docblock for a hook.

Parameters

$string: The text to check for a docblock.

$hook_name: The full name of the hook, e.g. 'hook_menu'.

$message = NULL: The assertion message.

1 call to ModuleBuilderModuleGenerationTestCase::assertHookDocblock()
ModuleBuilderModuleGenerationTestCase::testModuleGeneration in tests/module_builder.test
Test generating module code.

File

tests/module_builder.test, line 249
Contains tests for the Module builder module.

Class

ModuleBuilderModuleGenerationTestCase
Test case for Module Builder module generation.

Code

function assertHookDocblock($string, $hook_name, $message = NULL) {
  $docblock = "/**\n" . " * Implements {$hook_name}().\n" . " */";
  $position = strstr($string, $docblock);
  $this
    ->assertTrue($position !== FALSE, $message);
}