* Name for this example file (CamelCase) - if omitted the action name will be substituted.
*/
private function documentMe($entity, $action, $params, $result, $testFunction, $testFile, $description = "", $exampleName = NULL) {
- if (defined('DONT_DOCUMENT_TEST_CONFIG') && DONT_DOCUMENT_TEST_CONFIG) {
+ if ($params['version'] != 3 || (defined('DONT_DOCUMENT_TEST_CONFIG') && DONT_DOCUMENT_TEST_CONFIG)) {
return;
}
$entity = _civicrm_api_get_camel_name($entity);
if (!is_dir($civicrm_root . "/api/v3/examples/$entity")) {
mkdir($civicrm_root . "/api/v3/examples/$entity");
}
- $f = fopen($civicrm_root . "/api/v3/examples/$entity/$exampleName.php", "w+b");
- fwrite($f, $smarty->fetch($civicrm_root . '/tests/templates/documentFunction.tpl'));
+ $f = fopen($civicrm_root . "/api/v3/examples/$entity/$exampleName.ex.php", "w+b");
+ $contents = $smarty->fetch($civicrm_root . '/tests/templates/documentFunction.tpl');
+ $contents = \CRM_Core_CodeGen_Util_ArraySyntaxConverter::convert($contents);
+ fwrite($f, $contents);
fclose($f);
}
}