From ee2f5d08c64d96b7abc7195bcd1b6a3fd67b5b42 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Fri, 30 Mar 2012 06:29:11 +0700 Subject: Multi database setup --- tests/mocks/database/config/mysql.php | 34 ++++++++++++++++++++++++++++++++++ tests/mocks/database/config/pgsql.php | 34 ++++++++++++++++++++++++++++++++++ tests/mocks/database/config/sqlite.php | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 tests/mocks/database/config/mysql.php create mode 100644 tests/mocks/database/config/pgsql.php create mode 100644 tests/mocks/database/config/sqlite.php (limited to 'tests/mocks/database/config') diff --git a/tests/mocks/database/config/mysql.php b/tests/mocks/database/config/mysql.php new file mode 100644 index 000000000..ace0a31b1 --- /dev/null +++ b/tests/mocks/database/config/mysql.php @@ -0,0 +1,34 @@ + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'travis', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'mysql', + ), + + // Database configuration with failover + 'mysql_failover' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'not_travis', + 'password' => 'wrong password', + 'database' => 'not_ci_test', + 'dbdriver' => 'mysql', + 'failover' => array( + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'travis', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'mysql', + ), + ), + ), +); \ No newline at end of file diff --git a/tests/mocks/database/config/pgsql.php b/tests/mocks/database/config/pgsql.php new file mode 100644 index 000000000..c06af8ce0 --- /dev/null +++ b/tests/mocks/database/config/pgsql.php @@ -0,0 +1,34 @@ + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'postgres', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'postgre', + ), + + // Database configuration with failover + 'pgsql_failover' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'not_travis', + 'password' => 'wrong password', + 'database' => 'not_ci_test', + 'dbdriver' => 'postgre', + 'failover' => array( + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'postgres', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'postgre', + ), + ), + ), +); \ No newline at end of file diff --git a/tests/mocks/database/config/sqlite.php b/tests/mocks/database/config/sqlite.php new file mode 100644 index 000000000..cf428f473 --- /dev/null +++ b/tests/mocks/database/config/sqlite.php @@ -0,0 +1,34 @@ + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'sqlite', + 'password' => 'sqlite', + 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', + 'dbdriver' => 'sqlite', + ), + + // Database configuration with failover + 'sqlite_failover' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'sqlite', + 'password' => 'sqlite', + 'database' => '../not_exists.sqlite', + 'dbdriver' => 'sqlite', + 'failover' => array( + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'sqlite', + 'password' => 'sqlite', + 'database' => realpath(__DIR__.'/..').'/ci_testf.sqlite', + 'dbdriver' => 'sqlite', + ), + ), + ), +); \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 6dfe76dfe4634971faeef197aa724c924a72d515 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Apr 2012 12:42:59 +0300 Subject: Alter SQLite tests config to use the sqlite3 driver under PHP 5.4+ --- tests/mocks/database/config/sqlite.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/mocks/database/config') diff --git a/tests/mocks/database/config/sqlite.php b/tests/mocks/database/config/sqlite.php index cf428f473..8665e208d 100644 --- a/tests/mocks/database/config/sqlite.php +++ b/tests/mocks/database/config/sqlite.php @@ -1,7 +1,8 @@ array( 'dsn' => '', @@ -9,7 +10,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', - 'dbdriver' => 'sqlite', + 'dbdriver' => $dbdriver, ), // Database configuration with failover @@ -19,7 +20,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => '../not_exists.sqlite', - 'dbdriver' => 'sqlite', + 'dbdriver' => $dbdriver, 'failover' => array( array( 'dsn' => '', @@ -27,7 +28,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => realpath(__DIR__.'/..').'/ci_testf.sqlite', - 'dbdriver' => 'sqlite', + 'dbdriver' => $dbdriver, ), ), ), -- cgit v1.2.3-24-g4f1b