本文整理汇总了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();
}
示例2: setUp
public function setUp()
{
TestRequire::PDODriver($this, 'sqlite');
Database::init($this->filename);
Database::createTables();
parent::setUp();
}
示例3: setUp
public function setUp()
{
parent::setUp();
// DbEntityHelper::truncateDatabase(self::$propelCon);
\Tbmt\SystemSetup::setCon(self::$propelCon);
\Tbmt\SystemSetup::doSetupUnitTests();
}
示例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();
}
示例5: setUp
protected function setUp()
{
parent::setUp();
if ($this->__debug) {
echo __METHOD__ . "\n";
}
}
示例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());
}
示例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;");
}
示例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();
}
示例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());
}
示例10: setUp
protected function setUp()
{
if (defined('DB_NOT_AVAILABLE')) {
$this->markTestSkipped();
}
parent::setUp();
}
示例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);
}
示例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();
}
示例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();
}
示例14: setUp
protected function setUp()
{
parent::setUp();
$container = getContainer();
self::$databaseDumper = $container->get('dumper.database.mysql');
self::$shellExecutor = $container->get('helper.shell_executor');
}
示例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");
}