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


PHP PHPUnit_Extensions_Database_Operation_Factory类代码示例

本文整理汇总了PHP中PHPUnit_Extensions_Database_Operation_Factory的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_Operation_Factory类的具体用法?PHP PHPUnit_Extensions_Database_Operation_Factory怎么用?PHP PHPUnit_Extensions_Database_Operation_Factory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PHPUnit_Extensions_Database_Operation_Factory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSetUpOperation

 public function getSetUpOperation()
 {
     // whether you want cascading truncates
     // set false if unsure
     $cascadeTruncates = false;
     return new PHPUnit_Extensions_Database_Operation_Composite(array(new PHPUnit_Extensions_Database_Operation_MySQL55Truncate($cascadeTruncates), PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:Notacadet,项目名称:RFID,代码行数:7,代码来源:nomRowTest.php

示例2: seedDatabases

 private function seedDatabases()
 {
     foreach (self::$conns as $i => $conn) {
         $setUpOperation = \PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
         $setUpOperation->execute($conn, $this->createXMLDataSet(dirname(__FILE__) . '/multi_seed' . $i . '.xml'));
     }
 }
开发者ID:dreamblazenet,项目名称:crazydatamapper,代码行数:7,代码来源:MultiDatabaseTestCase.php

示例3: getSetUpOperation

 public function getSetUpOperation()
 {
     $cascadeTruncates = TRUE;
     //if you want cascading truncates, false otherwise
     //if unsure choose false
     return new \PHPUnit_Extensions_Database_Operation_Composite(array(new Operation\MySQLTruncate($cascadeTruncates), \PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:energylab,项目名称:gacela,代码行数:7,代码来源:TestCase.php

示例4: getDatabaseTester

 protected function getDatabaseTester()
 {
     $tester = new PHPUnit_Extensions_Database_DefaultTester($this->_conn);
     $tester->setSetUpOperation(new PHPUnit_Extensions_Database_Operation_Composite(array(new DB_operation_set_env('foreign_key_checks', 0), PHPUnit_Extensions_Database_Operation_Factory::DELETE_ALL(), new DB_operation_set_env('foreign_key_checks', 1), PHPUnit_Extensions_Database_Operation_Factory::INSERT())));
     $tester->setTearDownOperation(PHPUnit_Extensions_Database_Operation_Factory::NONE());
     return $tester;
 }
开发者ID:scalia,项目名称:Vevui,代码行数:7,代码来源:testdb_case.php

示例5: __construct

 /**
  * Creates a new default database tester using the given connection.
  *
  * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection
  */
 public function __construct(\PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection)
 {
     if (!$connection instanceof Connection) {
         throw new InvalidArgumentException("Not a valid Zend_Test_PHPUnit_Db_Connection instance, " . get_class($connection) . " given!");
     }
     $this->connection = $connection;
     $this->setUpOperation = new \PHPUnit_Extensions_Database_Operation_Composite(array(new Operation\Truncate(), new Operation\Insert()));
     $this->tearDownOperation = \PHPUnit_Extensions_Database_Operation_Factory::NONE();
 }
开发者ID:alab1001101,项目名称:zf2,代码行数:14,代码来源:SimpleTester.php

示例6: 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

示例7: getDatabaseTester

 /**
  * @return PHPUnit_Extensions_Database_DefaultTester
  */
 protected function getDatabaseTester()
 {
     $connection = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($this->pdo, 'sqlite');
     $tester = new PHPUnit_Extensions_Database_DefaultTester($connection);
     $tester->setSetUpOperation(PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT());
     $tester->setTearDownOperation(PHPUnit_Extensions_Database_Operation_Factory::NONE());
     $tester->setDataSet(new PHPUnit_Extensions_Database_DataSet_FlatXmlDataSet(dirname(__FILE__) . '/_files/bank-account-seed.xml'));
     return $tester;
 }
开发者ID:newsn31,项目名称:StarterTheme,代码行数:12,代码来源:BankAccountCompositeTest.php

示例8: __construct

 /**
  * Creates a new default database tester using the given connection.
  *
  * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection
  */
 public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection)
 {
     if (!$connection instanceof Zend_Test_PHPUnit_Db_Connection) {
         #require_once "Zend/Test/PHPUnit/Db/Exception.php";
         throw new Zend_Test_PHPUnit_Db_Exception("Not a valid Zend_Test_PHPUnit_Db_Connection instance, " . get_class($connection) . " given!");
     }
     $this->connection = $connection;
     $this->setUpOperation = new PHPUnit_Extensions_Database_Operation_Composite(array(new Zend_Test_PHPUnit_Db_Operation_Truncate(), new Zend_Test_PHPUnit_Db_Operation_Insert()));
     $this->tearDownOperation = PHPUnit_Extensions_Database_Operation_Factory::NONE();
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:15,代码来源:SimpleTester.php

示例9: applyTo

 public function applyTo(Database $db)
 {
     $pdo = $db->getPdo();
     $connection = new \PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdo, $db->getName());
     $databasetester = new \PHPUnit_Extensions_Database_DefaultTester($connection);
     $setupoperation = \PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
     $databasetester->setSetUpOperation($setupoperation);
     $databasetester->setDataSet($this->dataset);
     $databasetester->onSetUp();
 }
开发者ID:linkorb,项目名称:transmogrifier,代码行数:10,代码来源:Dataset.php

示例10: getDatabaseTester

 protected function getDatabaseTester()
 {
     $pdo = new PDO('mysql:host=localhost;dbname=c3op', 'root', '');
     $connection = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdo, 'c3op');
     $tester = new PHPUnit_Extensions_Database_DefaultTester($connection);
     $tester->setSetUpOperation(PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT());
     $tester->setTearDownOperation(PHPUnit_Extensions_Database_Operation_Factory::NONE());
     $tester->setDataSet(new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(dirname(__FILE__) . '/fixture/projects_seed.xml'));
     return $tester;
 }
开发者ID:racporto,项目名称:c3op,代码行数:10,代码来源:dbXest.php

示例11: __construct

    function __construct()
    {
    // connect for unit testing framework
        $pdo = new PDO('mysql:host=' . HOST . ';dbname=' .
            DB_NAME, USERNAME, PASSWORD);

        $connection = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdo, 'test');
        $tester     = new PHPUnit_Extensions_Database_DefaultTester($connection);

        $tester->setSetUpOperation(PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT());
        $tester->setTearDownOperation(PHPUnit_Extensions_Database_Operation_Factory::NONE());
        $tester->setDataSet(new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet
            (dirname(__FILE__).'/../models/files/users.xml'));

        $this->tester = $tester;
    }
开发者ID:robehickman,项目名称:decentralised_microblogging_system,代码行数:16,代码来源:ctrlMessagesTest.php

示例12: 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

示例13: __construct

 /**
  * Creates a new database tester.
  *
  * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection
  */
 public function __construct()
 {
     $this->setUpOperation = PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
     $this->tearDownOperation = PHPUnit_Extensions_Database_Operation_Factory::NONE();
 }
开发者ID:rmehner,项目名称:phpunit,代码行数:10,代码来源:AbstractTester.php

示例14: getSetUpOperation

 /**
  * Use our own truncate operation so that we can work with InnoDB foreign
  * keys constraints.
  *
  * @see http://stackoverflow.com/questions/10331445/phpunit-and-mysql-truncation-error
  * @return \PHPUnit_Extensions_Database_Operation_Composite
  */
 public function getSetUpOperation()
 {
     return new \PHPUnit_Extensions_Database_Operation_Composite(array(new TruncateOperation(true), \PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:deltasystems,项目名称:dewdrop,代码行数:11,代码来源:DbTestCase.php

示例15: __construct

 public function __construct(\PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, $fixturePath)
 {
     parent::__construct($connection, $fixturePath);
     $this->setUpOperation = \PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(true);
 }
开发者ID:wachterjohannes,项目名称:jackalope-doctrine-dbal,代码行数:5,代码来源:Pgsql.php


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