You are here

function ModuleBuilderModuleGenerationTestCase::assertNoHookDocblock in Module Builder 8.3

Assert a string does not contain 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::assertNoHookDocblock()
ModuleBuilderModuleGenerationTestCase::testModuleGeneration in tests/module_builder.test
Test generating module code.

File

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

Class

ModuleBuilderModuleGenerationTestCase
Test case for Module Builder module generation.

Code

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