function ModuleBuilderModuleGenerationTestCase::assertFileHeader in Module Builder 8.3
Assert a string contains the correct file header.
Parameters
$string: The text to check for a docblock.
$message = NULL: The assertion message.
1 call to ModuleBuilderModuleGenerationTestCase::assertFileHeader()
- ModuleBuilderModuleGenerationTestCase::testModuleGeneration in tests/
module_builder.test - Test generating module code.
File
- tests/
module_builder.test, line 226 - Contains tests for the Module builder module.
Class
- ModuleBuilderModuleGenerationTestCase
- Test case for Module Builder module generation.
Code
function assertFileHeader($string, $message = NULL) {
$expected_string = "^<\\?php\n" . "\n" . "/\\*\\*\n" . " \\* @file.*\n" . " \\* .*\n" . " \\*/\n";
$match = preg_match("[{$expected_string}]", $string);
$this
->assertTrue($match, $message);
}