/** * Test initializer. * * @return void * @since 0.1.0 */ public static function setUpBeforeClass() { $module = MigrationHelper::getInstance(); $module->revertMigrations(); $module->applyMigrations(); \Yii::app()->language = '00'; }
/** * Prepares database for work. * * @return void * @since 0.1.0 */ public function prepareDatabase() { /* if (\Yii::app()->db->getDriverName() === 'sqlite') { $dsn = \Yii::app()->db->connectionString; $path = str_replace('sqlite:', '', $dsn); if (is_writable($path)) { unlink($path); } if (!file_exists($path)) { $h = fopen($path, 'w'); fclose($h); } } */ $helper = new MigrationHelper(); $helper->applyMigrations(); //\Yii::app()->db->createCommand(''); \Yii::app()->fixtureManager->prepare(); }