function _webform_test_load_include in Webform 8.5
Same name and namespace in other branches
- 6.x tests/modules/webform_test/webform_test.module \_webform_test_load_include()
Load webform test include file.
Parameters
string $id: The webform ID.
Return value
string|bool The webform test generating name or FALSE if the webform has not test include file.
2 calls to _webform_test_load_include()
- webform_test_preprocess_page in tests/
modules/ webform_test/ webform_test.module - Implements hook_preprocess_HOOK().
- webform_test_webform_load in tests/
modules/ webform_test/ webform_test.module - Implements hook_webform_load().
File
- tests/
modules/ webform_test/ webform_test.module, line 119 - Support module for webform related testing.
Code
function _webform_test_load_include($id) {
if (preg_match('/^(test_form_(?:wizard_)?long|test_cards_long)_\\d+$/', $id, $match)) {
$id = $match[1];
}
$include_base_path = drupal_get_path('module', 'webform_test') . '/includes';
if (file_exists("{$include_base_path}/webform_test.{$id}.inc")) {
module_load_include('inc', 'webform_test', 'includes/webform_test.' . $id);
return $id;
}
else {
return FALSE;
}
}