Skip to content
Snippets Groups Projects

tests performances

Merged Patrick Barroca requested to merge diagnose-test-perf into master
Compare and
5 files
+ 49
18
Preferences
Compare changes
Files
5
@@ -30,10 +30,33 @@ class Class_Journal_Type {
PREVIOUS_VALUE = 'previous_value',
NEW_VALUE = 'new_value';
protected static $_enabled = true;
protected $_journal;
/** @category testing */
public static function disable() {
static::$_enabled = false;
}
/** @category testing */
public static function enable() {
static::$_enabled = true;
}
/** @category testing */
protected static function _isEnabled() {
return static::$_enabled;
}
public static function save($model) {
if (!static::_isEnabled())
return;
$journal = Class_Journal::newInstance(['type' => static::MY_TYPE]);
if (!$journal->save())
return;