From 61ff054fb905f0514b942bf3e70a6c882bd64f7a Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Thu, 5 Apr 2012 01:23:56 +0700 Subject: Adding schema and initial Query Builder code coverage --- tests/mocks/autoloader.php | 4 ++-- tests/mocks/database/ci_test.sqlite | Bin 17408 -> 17408 bytes tests/mocks/database/config/sqlite.php | 6 +++--- tests/mocks/database/db/driver.php | 2 +- tests/mocks/database/schema/.gitkeep | 0 5 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 tests/mocks/database/schema/.gitkeep (limited to 'tests/mocks') diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php index 22448139e..f1bdb5d6f 100644 --- a/tests/mocks/autoloader.php +++ b/tests/mocks/autoloader.php @@ -62,7 +62,7 @@ function autoload($class) elseif (strpos($class, 'CI_DB') === 0) { $dir = BASEPATH.'database'.DIRECTORY_SEPARATOR; - $file = $dir.str_replace('CI_DB', 'DB', $subclass).'.php'; + $file = $dir.str_replace(array('CI_DB','active_record'), array('DB', 'active_rec'), $subclass).'.php'; } else { @@ -82,7 +82,7 @@ function autoload($class) { return FALSE; } - var_dump($file); + throw new InvalidArgumentException("Unable to load $class."); } diff --git a/tests/mocks/database/ci_test.sqlite b/tests/mocks/database/ci_test.sqlite index 37ce4f870..86d868af2 100755 Binary files a/tests/mocks/database/ci_test.sqlite and b/tests/mocks/database/ci_test.sqlite differ diff --git a/tests/mocks/database/config/sqlite.php b/tests/mocks/database/config/sqlite.php index c70986e7c..75fdacd96 100644 --- a/tests/mocks/database/config/sqlite.php +++ b/tests/mocks/database/config/sqlite.php @@ -9,7 +9,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => realpath(__DIR__.'/..').'/ci_test.sqlite', - 'dbdriver' => is_php('5.4') ? 'sqlite3' : 'sqlite', + 'dbdriver' => 'sqlite3', ), // Database configuration with failover @@ -19,7 +19,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => '../not_exists.sqlite', - 'dbdriver' => is_php('5.4') ? 'sqlite3' : 'sqlite', + 'dbdriver' => 'sqlite3', 'failover' => array( array( 'dsn' => '', @@ -27,7 +27,7 @@ return array( 'username' => 'sqlite', 'password' => 'sqlite', 'database' => realpath(__DIR__.'/..').'/ci_testf.sqlite', - 'dbdriver' => is_php('5.4') ? 'sqlite3' : 'sqlite', + 'dbdriver' => 'sqlite3', ), ), ), diff --git a/tests/mocks/database/db/driver.php b/tests/mocks/database/db/driver.php index 9bf5231e3..cb1820277 100644 --- a/tests/mocks/database/db/driver.php +++ b/tests/mocks/database/db/driver.php @@ -33,4 +33,4 @@ class Mock_Database_DB_Driver extends CI_DB_driver { } } -class CI_DB extends CI_DB_Driver {} \ No newline at end of file +class CI_DB extends Mock_Database_DB_QueryBuilder {} \ No newline at end of file diff --git a/tests/mocks/database/schema/.gitkeep b/tests/mocks/database/schema/.gitkeep deleted file mode 100644 index e69de29bb..000000000 -- cgit v1.2.3-24-g4f1b