summaryrefslogtreecommitdiffstats
path: root/tests/mocks
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/autoloader.php5
-rw-r--r--tests/mocks/ci_testcase.php4
-rw-r--r--tests/mocks/core/input.php49
-rw-r--r--tests/mocks/core/utf8.php19
-rw-r--r--tests/mocks/database/drivers/mysql.php1
-rw-r--r--tests/mocks/database/drivers/mysqli.php1
-rw-r--r--tests/mocks/database/drivers/pdo.php1
-rw-r--r--tests/mocks/database/drivers/postgre.php1
-rw-r--r--tests/mocks/database/drivers/sqlite.php1
9 files changed, 4 insertions, 78 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php
index 33942768d..a912327ca 100644
--- a/tests/mocks/autoloader.php
+++ b/tests/mocks/autoloader.php
@@ -1,6 +1,6 @@
<?php
-// This autoloader provide convinient way to working with mock object
+// This autoloader provide convenient way to working with mock object
// make the test looks natural. This autoloader support cascade file loading as well
// within mocks directory.
//
@@ -33,7 +33,6 @@ function autoload($class)
$ci_libraries = array(
'Calendar',
- 'Cart',
'Driver_Library',
'Email',
'Encrypt',
@@ -116,4 +115,4 @@ function autoload($class)
}
include_once($file);
-} \ No newline at end of file
+}
diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php
index a2c37b92e..b320aab74 100644
--- a/tests/mocks/ci_testcase.php
+++ b/tests/mocks/ci_testcase.php
@@ -24,9 +24,9 @@ class CI_TestCase extends PHPUnit_Framework_TestCase {
// --------------------------------------------------------------------
- public function __construct()
+ public function __construct($name = null, array $data = [], $dataName = '')
{
- parent::__construct();
+ parent::__construct($name, $data, $dataName);
$this->ci_instance = new stdClass();
}
diff --git a/tests/mocks/core/input.php b/tests/mocks/core/input.php
deleted file mode 100644
index 40e27441f..000000000
--- a/tests/mocks/core/input.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-class Mock_Core_Input extends CI_Input {
-
- /**
- * Since we use GLOBAL to fetch Security and Utf8 classes,
- * we need to use inversion of control to mock up
- * the same process within CI_Input class constructor.
- *
- * @covers CI_Input::__construct()
- */
- public function __construct($security, $utf8)
- {
- $this->_allow_get_array = (config_item('allow_get_array') === TRUE);
- $this->_enable_xss = (config_item('global_xss_filtering') === TRUE);
- $this->_enable_csrf = (config_item('csrf_protection') === TRUE);
-
- // Assign Security and Utf8 classes
- $this->security = $security;
- $this->uni = $utf8;
-
- // Sanitize global arrays
- $this->_sanitize_globals();
- }
-
- public function fetch_from_array($array, $index = '', $xss_clean = FALSE)
- {
- return parent::_fetch_from_array($array, $index, $xss_clean);
- }
-
- /**
- * Lie about being a CLI request
- *
- * We take advantage of this in libraries/Session_test
- */
- public function is_cli_request()
- {
- return FALSE;
- }
-
- public function __set($name, $value)
- {
- if ($name === 'ip_address')
- {
- $this->ip_address = $value;
- }
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/core/utf8.php b/tests/mocks/core/utf8.php
deleted file mode 100644
index 3a6282e1d..000000000
--- a/tests/mocks/core/utf8.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-class Mock_Core_Utf8 extends CI_Utf8 {
-
- /**
- * We need to define UTF8_ENABLED the same way that
- * CI_Utf8 constructor does.
- */
- public function __construct()
- {
- if (defined('UTF8_ENABLED'))
- {
- return;
- }
-
- parent::__construct();
- }
-
-} \ No newline at end of file
diff --git a/tests/mocks/database/drivers/mysql.php b/tests/mocks/database/drivers/mysql.php
index e0c1fb06c..b7718ebaf 100644
--- a/tests/mocks/database/drivers/mysql.php
+++ b/tests/mocks/database/drivers/mysql.php
@@ -5,7 +5,6 @@ class Mock_Database_Drivers_Mysql extends Mock_Database_DB_Driver {
/**
* Instantiate the database driver
*
- * @param string DB Driver class name
* @param array DB configuration to set
* @return void
*/
diff --git a/tests/mocks/database/drivers/mysqli.php b/tests/mocks/database/drivers/mysqli.php
index 73c35b609..f747aad46 100644
--- a/tests/mocks/database/drivers/mysqli.php
+++ b/tests/mocks/database/drivers/mysqli.php
@@ -5,7 +5,6 @@ class Mock_Database_Drivers_Mysqli extends Mock_Database_DB_Driver {
/**
* Instantiate the database driver
*
- * @param string DB Driver class name
* @param array DB configuration to set
* @return void
*/
diff --git a/tests/mocks/database/drivers/pdo.php b/tests/mocks/database/drivers/pdo.php
index 17768eed7..af1958aea 100644
--- a/tests/mocks/database/drivers/pdo.php
+++ b/tests/mocks/database/drivers/pdo.php
@@ -5,7 +5,6 @@ class Mock_Database_Drivers_PDO extends Mock_Database_DB_Driver {
/**
* Instantiate the database driver
*
- * @param string DB Driver class name
* @param array DB configuration to set
* @return void
*/
diff --git a/tests/mocks/database/drivers/postgre.php b/tests/mocks/database/drivers/postgre.php
index 5a45115fa..8c91e54a9 100644
--- a/tests/mocks/database/drivers/postgre.php
+++ b/tests/mocks/database/drivers/postgre.php
@@ -5,7 +5,6 @@ class Mock_Database_Drivers_Postgre extends Mock_Database_DB_Driver {
/**
* Instantiate the database driver
*
- * @param string DB Driver class name
* @param array DB configuration to set
* @return void
*/
diff --git a/tests/mocks/database/drivers/sqlite.php b/tests/mocks/database/drivers/sqlite.php
index 512467520..b2aec28e6 100644
--- a/tests/mocks/database/drivers/sqlite.php
+++ b/tests/mocks/database/drivers/sqlite.php
@@ -5,7 +5,6 @@ class Mock_Database_Drivers_Sqlite extends Mock_Database_DB_Driver {
/**
* Instantiate the database driver
*
- * @param string DB Driver class name
* @param array DB configuration to set
* @return void
*/