function __construct() { $this->dropTables('all'); AkUnitTestSuite::cleanupTmpDir(); $Config = new AkConfig(); $Config->clearStaticCache('database'); parent::__construct(); }
public function __construct() { parent::__construct(); /* Create Mocks */ $callbacks_during_save = array('beforeCreate', 'beforeValidation', 'beforeValidationOnUpdate', 'beforeValidationOnCreate', 'beforeSave', 'beforeUpdate', 'beforeDestroy', 'afterCreate', 'afterValidation', 'afterValidationOnUpdate', 'afterValidationOnCreate', 'afterSave', 'afterUpdate', 'afterDestroy'); function Callbacks_TestCase_createClass($classname, $parent, $functions, $function_body) { $class_code = "class {$classname} extends {$parent} { public \$__called = array(); "; foreach ($functions as $function) { $class_code .= "public function {$function}(){" . $function_body . "}"; } $class_code .= "}"; eval($class_code); } Callbacks_TestCase_createClass('TestCallback', 'ActiveRecord', $callbacks_during_save, '$this->__called[]=__FUNCTION__;return true;'); Callbacks_TestCase_createClass('TestObserver', 'AkObserver', $callbacks_during_save, '$this->__called[]=__FUNCTION__;return true;'); }
public function __construct() { parent::__construct(); $this->installAndIncludeModels(array('Picture', 'Thumbnail', 'Panorama', 'Property', 'PropertyType', 'Person', 'Account', 'Location')); }