当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
 }
开发者ID:neumicro,项目名称:Ushahidi_Web_Dev,代码行数:12,代码来源:Customforms_Test.php

示例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();
		}
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:19,代码来源:model.test.class.php

示例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()));
 }
开发者ID:Joal01,项目名称:fof,代码行数:13,代码来源:DatabaseTest.php

示例4: getTearDownOperation

 protected function getTearDownOperation()
 {
     return \PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
 }
开发者ID:devstackgroup,项目名称:cbase,代码行数:4,代码来源:AbstractDatabaseTestCase.php

示例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());
 }
开发者ID:TheOnlyMerlin,项目名称:phpunit-extensions,代码行数:8,代码来源:BuilderTest.php

示例6: __construct

 public function __construct()
 {
     $this->setUpOperation = PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
     $this->tearDownOperation = PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
 }
开发者ID:TheOnlyMerlin,项目名称:phpunit-extensions,代码行数:5,代码来源:Builder.php

示例7: getSetUpOperation

 protected function getSetUpOperation()
 {
     return new \PHPUnit_Extensions_Database_Operation_Composite(array(\PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE(), new BulkInsertDatabaseOperation()));
 }
开发者ID:timetoogo,项目名称:pinq.demo.sql,代码行数:4,代码来源:DataSetSqlQueryTest.php

示例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();
 }
开发者ID:brbrown59,项目名称:bread-basket,代码行数:9,代码来源:bread-basket.php

示例9: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     $teardownOperation = PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE();
     $teardownOperation->execute(self::$phpunitConn, self::$dataset);
 }
开发者ID:paulyg,项目名称:dbalite,代码行数:5,代码来源:PgsqlTest.php


注:本文中的PHPUnit_Extensions_Database_Operation_Factory::TRUNCATE方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。