// Migrate up the database Yii::import('application.commands.shell.ZMigrateCommand'); ZMigrateCommand::AutoMigrate(); Yii::app()->params['installed'] = true; // Create empty dynamic configuration file $content = "<" . "?php return "; $content .= var_export(array(), true); $content .= "; ?" . ">"; file_put_contents(Yii::app()->params['dynamicConfigFile'], $content); foreach ($this->getFixtures() as $tableName => $fixturePath) { $this->resetTable($tableName); $this->loadFixture($tableName); } // initialize a controller (which defaults to null in tests) $c = new CController('phpunit'); $c->setAction(new CInlineAction($c, 'urltest')); Yii::app()->setController($c); // Add Categories $cGeneral = new ProfileFieldCategory(); $cGeneral->title = "General"; $cGeneral->sort_order = 100; $cGeneral->visibility = 1; $cGeneral->is_system = true; $cGeneral->description = ''; $cGeneral->save(); $cCommunication = new ProfileFieldCategory(); $cCommunication->title = "Communication"; $cCommunication->sort_order = 200; $cCommunication->visibility = 1; $cCommunication->is_system = true; $cCommunication->description = '';