diff options
author | Taufan Aditya <toopay@taufanaditya.com> | 2012-05-15 18:57:05 +0200 |
---|---|---|
committer | Taufan Aditya <toopay@taufanaditya.com> | 2012-05-15 18:57:05 +0200 |
commit | 7756af5df0a53930019e9fd7b828504f0c2c5427 (patch) | |
tree | 9e21ffb6c4b14ebb193105f10c8e2ad47d63176b /tests/mocks/core/input.php | |
parent | d40a545e9e7e4dc222d58fe46fe23f3691f043ee (diff) |
Input class code-coverage
Diffstat (limited to 'tests/mocks/core/input.php')
-rw-r--r-- | tests/mocks/core/input.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/mocks/core/input.php b/tests/mocks/core/input.php new file mode 100644 index 000000000..8a337d2ef --- /dev/null +++ b/tests/mocks/core/input.php @@ -0,0 +1,31 @@ +<?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); + } + +}
\ No newline at end of file |