protected function setUp() { $this->getConnection(); $this->preSetup(); parent::setUp(); $this->postSetup(); }
public function setUp() { TestRequire::PDODriver($this, 'sqlite'); Database::init($this->filename); Database::createTables(); parent::setUp(); }
public function setUp() { parent::setUp(); // DbEntityHelper::truncateDatabase(self::$propelCon); \Tbmt\SystemSetup::setCon(self::$propelCon); \Tbmt\SystemSetup::doSetupUnitTests(); }
/** * @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(); }
protected function setUp() { parent::setUp(); if ($this->__debug) { echo __METHOD__ . "\n"; } }
/** * 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()); }
protected function setUp() { parent::setUp(); $conn = $this->getConnection()->getConnection(); $conn->exec("drop database lib_migration_test;"); $conn->exec("create database lib_migration_test;"); }
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(); }
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()); }
protected function setUp() { if (defined('DB_NOT_AVAILABLE')) { $this->markTestSkipped(); } parent::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); }
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(); }
/** * 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(); }
protected function setUp() { parent::setUp(); $container = getContainer(); self::$databaseDumper = $container->get('dumper.database.mysql'); self::$shellExecutor = $container->get('helper.shell_executor'); }
/** * @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"); }
public function setUp() { $conn = $this->getConnection(); $pdo = $conn->getConnection(); // set up tables $fixtureDataSet = $this->getDataSet($this->fixtures); list($fixtureMeta, $fixtureKeys) = $this->getDataSetMeta($this->fixtures); foreach ($fixtureDataSet->getTableNames() as $table) { // drop table $pdo->exec("DROP TABLE IF EXISTS `{$table}`;"); // recreate table $meta = $fixtureDataSet->getTableMetaData($table); $create = "CREATE TABLE IF NOT EXISTS `{$table}` "; $cols = array(); foreach ($meta->getColumns() as $col) { if (isset($fixtureMeta[$table][$col])) { $cols[] = $this->createFieldSQL($col, $fixtureMeta[$table][$col]['@attributes']); } else { $cols[] = "`{$col}` VARCHAR(400)"; } } // Set primary key if (isset($fixtureKeys[$table]) && isset($fixtureKeys[$table]['PRIMARY'])) { $cols[] = 'PRIMARY KEY (`' . $fixtureKeys[$table]['PRIMARY']['@attributes']['Column_name'] . '`)'; } $create .= '(' . implode(',', $cols) . ');'; try { $pdo->exec($create); } catch (\Exception $e) { echo $create . "\n"; throw $e; } } parent::setUp(); }
protected function setUp() { parent::setUp(); if ($this->isUsingSqlite()) { $this->resetSqliteAutoincrement(); } }
protected function setUp() { parent::setUp(); if (is_null($this->app)) { $this->app = $this->getApplication(); } }
protected function setUp() { if (!extension_loaded('pdo_sqlite')) { $this->markTestSkipped('PDO/SQLite is required to run this test.'); } parent::setUp(); }
public function setUp() { $this->_table = $this->getMockBuilder('Database\\AbstractTable')->disableOriginalConstructor()->getMockForAbstractClass(); $adapter = new \ReflectionProperty('Database\\AbstractTable', 'adapter'); $adapter->setAccessible(true); $adapter->setValue($this->_table, \Library\Application::getService('Db')); return parent::setUp(); }
protected function setUp() { parent::setUp(); $params['pdo'] = $this->pdo; $db = DriverManager::getConnection($params); $this->query = 'SELECT * FROM posts'; $this->pager = new Pager($db, new Pagerfanta(new DoctrineDbalAdapter($db, $this->query))); }
public function setUp() { parent::setUp(); $dbOptions = new ThrottleDbAdapterOptions(); $this->gateway = new TableGateway($dbOptions->getDbTable(), $this->getAdapter()); $this->throttleDbAdapter = new ThrottleDbAdapter($this->gateway, $dbOptions, new LockHandleFactory()); $this->throttle = new Throttle($this->throttleDbAdapter, new ThrottleOptions()); }
protected function setUp() { parent::setUp(); error_reporting(E_ALL ^ E_NOTICE); Cache::init('volatile'); $_SESSION["user_id"] = "1"; Application::$config['log_level'] = 550; }
/** * Setup database. */ protected function setUp() { Bootstrap::getServiceManager(); $conn = $this->getConnection(); $conn->getConnection()->query("set foreign_key_checks=0"); parent::setUp(); $conn->getConnection()->query("set foreign_key_checks=1"); }
public function setUp() { $this->pdo = new PDO('sqlite::memory:'); $query = "CREATE TABLE evento (titolo VARCHAR(256) NOT NULL PRIMARY KEY, descrizione VARCHAR(512), data_inizio DATE, data_fine DATE)"; $this->pdo->query($query); exec('rm -f /var/www/phpday2010/test/mail/*'); parent::setUp(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); \ntentan\caching\Cache::reset(); $this->users = \ntentan\models\Model::load('users'); $this->roles = \ntentan\models\Model::load('roles'); $this->departments = \ntentan\models\Model::load('departments'); }
/** * @inheritdoc */ protected function setUp() { if (Yii::$app->get('db', false) === null) { $this->markTestSkipped(); } else { parent::setUp(); } }
protected function setUp() { parent::setUp(); $params['pdo'] = $this->pdo; $db = DriverManager::getConnection($params); $this->sql = 'SELECT * FROM posts'; $this->pager = new PagingQuery($db, $this->sql); }
protected function setUp() { parent::setUp(); $params['pdo'] = $this->pdo; $db = DriverManager::getConnection($params); $this->sql = 'SELECT * FROM posts'; $this->adapter = new DoctrineDbalAdapter($db, $this->sql); }
public function setUp() { parent::setUp(); $this->_redis = $this->getMockBuilder('Redis')->disableOriginalConstructor()->setMethods(array('get', 'set'))->getMock(); $this->_redis->method('get')->willReturn(false); $date = "2016-01-21 01:02:03"; $this->_featuredFlags = new FeaturedFlagsImpl(self::$pdo, $this->_redis, $date); }