summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/codeigniter/database/query_builder/get_test.php2
-rw-r--r--tests/mocks/autoloader.php11
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/codeigniter/database/query_builder/get_test.php b/tests/codeigniter/database/query_builder/get_test.php
index 699d2906a..156027537 100644
--- a/tests/codeigniter/database/query_builder/get_test.php
+++ b/tests/codeigniter/database/query_builder/get_test.php
@@ -41,7 +41,7 @@ class Get_test extends CI_TestCase {
*/
public function test_get_where()
{
- $job1 = $this->db->get('job', array('id' => 1))->result_array();
+ $job1 = $this->db->get_where('job', array('id' => 1))->result_array();
// Dummy jobs contain 1 rows
$this->assertCount(1, $job1);
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index e3ff7a8bd..be1c2220c 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -69,16 +69,21 @@ function autoload($class)
}
}
- $file = isset($file) ? $file : $dir.$class.'.php';
+ $file = (isset($file)) ? $file : $dir.$class.'.php';
if ( ! file_exists($file))
{
$trace = debug_backtrace();
- // If the autoload call came from `class_exists` or `file_exists`,
- // we skipped and return FALSE
if ($trace[2]['function'] === 'class_exists' OR $trace[2]['function'] === 'file_exists')
{
+ // If the autoload call came from `class_exists` or `file_exists`,
+ // we skipped and return FALSE
+ return FALSE;
+ }
+ elseif (($autoloader = spl_autoload_functions()) && end($autoloader) !== __FUNCTION__)
+ {
+ // If there was other custom autoloader, passed away
return FALSE;
}