本文整理汇总了PHP中CDbTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP CDbTestCase类的具体用法?PHP CDbTestCase怎么用?PHP CDbTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CDbTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
foreach ($this->fixtures as $key => $value) {
Yii::app()->db->getSchema()->resetSequence(Yii::app()->db->getSchema()->getTable($key));
}
}
示例2: 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);
}
示例3: setUp
public function setUp()
{
parent::setUp();
$this->oeMigration = new OEMigration();
$this->oeMigration->setVerbose(false);
$this->fixturePath = Yii::getPathOfAlias('application.tests.fixtures');
}
示例4: setUp
public function setUp()
{
$this->getFixtureManager()->resetTable('article');
$this->getFixtureManager()->loadFixture('article');
exec('./setup.sh');
parent::setUp();
}
示例5: 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());
}
示例6: tearDown
public function tearDown()
{
parent::tearDown();
if (file_exists($this->_fileName)) {
unlink($this->_fileName);
}
}
示例7: setUp
public function setUp()
{
$this->getFixtureManager()->resetTable('order');
$this->getFixtureManager()->loadFixture('order');
CActiveRecord::$db = $this->db = Yii::app()->db;
parent::setUp();
}
示例8: 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();
}
示例9: setUp
protected function setUp()
{
parent::setUp();
Yii::app()->cache->flush();
RuntimeCache::$data = array();
$this->becomeUser('User1');
}
示例10: tearDown
public function tearDown()
{
parent::tearDown();
// Remove created temp files.
$filePattern = Yii::app()->getRuntimePath() . "/aop*.tmp";
foreach (glob($filePattern) as $filename) {
unlink($filename);
}
}
示例11: 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);
}
示例12: tearDown
public function tearDown()
{
parent::tearDown();
@unlink($this->_fileName);
// Get parent directory names
$dirName = dirname($this->_fileName);
$outerDirName = dirname($dirName);
@rmdir($dirName);
@rmdir($outerDirName);
}
示例13: tearDown
protected function tearDown()
{
// /*delete all productOrders*/
ProductOrders::model()->deleteAll();
/*delete all products*/
Product::model()->deleteAll();
/*delete all orders*/
Orders::model()->deleteAll();
parent::tearDown();
}
开发者ID:kevindaus,项目名称:Order-Billing-Inventory-System-Marcials-Furniture,代码行数:10,代码来源:WeeklySalesReportTest.php
示例14: 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();
}
}
示例15: setup
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;
}