diff options
author | Wes Baker <wes@wesbaker.com> | 2012-05-07 22:49:33 +0200 |
---|---|---|
committer | Wes Baker <wes@wesbaker.com> | 2012-05-07 22:49:33 +0200 |
commit | d348135ed2131e5fa41dfa0ea7254d2f6759f3e0 (patch) | |
tree | 14cfc61c47686b895acd9e49b45c559d311195cc /tests/mocks/database/config | |
parent | bb2c83bddbf51c42815be3de60eab24fd87ae392 (diff) | |
parent | d207c9218531afe666168c1f5f59abd1bc19a8aa (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Conflicts:
system/core/Security.php
Diffstat (limited to 'tests/mocks/database/config')
-rw-r--r-- | tests/mocks/database/config/pdo/mysql.php | 37 | ||||
-rw-r--r-- | tests/mocks/database/config/pdo/pgsql.php | 37 | ||||
-rw-r--r-- | tests/mocks/database/config/pdo/sqlite.php | 37 | ||||
-rw-r--r-- | tests/mocks/database/config/sqlite.php | 9 |
4 files changed, 115 insertions, 5 deletions
diff --git a/tests/mocks/database/config/pdo/mysql.php b/tests/mocks/database/config/pdo/mysql.php new file mode 100644 index 000000000..cefb6b008 --- /dev/null +++ b/tests/mocks/database/config/pdo/mysql.php @@ -0,0 +1,37 @@ +<?php + +return array( + + // Typical Database configuration + 'pdo/mysql' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'travis', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'pdo', + 'pdodriver' => 'mysql', + ), + + // Database configuration with failover + 'pdo/mysql_failover' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'not_travis', + 'password' => 'wrong password', + 'database' => 'not_ci_test', + 'dbdriver' => 'pdo', + 'pdodriver' => 'mysql', + 'failover' => array( + array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'travis', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'pdo', + 'pdodriver' => 'mysql', + ), + ), + ), +);
\ No newline at end of file diff --git a/tests/mocks/database/config/pdo/pgsql.php b/tests/mocks/database/config/pdo/pgsql.php new file mode 100644 index 000000000..5196e9ad9 --- /dev/null +++ b/tests/mocks/database/config/pdo/pgsql.php @@ -0,0 +1,37 @@ +<?php + +return array( + + // Typical Database configuration + 'pdo/pgsql' => array( + 'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;', + 'hostname' => 'localhost', + 'username' => 'postgres', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'pdo', + 'pdodriver' => 'pgsql', + ), + + // Database configuration with failover + 'pdo/pgsql_failover' => array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'not_travis', + 'password' => 'wrong password', + 'database' => 'not_ci_test', + 'dbdriver' => 'pdo', + 'pdodriver' => 'pgsql', + 'failover' => array( + array( + 'dsn' => 'pgsql:host=localhost;port=5432;dbname=ci_test;', + 'hostname' => 'localhost', + 'username' => 'postgres', + 'password' => '', + 'database' => 'ci_test', + 'dbdriver' => 'pdo', + 'pdodriver' => 'pgsql', + ), + ), + ), +);
\ No newline at end of file diff --git a/tests/mocks/database/config/pdo/sqlite.php b/tests/mocks/database/config/pdo/sqlite.php new file mode 100644 index 000000000..c68b4b213 --- /dev/null +++ b/tests/mocks/database/config/pdo/sqlite.php @@ -0,0 +1,37 @@ +<?php + +return array( + + // Typical Database configuration + 'pdo/sqlite' => array( + 'dsn' => 'sqlite:/'.realpath(__DIR__.'/../..').'/ci_test.sqlite', + 'hostname' => 'localhost', + 'username' => 'sqlite', + 'password' => 'sqlite', + 'database' => 'sqlite', + 'dbdriver' => 'pdo', + 'pdodriver' => 'sqlite', + ), + + // Database configuration with failover + 'pdo/sqlite_failover' => array( + 'dsn' => 'sqlite:not_exists.sqlite', + 'hostname' => 'localhost', + 'username' => 'sqlite', + 'password' => 'sqlite', + 'database' => 'sqlite', + 'dbdriver' => 'pdo', + 'pdodriver' => 'sqlite', + 'failover' => array( + array( + 'dsn' => 'sqlite:/'.realpath(__DIR__.'/../..').'/ci_test.sqlite', + 'hostname' => 'localhost', + 'username' => 'sqlite', + 'password' => 'sqlite', + 'database' => 'sqlite', + 'dbdriver' => 'pdo', + 'pdodriver' => 'sqlite', + ), + ), + ), +);
\ No newline at end of file diff --git a/tests/mocks/database/config/sqlite.php b/tests/mocks/database/config/sqlite.php index 8665e208d..755ce2a3a 100644 --- a/tests/mocks/database/config/sqlite.php +++ b/tests/mocks/database/config/sqlite.php @@ -1,5 +1,4 @@ <?php -$dbdriver = is_php('5.4') ? 'sqlite3' : 'sqlite'; return array( @@ -10,7 +9,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', - 'dbdriver' => $dbdriver, + 'dbdriver' => 'sqlite3', ), // Database configuration with failover @@ -20,15 +19,15 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => '../not_exists.sqlite', - 'dbdriver' => $dbdriver, + 'dbdriver' => 'sqlite3', 'failover' => array( array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'sqlite', 'password' => 'sqlite', - 'database' => realpath(__DIR__.'/..').'/ci_testf.sqlite', - 'dbdriver' => $dbdriver, + 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', + 'dbdriver' => 'sqlite3', ), ), ), |