本文整理汇总了PHP中PHPUnit_Extensions_Database_TestCase类的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Extensions_Database_TestCase类的具体用法?PHP PHPUnit_Extensions_Database_TestCase怎么用?PHP PHPUnit_Extensions_Database_TestCase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PHPUnit_Extensions_Database_TestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
protected function tearDown()
{
parent::tearDown();
$this->conn->close();
$this->conn = null;
self::$pdo = null;
}
示例2: setUp
protected function setUp()
{
parent::setUp();
if ($this->__debug) {
echo __METHOD__ . "\n";
}
}
示例3: 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();
}
示例4: setUp
protected function setUp()
{
parent::setUp();
$container = getContainer();
self::$databaseDumper = $container->get('dumper.database.mysql');
self::$shellExecutor = $container->get('helper.shell_executor');
}
示例5: setUp
public function setUp()
{
parent::setUp();
// DbEntityHelper::truncateDatabase(self::$propelCon);
\Tbmt\SystemSetup::setCon(self::$propelCon);
\Tbmt\SystemSetup::doSetupUnitTests();
}
示例6: setUp
protected function setUp()
{
if (!extension_loaded('pdo_sqlite')) {
$this->markTestSkipped('PDO/SQLite is required to run this test.');
}
parent::setUp();
}
示例7: setUp
protected function setUp()
{
if (defined('DB_NOT_AVAILABLE')) {
$this->markTestSkipped();
}
parent::setUp();
}
示例8: 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);
}
示例9: 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();
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$conn = $this->getConnection()->getConnection();
$conn->exec("drop database lib_migration_test;");
$conn->exec("create database lib_migration_test;");
}
示例11: 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();
}
示例12: setUp
protected function setUp()
{
parent::setUp();
if ($this->isUsingSqlite()) {
$this->resetSqliteAutoincrement();
}
}
示例13: setUpBeforeClass
/**
* Set up tables
*/
public static function setUpBeforeClass()
{
foreach (static::$_tables as $table) {
\Library\Application::getService("Database\\Table\\{$table}")->setSchema();
}
parent::setUpBeforeClass();
}
示例14: setUpBeforeClass
public static function setUpBeforeClass()
{
foreach (static::$_tables as $table) {
static::$serviceManager->get("Database\\Table\\{$table}")->setSchema(true);
}
parent::setUpBeforeClass();
}
示例15: setUp
protected function setUp()
{
parent::setUp();
if (is_null($this->app)) {
$this->app = $this->getApplication();
}
}