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


PHP PHPUnit_Extensions_Database_Operation_Factory::INSERT方法代码示例

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


在下文中一共展示了PHPUnit_Extensions_Database_Operation_Factory::INSERT方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

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

 /**
  * Returns the database operation executed in test setup.
  *
  * @return  PHPUnit_Extensions_Database_Operation_DatabaseOperation
  *
  * @since   12.1
  */
 protected function getSetUpOperation()
 {
     // Required given the use of InnoDB contraints.
     return new PHPUnit_Extensions_Database_Operation_Composite(array(PHPUnit_Extensions_Database_Operation_Factory::DELETE_ALL(), PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:n3t,项目名称:joomla-platform,代码行数:12,代码来源:database.php

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

示例6: getSetUpOperation

 /**
  * templates the setUp method that runs before each test; this method expunges the database before each run
  *
  * @see https://phpunit.de/manual/current/en/fixtures.html#fixtures.more-setup-than-teardown PHPUnit Fixtures: setUp and tearDown
  * @see https://github.com/sebastianbergmann/dbunit/issues/37 TRUNCATE fails on tables which have foreign key constraints
  * @return PHPUnit_Extensions_Database_Operation_Composite array containing delete and insert commands
  **/
 public final function getSetUpOperation()
 {
     return new PHPUnit_Extensions_Database_Operation_Composite(array(PHPUnit_Extensions_Database_Operation_Factory::DELETE_ALL(), PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:jfindley2,项目名称:data-design,代码行数:11,代码来源:data-design.php

示例7: __construct

 public function __construct(IDatabaseConnection $connection)
 {
     $this->connection = $connection;
     $this->setUpOperation = new \PHPUnit_Extensions_Database_Operation_Composite(array(new Operations\Truncate($connection->allowsCascading()), OperationFactory::INSERT()));
     $this->tearDownOperation = OperationFactory::NONE();
 }
开发者ID:matiasraies,项目名称:Symfony2Inta,代码行数:6,代码来源:DatabaseTester.php

示例8: getSetUpOperation

 /**
  * Returns the database operation executed in test setup.
  * Overriding to fix Mysql 5.5 truncate errors
  *
  * @return PHPUnit_Extensions_Database_Operation_DatabaseOperation
  */
 protected function getSetUpOperation()
 {
     //return PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT();
     $cascadeTruncates = TRUE;
     return new PHPUnit_Extensions_Database_Operation_Composite(array(new Unittest_Database_Operation_MySQL55Truncate($cascadeTruncates), PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:puffadder,项目名称:platform,代码行数:12,代码来源:TestCase.php

示例9: getSetUpOperation

 /**
  * setupd db
  * called in setUp()
  */
 public function getSetUpOperation()
 {
     $cascadeTruncates = false;
     // True if you want cascading truncates, false otherwise. If unsure choose false.
     return new \PHPUnit_Extensions_Database_Operation_Composite(array(new TruncateOperation($cascadeTruncates), \PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:pauljenny,项目名称:ginger,代码行数:10,代码来源:ginger.test.php

示例10: loadFixtures

 /**
  * Load database fixtures
  *
  * @param \HQ\Test\FixtureLoader $fixtureLoader
  * @param AbstractConnection $connection
  */
 protected function loadFixtures(FixtureLoader $fixtureLoader, AbstractConnection $connection)
 {
     $this->executeQueryWithForeignKeySetting(function () use($fixtureLoader, $connection) {
         $fixtureSet = $fixtureLoader->load($connection, $this);
         // create database tester & setup tasks
         $databaseTester = $this->createDatabaseTester($connection);
         $databaseTester->setSetUpOperation(\PHPUnit_Extensions_Database_Operation_Factory::INSERT());
         $databaseTester->setDataSet($fixtureSet);
         $databaseTester->onSetUp();
     }, $connection, $this->disableFixturesForeignKeyChecks);
 }
开发者ID:HotelQuickly,项目名称:NettePhpunit,代码行数:17,代码来源:AbstractDbTestCase.php

示例11: getSetUpOperation

 protected function getSetUpOperation()
 {
     return PHPUnit_Extensions_Database_Operation_Factory::INSERT();
 }
开发者ID:ekowabaka,项目名称:cfx,代码行数:4,代码来源:BaseTestCase.php

示例12: getSetUpOperation

 public function getSetUpOperation()
 {
     $cascadeTruncates = TRUE;
     return new \PHPUnit_Extensions_Database_Operation_Composite(array(new FoodAppTruncateOperation($cascadeTruncates), \PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:ncowan15,项目名称:FoodApp3,代码行数:5,代码来源:foodAppDatabaseTestcase.php

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

示例14: getSetUpOperation

 /**
  * @return \PHPUnit_Extensions_Database_Operation
  */
 protected function getSetUpOperation()
 {
     return new \PHPUnit_Extensions_Database_Operation_Composite(array(\PHPUnit_Extensions_Database_Operation_Factory::DELETE_ALL(), \PHPUnit_Extensions_Database_Operation_Factory::INSERT()));
 }
开发者ID:toastedghost,项目名称:rbac,代码行数:7,代码来源:Generic_Tests_DatabaseTestCase.php


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