summaryrefslogtreecommitdiffstats
path: root/tests/mocks
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-07 00:43:36 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-07 00:43:36 +0100
commit81e10644861c86437cf197b54af096894b41cd63 (patch)
tree9ef94b04802b42bac49a159ba655c513f29cebc8 /tests/mocks
parentdf7a6962beacc34b217dab61da8526f6570391e8 (diff)
CI_Encryption: Optimizations and test cases
Diffstat (limited to 'tests/mocks')
-rw-r--r--tests/mocks/libraries/encryption.php39
1 files changed, 39 insertions, 0 deletions
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