當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CDbTestCase::setUp方法代碼示例

本文整理匯總了PHP中CDbTestCase::setUp方法的典型用法代碼示例。如果您正苦於以下問題:PHP CDbTestCase::setUp方法的具體用法?PHP CDbTestCase::setUp怎麽用?PHP CDbTestCase::setUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CDbTestCase的用法示例。


在下文中一共展示了CDbTestCase::setUp方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     $this->getFixtureManager()->resetTable('article');
     $this->getFixtureManager()->loadFixture('article');
     exec('./setup.sh');
     parent::setUp();
 }
開發者ID:sergebezborodov,項目名稱:sphinx-yii,代碼行數:7,代碼來源:ApiSearchTest.php

示例2: setUp

 public function setUp()
 {
     $this->getFixtureManager()->resetTable('order');
     $this->getFixtureManager()->loadFixture('order');
     CActiveRecord::$db = $this->db = Yii::app()->db;
     parent::setUp();
 }
開發者ID:dutchakdev,項目名稱:yii-batch,代碼行數:7,代碼來源:BatchTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->date = $date = date('YmdHi');
     $this->mock = $this->getMockBuilder('NodExportController')->disableOriginalConstructor()->getMock();
     $this->mock->method('createAllTempTables');
     $reflectionClass = new ReflectionClass('NodExportController');
     $institutionCode = $reflectionClass->getProperty('institutionCode');
     $institutionCode->setAccessible(true);
     $institutionCode->setValue($this->mock, Yii::app()->params['institution_code']);
     $exportPath = $reflectionClass->getProperty('exportPath');
     $exportPath->setAccessible(true);
     $exportPath->setValue($this->mock, realpath(dirname(__FILE__) . '/../../../') . '/runtime/nod-export/test/' . $institutionCode->getValue($this->mock) . '/' . $this->date);
     $zipName = $reflectionClass->getProperty('zipName');
     $zipName->setAccessible(true);
     $zipName->setValue($this->mock, $institutionCode->getValue($this->mock) . '_' . $this->date . '_NOD_Export.zip');
     $this->controller = $reflectionClass;
     $this->exportPath = $exportPath->getValue($this->mock);
     $this->zipName = $zipName->getValue($this->mock);
     if (!file_exists($exportPath->getValue($this->mock))) {
         mkdir($exportPath->getValue($this->mock), 0777, true);
     }
     $createAllTempTablesmethod = $this->controller->getMethod('createAllTempTables');
     $createAllTempTablesmethod->setAccessible(true);
     $createAllTempTablesmethod->invoke($this->mock);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:26,代碼來源:NodExportControllerTest.php

示例4: setUp

 public function setUp()
 {
     $this->original_service_manager = Yii::app()->service;
     $this->service_manager = new ServiceManagerWrapper2();
     Yii::app()->setComponent('service', $this->service_manager);
     parent::setUp();
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:7,代碼來源:TicketTest.php

示例5: setUp

 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);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:30,代碼來源:LegacyFieldsCommandTest.php

示例6: setUp

 protected function setUp()
 {
     $firstProduct = new Product();
     $firstProduct->name = "wooden chair 2x";
     $firstProduct->description = "a wooden chair made of wood";
     $firstProduct->quantity = 50;
     $firstProduct->price = 3000;
     $firstProduct->sku = uniqid();
     if (!$firstProduct->save()) {
         throw new Exception(CHtml::errorSummary($firstProduct));
     } else {
         $this->productModels[] = $firstProduct;
     }
     $secondProduct = new Product();
     $secondProduct->name = "wooden chair 3x";
     $secondProduct->description = "a wooden chair made of wood but with color";
     $secondProduct->quantity = 60;
     $secondProduct->price = 4000;
     $secondProduct->sku = uniqid();
     if (!$secondProduct->save()) {
         throw new Exception(CHtml::errorSummary($secondProduct));
     } else {
         $this->productModels[] = $secondProduct;
     }
     /*create  product model*/
     parent::setUp();
 }
開發者ID:kevindaus,項目名稱:Order-Billing-Inventory-System-Marcials-Furniture,代碼行數:27,代碼來源:InvoiceDataPersistorTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     foreach ($this->fixtures as $key => $value) {
         Yii::app()->db->getSchema()->resetSequence(Yii::app()->db->getSchema()->getTable($key));
     }
 }
開發者ID:kuzmina-mariya,項目名稱:unizaro-kamin,代碼行數:7,代碼來源:EavSetTest.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     Yii::app()->cache->flush();
     RuntimeCache::$data = array();
     $this->becomeUser('User1');
 }
開發者ID:skapl,項目名稱:design,代碼行數:7,代碼來源:HDbTestCase.php

示例9: setUp

 protected function setUp()
 {
     parent::setUp();
     fwrite(STDERR, ' setUp ');
     // $contact = $this->contacts('simple_contact_1');
     // your code....
 }
開發者ID:CGTAdal,項目名稱:yii-testing-app,代碼行數:7,代碼來源:ContactTest.php

示例10: 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();
 }
開發者ID:honglei619,項目名稱:simpleWorkflow,代碼行數:7,代碼來源:Task_2_Test.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->oeMigration = new OEMigration();
     $this->oeMigration->setVerbose(false);
     $this->fixturePath = Yii::getPathOfAlias('application.tests.fixtures');
 }
開發者ID:openeyeswales,項目名稱:OpenEyes,代碼行數:7,代碼來源:OEMigrationTest.php

示例12: 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());
 }
開發者ID:code-4-england,項目名稱:OpenEyes,代碼行數:11,代碼來源:ContactTest.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     $this->orig_svcman = Yii::app()->service;
     $this->svcman = new ServiceManagerWrapper();
     Yii::app()->setComponent('service', $this->svcman);
     $this->api = Yii::app()->moduleAPI->get('PatientTicketing');
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:8,代碼來源:PatientTicketing_APITest.php

示例14: setUp

 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);
 }
開發者ID:openeyes,項目名稱:openeyes,代碼行數:9,代碼來源:BookingControllerTest.php

示例15: setUp

 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();
 }
開發者ID:sinelnikof,項目名稱:yiiext,代碼行數:10,代碼來源:EavTest.php


注:本文中的CDbTestCase::setUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。