if (empty($data['test_class'])) {
$this->jerr("missing test_class for template $name");
}
- $cm->test_class = $cm;
+ $cm->test_class = $data['test_class'];
}
require_once $cm->test_class . '.php';
+
$clsname = str_replace('/','_', $cm->test_class);
- $method = new ReflectionMethod($clsname , 'test_'. $name) ;
- if (!$method->isStatic()) {
+ try {
+ $method = new ReflectionMethod($clsname , 'test_'. $name) ;
+ $got_it = $method->isStatic();
+ } catch(Exception $e) {
+ $got_it = false;
+
+ }
+ if (!$got_it) {
$this->jerr("template {$name} does not have a test method {$clsname}::test_{$name}");
}
- if ($up) {
+ if ($update) {
$cm->update($old);
+ echo "email: {$name} - checked\n";
continue; /// we do not import the body content of templates that exist...
} else {
$cm->insert();
$opts = array(
'update' => 1,
- 'file' => $mail_template_dir. $name .'.html'
+ 'file' => $templateDir. $name .'.html'
);
if (!empty($data['master'])) {
- $opts['master'] = $mail_template_dir . $master .'.html';
+ $opts['master'] = $templateDir . $master .'.html';
}
require_once 'Pman/Core/Import/Core_email.php';
$x = new Pman_Core_Import_Core_email();
$x->get('', $opts);
+
+ echo "email: {$name} - CREATED\n";
}
}