Fix coverage by moving phpunit folder back into tests

This commit is contained in:
Timothy Warren 2014-02-17 21:48:08 -05:00
parent e0782dd55e
commit deb9237532
4 changed files with 47 additions and 41 deletions

View File

@ -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
- php: 5.2

View File

@ -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)

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
stopOnFailure="false"
bootstrap="tests/bootstrap.php">
<filter>
<blacklist>
<directory suffix=".php">coverage</directory>
<directory suffix=".php">docs</directory>
<directory suffix=".php">tests</directory>
<directory suffix=".php">vendor</directory>
<directory suffix=".php">.</directory>
</blacklist>
</filter>
<testsuites>
<testsuite name="CoreTests">
<file>tests/core/core.php</file>
<file>tests/core/db_qp_test.php</file>
</testsuite>
<testsuite name="FirebirdTests">
<file>tests/databases/firebird/FirebirdTest.php</file>
<file>tests/databases/firebird/FirebirdQBTest.php</file>
</testsuite>
<testsuite name="MySQLTests">
<file>tests/databases/mysql/MySQLTest.php</file>
<file>tests/databases/mysql/MySQLQBTest.php</file>
</testsuite>
<testsuite name="PgSQLTests">
<file>tests/databases/pgsql/PgSQLTest.php</file>
<file>tests/databases/pgsql/PgSQLQBTest.php</file>
</testsuite>
<testsuite name="SQLiteTests">
<file>tests/databases/sqlite/SqliteTest.php</file>
<file>tests/databases/mysql/SqliteQBTest.php</file>
</testsuite>
</testsuites>
</phpunit>

36
tests/phpunit.xml Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
stopOnFailure="false"
bootstrap="bootstrap.php">
<filter>
<blacklist>
<directory suffix=".php">../coverage</directory>
<directory suffix=".php">../docs</directory>
<directory suffix=".php">.</directory>
</blacklist>
</filter>
<testsuites>
<testsuite name="CoreTests">
<file>core/core.php</file>
<file>core/db_qp_test.php</file>
</testsuite>
<testsuite name="FirebirdTests">
<file>databases/firebird/FirebirdTest.php</file>
<file>databases/firebird/FirebirdQBTest.php</file>
</testsuite>
<testsuite name="MySQLTests">
<file>databases/mysql/MySQLTest.php</file>
<file>databases/mysql/MySQLQBTest.php</file>
</testsuite>
<testsuite name="PgSQLTests">
<file>databases/pgsql/PgSQLTest.php</file>
<file>databases/pgsql/PgSQLQBTest.php</file>
</testsuite>
<testsuite name="SQLiteTests">
<file>databases/sqlite/SqliteTest.php</file>
<file>databases/mysql/SqliteQBTest.php</file>
</testsuite>
</testsuites>
</phpunit>