summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaufan Aditya <toopay@taufanaditya.com>2012-04-04 20:23:56 +0200
committerTaufan Aditya <toopay@taufanaditya.com>2012-04-04 20:23:56 +0200
commit61ff054fb905f0514b942bf3e70a6c882bd64f7a (patch)
tree2c5ba32563e11b2204d559d0762f67e4862d869f
parent26490e37f4bdb267b71431abd79782549cbbadda (diff)
Adding schema and initial Query Builder code coverage
-rw-r--r--tests/codeigniter/database/query_builder/.gitkeep0
-rw-r--r--tests/mocks/autoloader.php4
-rwxr-xr-xtests/mocks/database/ci_test.sqlitebin17408 -> 17408 bytes
-rw-r--r--tests/mocks/database/config/sqlite.php6
-rw-r--r--tests/mocks/database/db/driver.php2
-rw-r--r--tests/mocks/database/schema/.gitkeep0
6 files changed, 6 insertions, 6 deletions
diff --git a/tests/codeigniter/database/query_builder/.gitkeep b/tests/codeigniter/database/query_builder/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/tests/codeigniter/database/query_builder/.gitkeep
+++ /dev/null
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
--- a/tests/mocks/database/ci_test.sqlite
+++ b/tests/mocks/database/ci_test.sqlite
Binary files 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
--- a/tests/mocks/database/schema/.gitkeep
+++ /dev/null