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


PHP PHPUnit_Extensions_Database_TestCase::setUp方法代码示例

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


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

示例1: setUp

 protected function setUp()
 {
     $this->getConnection();
     $this->preSetup();
     parent::setUp();
     $this->postSetup();
 }
开发者ID:gmo,项目名称:database,代码行数:7,代码来源:AbstractDatabaseTestCase.php

示例2: setUp

 public function setUp()
 {
     TestRequire::PDODriver($this, 'sqlite');
     Database::init($this->filename);
     Database::createTables();
     parent::setUp();
 }
开发者ID:noseglid,项目名称:phpa,代码行数:7,代码来源:DatabaseTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     // DbEntityHelper::truncateDatabase(self::$propelCon);
     \Tbmt\SystemSetup::setCon(self::$propelCon);
     \Tbmt\SystemSetup::doSetupUnitTests();
 }
开发者ID:nikonehauser,项目名称:ptclient,代码行数:7,代码来源:Tbmt_Tests_DatabaseTestCase.php

示例4: setUp

 /**
  * @covers bankaccount\mapper\BankAccount::__construct
  */
 protected function setUp()
 {
     $this->db = new \PDO('sqlite::memory:');
     $this->mapper = new BankAccountMapper($this->db);
     $this->db->exec(file_get_contents(__DIR__ . '/../../../../database/bankaccount.sql'));
     parent::setUp();
 }
开发者ID:elan4u,项目名称:bank,代码行数:10,代码来源:BankAccountMapperTest.php

示例5: setUp

 protected function setUp()
 {
     parent::setUp();
     if ($this->__debug) {
         echo __METHOD__ . "\n";
     }
 }
开发者ID:jinguanio,项目名称:david,代码行数:7,代码来源:MySqlTest.php

示例6: setUp

 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $config = array('host' => 'localhost', 'port' => '3325', 'user' => $GLOBALS['DB_USER'], 'password' => $GLOBALS['DB_PASSWD'], 'dbname' => $GLOBALS['DB_DBNAME'], 'email_host' => $GLOBALS['email_host'], 'email_ssl' => $GLOBALS['email_ssl'], 'email_port' => $GLOBALS['email_port'], 'email_username' => $GLOBALS['email_username'], 'email_password' => $GLOBALS['email_password'], 'email_from_email' => $GLOBALS['email_from_email'], 'email_from_name' => $GLOBALS['email_from_name'], 'mock_test_mail' => !$GLOBALS['send_test_mail']);
     $this->Sendit = new Sendit($config);
     $this->Sendit->setConnection($this->getConnection()->getConnection());
 }
开发者ID:nicodiaz,项目名称:sendit,代码行数:10,代码来源:SenditTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     $conn = $this->getConnection()->getConnection();
     $conn->exec("drop database lib_migration_test;");
     $conn->exec("create database lib_migration_test;");
 }
开发者ID:kohkimakimoto,项目名称:lib-migration,代码行数:7,代码来源:MigrationTest.php

示例8: setUp

 protected function setUp()
 {
     $this->assertNotNull($this->_request_base_url, 'Base URL for web requests specified');
     $params = array('base_url' => $this->_request_base_url);
     $this->_guzzle = new GuzzleHttp\Client($params);
     parent::setUp();
 }
开发者ID:bmac,项目名称:ae-framework,代码行数:7,代码来源:BaseEndpoint.php

示例9: setUp

 public function setUp()
 {
     // init test table - table is altered during tests - must be recreated before each test run
     Helpers::loadFromFile($this->getConnection()->getConnection(), __DIR__ . '/_data/csv-import/init.sql');
     parent::setUp();
     $this->import = new CsvImportMysql($this->getConnection()->getConnection());
 }
开发者ID:keboola,项目名称:php-db-import,代码行数:7,代码来源:CsvImportMysqlTest.php

示例10: setUp

 protected function setUp()
 {
     if (defined('DB_NOT_AVAILABLE')) {
         $this->markTestSkipped();
     }
     parent::setUp();
 }
开发者ID:nibra,项目名称:joomla-platform,代码行数:7,代码来源:JoomlaDatabaseTestCase.php

示例11: setup

 public function setup()
 {
     parent::setUp();
     // Establish a local reference to the Slim app object
     $this->app = $this->getSlimInstance();
     $this->client = new WebTestClient($this->app);
 }
开发者ID:there4,项目名称:slim-test-helpers,代码行数:7,代码来源:WebDbTestCase.php

示例12: setUp

 public function setUp()
 {
     $this->pdo = new \PDO('sqlite::memory:');
     $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
     $this->pdo->prepare("CREATE TABLE IF NOT EXISTS 'guestbook' (id int, content text, user text, created datetime)")->execute();
     parent::setUp();
 }
开发者ID:isidromerayo,项目名称:simple_php_skeleton,代码行数:7,代码来源:MyGuestbookTest.php

示例13: setUp

 /**
  * Filling the config object with individual testcase data.
  */
 protected function setUp()
 {
     $dbFactory = new Factory();
     if (!isset($this->db)) {
         Registry::remove('db');
         $config = $this->getConfig();
         $this->db = $dbFactory->getInstanceByConfig($config);
         Registry::set('db', $this->db);
     }
     if ($this->db === false) {
         $this->markTestIncomplete('Necessary DB configuration is not set.');
         parent::setUp();
         return;
     }
     /*
      * Deleting all tables from the db and setting up the db using the given schema.
      */
     $sql = 'SHOW TABLES';
     $tableList = $this->db->queryList($sql);
     foreach ($tableList as $table) {
         $sql = 'DROP TABLE ' . $table;
         $this->db->query($sql);
     }
     $this->db->queryMulti($this->getSchemaSQLQueries());
     parent::setUp();
 }
开发者ID:prepare4battle,项目名称:Ilch-2.0,代码行数:29,代码来源:DatabaseTestCase.php

示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     $container = getContainer();
     self::$databaseDumper = $container->get('dumper.database.mysql');
     self::$shellExecutor = $container->get('helper.shell_executor');
 }
开发者ID:Viscaweb,项目名称:EasyBackups,代码行数:7,代码来源:MySQLDatabaseDumperTest.php

示例15: setUp

 /**
  * @see CN-863
  */
 protected function setUp()
 {
     $conn = $this->getConnection();
     $conn->getConnection()->query("set foreign_key_checks=0");
     parent::setUp();
     $conn->getConnection()->query("set foreign_key_checks=1");
 }
开发者ID:ThorstenSuckow,项目名称:conjoon,代码行数:10,代码来源:DatabaseTestCaseDefault.php


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