summaryrefslogtreecommitdiffstats
path: root/tests/mocks
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/autoloader.php14
-rw-r--r--tests/mocks/core/common.php2
-rw-r--r--tests/mocks/database/drivers/sqlite.php2
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 441c88944..90aabcbe6 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -7,9 +7,9 @@
// Prototype :
//
// $mock_table = new Mock_Libraries_Table(); // Will load ./mocks/libraries/table.php
-// $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php
+// $mock_database_driver = new Mock_Database_Driver(); // Will load ./mocks/database/driver.php
// and so on...
-function autoload($class)
+function autoload($class)
{
$dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR;
@@ -50,9 +50,9 @@ function autoload($class)
elseif (in_array($subclass, $ci_libraries))
{
$dir = BASEPATH.'libraries'.DIRECTORY_SEPARATOR;
- $class = ($subclass == 'Driver_Library') ? 'Driver' : $subclass;
+ $class = ($subclass === 'Driver_Library') ? 'Driver' : $subclass;
}
- elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) == 3)
+ elseif (preg_match('/^CI_DB_(.+)_(driver|forge|result|utility)$/', $class, $m) && count($m) === 3)
{
$driver_path = BASEPATH.'database'.DIRECTORY_SEPARATOR.'drivers'.DIRECTORY_SEPARATOR;
$dir = $driver_path.$m[1].DIRECTORY_SEPARATOR;
@@ -75,13 +75,13 @@ function autoload($class)
{
$trace = debug_backtrace();
- // If the autoload call came from `class_exists` or `file_exists`,
+ // 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 ($trace[2]['function'] === 'class_exists' OR $trace[2]['function'] === 'file_exists')
{
return FALSE;
}
-
+
throw new InvalidArgumentException("Unable to load $class.");
}
diff --git a/tests/mocks/core/common.php b/tests/mocks/core/common.php
index e74576626..e1c493aa0 100644
--- a/tests/mocks/core/common.php
+++ b/tests/mocks/core/common.php
@@ -45,7 +45,7 @@ if ( ! function_exists('load_class'))
{
function load_class($class, $directory = 'libraries', $prefix = 'CI_')
{
- if ($directory != 'core' OR $prefix != 'CI_')
+ if ($directory !== 'core' OR $prefix !== 'CI_')
{
throw new Exception('Not Implemented: Non-core load_class()');
}
diff --git a/tests/mocks/database/drivers/sqlite.php b/tests/mocks/database/drivers/sqlite.php
index 76a182cbf..15cefbf53 100644
--- a/tests/mocks/database/drivers/sqlite.php
+++ b/tests/mocks/database/drivers/sqlite.php
@@ -1,7 +1,7 @@
<?php
class Mock_Database_Drivers_Sqlite extends Mock_Database_DB_Driver {
-
+
/**
* Instantiate the database driver
*