public static function setUpBeforeClass() { $config = array('dbname' => 'DBALiteTest', 'username' => 'dbalite', 'password' => 'testme', 'host' => '127.0.0.1'); $csvfile = DATA_DIR . 'TABLE_Products.csv'; $pdoObj = new PDO("pgsql:host=127.0.0.1 dbname={$config['dbname']}", $config['username'], $config['password']); self::$phpunitConn = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdoObj); self::$dataset = new PHPUnit_Extensions_Database_Dataset_CsvDataSet(); self::$dataset->addTable('Products', $csvfile); $setupOperation = PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(); $setupOperation->execute(self::$phpunitConn, self::$dataset); $driver = DBALite::factory('pgsql', $config); $sql = 'SELECT * FROM "Products" WHERE "CategoryID" = ?'; self::$dbaliteStmt = $driver->prepare($sql); self::$dbaliteDriver = $driver; }
public static function setUpBeforeClass() { $dbfile = DATA_DIR . 'SqliteTest.sqlite'; $csvfile = DATA_DIR . 'TABLE_Products.csv'; $pdoObj = new PDO("sqlite:{$dbfile}"); self::$phpunitConn = new PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection($pdoObj); self::$dataset = new PHPUnit_Extensions_Database_Dataset_CsvDataSet(); self::$dataset->addTable('Products', $csvfile); $setupOperation = PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(); $setupOperation->execute(self::$phpunitConn, self::$dataset); $driver = DBALite::factory('sqlite', array('dbname' => $dbfile)); $sql = 'SELECT * FROM Products WHERE CategoryID = ?'; self::$dbaliteStmt = $driver->prepare($sql); self::$dbaliteDriver = $driver; }
public static function setUpBeforeClass() { $testdb = realpath(DATA_DIR . 'Select_Test_Db.sqlite'); self::$driver = DBALite::factory('sqlite', array('dbname' => $testdb)); self::$select = new DBALite_Select(self::$driver); }
public static function setUpBeforeClass() { $config = array('dbname' => 'DBALite_Test', 'username' => 'dbalite', 'password' => 'testme', 'host' => '127.0.0.1'); self::$dbaliteConn = DBALite::factory('mysql', $config); }
/** * @expectedException DBALite_Exception */ public function testFactoryNoDbname() { $driver = 'sqlite'; $config = array('database' => self::$dbname); $instance = DBALite::factory($driver, $config); }
public static function setUpBeforeClass() { $config = array('dbname' => DATA_DIR . 'SqliteTest.sqlite'); self::$dbaliteConn = DBALite::factory('sqlite', $config); }
public static function setUpBeforeClass() { $driver = 'sqlite'; $config = array('dbname' => DATA_DIR . 'SqliteTest.sqlite', 'options' => array('fetchmode' => 'obj', 'casefolding' => 'lower', 'autoquoteidentifiers' => false)); self::$database = DBALite::factory($driver, $config); }