예제 #1
0
 public function startCase()
 {
     MockTransactionManager::begin($this->datasource);
     MockTransactionManager::rollback($this->datasource);
     MockTransactionManager::destructs();
     MockTransactionManager::reset();
     parent::startCase();
 }
예제 #2
0
 public function startCase()
 {
     $this->modelName = str_replace('TestCase', '', get_class($this));
     $this->modelClass = $this->modelName;
     if (class_exists('Test' . $this->modelClass)) {
         $this->modelClass = 'Test' . $this->modelClass;
     }
     parent::startCase();
 }
예제 #3
0
 public function startCase()
 {
     parent::startCase();
     $this->_routingBackup = Configure::read('Routing');
     $this->_cacheBackup = Configure::read('Cache');
     Configure::write('Routing', null);
     Configure::write('Cache.disable', false);
     ClassRegistry::init(array('class' => 'AutoSlugRouteTestPost', 'alias' => 'Post'));
 }
예제 #4
0
 public function startCase()
 {
     $this->behaviorName = str_replace('BehaviorTestCase', '', get_class($this));
     $this->behaviorClass = $this->behaviorName . 'Behavior';
     if (class_exists($this->behaviorClass . 'MockModel')) {
         $this->modelName = $this->behaviorClass . 'MockModel';
     }
     if (class_exists('Mock' . $this->behaviorClass)) {
         $this->behaviorClass = 'Mock' . $this->behaviorClass;
         $this->behaviorName = 'Mock' . $this->behaviorName;
     } elseif (!class_exists($this->behaviorClass)) {
         App::import('Behavior', $this->plugin . $this->behaviorName);
     }
     parent::startCase();
 }