diff options
Diffstat (limited to 'tests/mocks')
-rw-r--r-- | tests/mocks/autoloader.php | 53 | ||||
-rw-r--r-- | tests/mocks/libraries/encryption.php | 39 |
2 files changed, 77 insertions, 15 deletions
diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php index cc0a2e2f7..1bcde797d 100644 --- a/tests/mocks/autoloader.php +++ b/tests/mocks/autoloader.php @@ -14,26 +14,49 @@ function autoload($class) $dir = realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR; $ci_core = array( - 'Benchmark', 'Config', 'Controller', - 'Exceptions', 'Hooks', 'Input', - 'Lang', 'Loader', 'Log', 'Model', - 'Output', 'Router', 'Security', - 'URI', 'Utf8', + 'Benchmark', + 'Config', + 'Controller', + 'Exceptions', + 'Hooks', + 'Input', + 'Lang', + 'Loader', + 'Log', + 'Model', + 'Output', + 'Router', + 'Security', + 'URI', + 'Utf8' ); $ci_libraries = array( - 'Calendar', 'Cart', 'Driver_Library', - 'Email', 'Encrypt', 'Form_validation', - 'Ftp', 'Image_lib', 'Javascript', - 'Migration', 'Pagination', 'Parser', - 'Profiler', 'Table', 'Trackback', - 'Typography', 'Unit_test', 'Upload', - 'User_agent', 'Xmlrpc', 'Zip' + 'Calendar', + 'Cart', + 'Driver_Library', + 'Email', + 'Encrypt', + 'Encryption', + 'Form_validation', + 'Ftp', + 'Image_lib', + 'Javascript', + 'Migration', + 'Pagination', + 'Parser', + 'Profiler', + 'Table', + 'Trackback', + 'Typography', + 'Unit_test', + 'Upload', + 'User_agent', + 'Xmlrpc', + 'Zip' ); - $ci_drivers = array( - 'Session', - ); + $ci_drivers = array('Session', 'Cache'); if (strpos($class, 'Mock_') === 0) { diff --git a/tests/mocks/libraries/encryption.php b/tests/mocks/libraries/encryption.php new file mode 100644 index 000000000..028eecc72 --- /dev/null +++ b/tests/mocks/libraries/encryption.php @@ -0,0 +1,39 @@ +<?php + +class Mock_Libraries_Encryption extends CI_Encryption { + + /** + * __get_params() + * + * Allows public calls to the otherwise protected _get_params(). + */ + public function __get_params($params) + { + return $this->_get_params($params); + } + + // -------------------------------------------------------------------- + + /** + * get_key() + * + * Allows checking for key changes. + */ + public function get_key() + { + return $this->_key; + } + + // -------------------------------------------------------------------- + + /** + * __driver_get_handle() + * + * Allows checking for _mcrypt_get_handle(), _openssl_get_handle() + */ + public function __driver_get_handle($driver, $cipher, $mode) + { + return $this->{'_'.$driver.'_get_handle'}($cipher, $mode); + } + +}
\ No newline at end of file |