protected function setUp() { parent::setUp(); foreach ($this->fixtures as $key => $value) { Yii::app()->db->getSchema()->resetSequence(Yii::app()->db->getSchema()->getTable($key)); } }
public function setUp() { parent::setUp(); $this->cleanDirectories(); require_once dirname(__FILE__) . '/../../../commands/ImportLegacyVFCommand.php'; $this->archiveDir = sys_get_temp_dir() . '/openeyes_vis_fields_tmp_archive'; $this->errorDir = sys_get_temp_dir() . '/openeyes_vis_fields_tmp_error'; $this->dupDir = sys_get_temp_dir() . '/openeyes_vis_fields_tmp_dups'; $this->importDir = sys_get_temp_dir() . '/openeyes_vis_fields_tmp_in'; $this->originalImportDir = dirname(__FILE__) . '/../../fields/legacy'; if (!file_exists($this->archiveDir)) { mkdir($this->archiveDir, 0777, true); } if (!file_exists($this->errorDir)) { mkdir($this->errorDir, 0777, true); } if (!file_exists($this->dupDir)) { mkdir($this->dupDir, 0777, true); } if (!file_exists($this->importDir)) { mkdir($this->importDir, 0777, true); } $CCRunner = new CConsoleCommandRunner(); // test needs to make sure all new files that come in look like new // file names (unique, based on time), otherwise there will be errors: foreach (glob($this->originalImportDir . '/*.fmes') as $file) { $this->prepareFile($file); } $this->legacyFieldCommand = new ImportLegacyVFCommand('LegacyFields', $CCRunner); }
public function setUp() { parent::setUp(); $this->oeMigration = new OEMigration(); $this->oeMigration->setVerbose(false); $this->fixturePath = Yii::getPathOfAlias('application.tests.fixtures'); }
public function setUp() { $this->getFixtureManager()->resetTable('article'); $this->getFixtureManager()->loadFixture('article'); exec('./setup.sh'); parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->model = new Contact(); //setup attributes to test with = contacts1 $this->model->setAttributes($this->contacts('contact1')->getAttributes()); }
public function tearDown() { parent::tearDown(); if (file_exists($this->_fileName)) { unlink($this->_fileName); } }
public function setUp() { $this->getFixtureManager()->resetTable('order'); $this->getFixtureManager()->loadFixture('order'); CActiveRecord::$db = $this->db = Yii::app()->db; parent::setUp(); }
protected function setUp() { $component = Yii::createComponent(array('class' => 'application.extensions.simpleWorkflow.SWPhpWorkflowSource', 'basePath' => 'application.tests.unit.task.workflows')); Yii::app()->setComponent('swSource', $component); Task_2_Test::$task2 = null; parent::setUp(); }
protected function setUp() { parent::setUp(); Yii::app()->cache->flush(); RuntimeCache::$data = array(); $this->becomeUser('User1'); }
public function tearDown() { parent::tearDown(); // Remove created temp files. $filePattern = Yii::app()->getRuntimePath() . "/aop*.tmp"; foreach (glob($filePattern) as $filename) { unlink($filename); } }
public function setUp() { parent::setUp(); $module = new BaseEventTypeModule('OphTrOperationbooking', null); $this->controller = $this->getMockBuilder('_WrapperBookingController')->setConstructorArgs(array('_WrapperBookingController', $module))->setMethods(array('redirect', 'processJsVars'))->getMock(); $this->audit = $this->getMockBuilder('Audit')->disableOriginalConstructor()->getMock(); Yii::app()->session['selected_firm_id'] = 1; $this->controller->firm = Firm::model()->findByPk(1); }
public function tearDown() { parent::tearDown(); @unlink($this->_fileName); // Get parent directory names $dirName = dirname($this->_fileName); $outerDirName = dirname($dirName); @rmdir($dirName); @rmdir($outerDirName); }
protected function tearDown() { // /*delete all productOrders*/ ProductOrders::model()->deleteAll(); /*delete all products*/ Product::model()->deleteAll(); /*delete all orders*/ Orders::model()->deleteAll(); parent::tearDown(); }
public function tearDown() { parent::tearDown(); Yii::app()->setModules($this->orig_modules); Yii::setPathOfAlias('ModuleAPITestNS', null); Yii::setPathOfAlias('application.modules.TestModule.components', null); if ($this->test_event_type) { $this->test_event_type->noVersion()->delete(); } }
function setup() { parent::setUp(); $_POST['Photo']['album_id'] = 1; $_POST['Photo']['filename'] = "IMG_1234.jpg"; $_POST['Photo']['caption'] = "This is a photo caption"; $_POST['Photo']['alt_text'] = "This is some alt text"; $_POST['Photo']['tags'] = "Tag1,Tag2,Tag3"; $_POST['Photo']['sort_order'] = 1; }
protected function setUp() { parent::setUp(); //return; Yii::app()->db->createCommand("TRUNCATE `contactattr`")->query(); Yii::app()->db->createCommand("INSERT INTO `contactattr`(`entity`, `attribute`, `value`) VALUES ('1', 'phone', '+373 1');")->query(); Yii::app()->db->createCommand("INSERT INTO `contactattr`(`entity`, `attribute`, `value`) VALUES ('1', 'phone', '+373 2');")->query(); Yii::app()->db->createCommand("INSERT INTO `contactattr`(`entity`, `attribute`, `value`) VALUES ('1', 'skype', 'SlavaSkype');")->query(); Yii::app()->db->createCommand("INSERT INTO `contactattr`(`entity`, `attribute`, `value`) VALUES ('2', 'skype', 'AlexandrSkype');")->query(); }
protected function setUp() { parent::setUp(); Materia::model()->deleteAll(); $this->usuario1 = new Usuario(); $this->usuario1->setAttributes(['pnome' => 'Fulano', 'snome' => 'De Tal', 'email' => '*****@*****.**', 'senha' => '123456', 'senha_confirma' => '123456', 'dt_criacao' => date('Y-m-d H:i:s'), 'situacao' => Usuario::SIT_ATIVO], false); $this->usuario1->save(false); $this->usuario2 = new Usuario(); $this->usuario2->setAttributes(['pnome' => 'Ciclano', 'snome' => 'De Tal', 'email' => '*****@*****.**', 'senha' => '123456', 'senha_confirma' => '123456', 'dt_criacao' => date('Y-m-d H:i:s'), 'situacao' => Usuario::SIT_ATIVO], false); $this->usuario2->save(false); }
protected function setUp() { parent::setUp(); Topico::model()->deleteAll(); $this->usuario = new Usuario(); $this->usuario->setAttributes(['pnome' => 'Fulano', 'snome' => 'De Tal', 'email' => '*****@*****.**', 'senha' => '123456', 'senha_confirma' => '123456', 'dt_criacao' => date('Y-m-d H:i:s'), 'situacao' => Usuario::SIT_ATIVO], false); $this->usuario->save(false); $this->materia = new Materia(); $this->materia->setAttributes(['usuario_id' => $this->usuario->id, 'titulo' => 'Matéria de Teste para Cadastrar Tópico', 'dt_criacao' => date('Y-m-d H:i:s')], false); $this->materia->save(false); }
/** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown() { parent::tearDown(); }
function setUp($table = 'Tag') { parent::setUp(); Yii::app()->db->createCommand("truncate {$table}")->query(); Yii::app()->db->createCommand("truncate Post{$table}")->query(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->model = new \OEModule\OphCiExamination\models\OphCiExamination_BlebAssessment_Vascularity(); }
public function setUp() { parent::setUp(); $this->model = new _WrapperContactBehavior(); $this->address = new Address(); $this->address->attributes = array('address1' => 'Line 1', 'address2' => 'Line 2', 'city' => 'City', 'postcode' => 'Postcode', 'county' => 'County', 'country_id' => 1); $label = new ContactLabel(); $label->name = 'Test Label'; $contact = ComponentStubGenerator::generate('Contact', array('address' => $this->address, 'label' => $label, 'fullName' => 'Henry Krinkle', 'reversedFullName' => 'Krinkle Henry')); $this->model->contact = $contact; $this->model2 = new _WrapperContactBehavior2(); $this->model2->contact = $contact; $contact3 = ComponentStubGenerator::generate('Contact', array('address' => $this->address, 'label' => $label, 'fullName' => 'Henry Krinkle', 'nick_name' => 'Jimbob')); $this->model3 = new _WrapperContactBehavior3(); $this->model3->contact = $contact3; }
public function setUp() { parent::setUp(); $this->api = Yii::app()->moduleAPI->get('OphCiExamination'); Yii::app()->session['selected_firm_id'] = 2; }
protected function setUp() { $this->controller = new PatientController('PatientController'); parent::setUp(); }
public function __call($name, $params) { if (array_key_exists($name, self::$_referenceFixtureRecords)) { if (isset($params[0])) { if (array_key_exists($params[0], self::$_referenceFixtureRecords[$name])) { return self::$_referenceFixtureRecords[$name][$params[0]]; } } throw new Exception('Record alias invalid/not specified.'); } else { return parent::__call($name, $params); } }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->model = new ContactLocation(); $this->expectedLetterAddress = array('Moorfields at City Road', 'flat 1', 'bleakley creek', 'flitchley', 'london', 'ec1v 0dx'); }
protected function setUp() { parent::setUp(); Yii::app()->cache->flush(); RuntimeCache::$data = array(); }
public function tearDown() { $this->destroyMockTableAndData('test_element_mock_table'); parent::tearDown(); }
/** * * @see test/CDbTestCase::setUp() */ protected function setUp() { parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->model = new EpisodeStatus(); }