Example #1
0
 /**
  * Sets up the fixture before executing a test method.
  * If you override this method, make sure the parent implementation is invoked.
  * Otherwise, the database fixtures will not be managed properly.
  */
 public function setUp()
 {
     parent::setUp();
     if (is_array($this->fixtures)) {
         foreach ($this->fixtures as $fixtureName => $modelClass) {
             $tableName = WF_Table::model($modelClass)->tableName();
             $this->resetTable($tableName);
             $rows = $this->loadFixtures($modelClass, $tableName);
             if (is_array($rows) && is_string($fixtureName)) {
                 $this->_rows[$fixtureName] = $rows;
                 if (isset($modelClass)) {
                     foreach (array_keys($rows) as $alias) {
                         $this->_records[$fixtureName][$alias] = $modelClass;
                     }
                 }
             }
         }
     }
 }
Example #2
0
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }