本文整理汇总了PHP中PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE方法的具体用法?PHP PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE怎么用?PHP PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Extensions_Database_Operation_Factory
的用法示例。
在下文中一共展示了PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* Tear down operation - Executed when the test is complete
*/
public function tearDown()
{
// Tear down operation
$this->databaseTester->setTearDownOperation(PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE());
$this->databaseTester->setDataSet($this->getDataSet());
$this->databaseTester->onTearDown();
// Garbage collection
unset($this->databaseTester);
}
示例2: getSetUpOperation
protected function getSetUpOperation()
{
if (self::$_oldDataset == null)
{
return PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(true);
}
else if (self::$_oldDataset != $this->_dataset)
{
$truncate = PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(true);
$truncate->execute($this->getConnection(),
$this->createFlatXMLDataSet(self::$_oldDataset));
return PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(true);
}
else
{
return PHPUnit_Extensions_Database_Operation_Factory::NONE();
}
}
示例3: getSetUpOperation
/**
* Returns the database operation executed in test setup.
*
* @return \PHPUnit_Extensions_Database_Operation_Composite
*
* @since 1.0
*/
protected function getSetUpOperation()
{
// At the moment we can safely TRUNCATE tables, since we're not using InnoDB tables nor foreign keys
// However if we ever need them, we can use our InsertOperation and TruncateOperation to suppress foreign keys
return new \PHPUnit_Extensions_Database_Operation_Composite(array(\PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(), \PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
}
示例4: getTearDownOperation
protected function getTearDownOperation()
{
return \PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
}
示例5: testBuild_withDefaultOperationsHasDefaultTearDownOperation
/**
* @depends testConnection
*/
public function testBuild_withDefaultOperationsHasDefaultTearDownOperation($connection)
{
$dbConfig = $this->builder->connection($connection)->dataSet($this->dataSet)->build();
$this->assertEquals(PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(), $dbConfig->getTearDownOperation());
}
示例6: __construct
public function __construct()
{
$this->setUpOperation = PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
$this->tearDownOperation = PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
}
示例7: getSetUpOperation
protected function getSetUpOperation()
{
return new \PHPUnit_Extensions_Database_Operation_Composite(array(\PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(), new BulkInsertDatabaseOperation()));
}
示例8: getTearDownOperation
/**
* templates the tearDown method that runs after each test; this method expunges the database after each run
*
* @return PHPUnit_Extensions_Database_Operation_IDatabaseOperation delete command for the database
**/
public final function getTearDownOperation()
{
return PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
}
示例9: tearDownAfterClass
public static function tearDownAfterClass()
{
$teardownOperation = PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
$teardownOperation->execute(self::$phpunitConn, self::$dataset);
}