diff --git a/.travis.yml b/.travis.yml index 4df732b..a07c70e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ before_script: - sh -c "psql -c 'create database test;' -U postgres" - sh -c "mysql -e 'create database IF NOT EXISTS test;'" -script: phpunit +script: cd tests && phpunit matrix: allow_failures: - - php: 5.2 \ No newline at end of file + - php: 5.2 diff --git a/common.php b/common.php index 85373e2..07032c9 100644 --- a/common.php +++ b/common.php @@ -149,6 +149,14 @@ function Query($params = '') { throw new BadDBDriverException('Database driver does not exist, or is not supported'); } + + // Set additional PDO options + $options = array(); + + if (isset($params->options)) + { + $options = (array)$params->options; + } // -------------------------------------------------------------------------- // Attempt to connect @@ -185,7 +193,7 @@ function Query($params = '') { // Create the database connection $db = ( ! empty($params->user)) - ? new $dbtype($dsn, $params->user, $params->pass) + ? new $dbtype($dsn, $params->user, $params->pass, $options) : new $dbtype($dsn); } catch(Exception $e) diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index 649fe7f..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - coverage - docs - tests - vendor - . - - - - - tests/core/core.php - tests/core/db_qp_test.php - - - tests/databases/firebird/FirebirdTest.php - tests/databases/firebird/FirebirdQBTest.php - - - tests/databases/mysql/MySQLTest.php - tests/databases/mysql/MySQLQBTest.php - - - tests/databases/pgsql/PgSQLTest.php - tests/databases/pgsql/PgSQLQBTest.php - - - tests/databases/sqlite/SqliteTest.php - tests/databases/mysql/SqliteQBTest.php - - - \ No newline at end of file diff --git a/tests/phpunit.xml b/tests/phpunit.xml new file mode 100644 index 0000000..187ac6f --- /dev/null +++ b/tests/phpunit.xml @@ -0,0 +1,36 @@ + + + + + + ../coverage + ../docs + . + + + + + core/core.php + core/db_qp_test.php + + + databases/firebird/FirebirdTest.php + databases/firebird/FirebirdQBTest.php + + + databases/mysql/MySQLTest.php + databases/mysql/MySQLQBTest.php + + + databases/pgsql/PgSQLTest.php + databases/pgsql/PgSQLQBTest.php + + + databases/sqlite/SqliteTest.php + databases/mysql/SqliteQBTest.php + + + \ No newline at end of file