diff options
author | Andrey Andreev <narf@devilix.net> | 2017-06-19 10:33:58 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2017-06-19 10:33:58 +0200 |
commit | 6c7a4266410070d30f8f6bcdf9c9e67f3d6478e3 (patch) | |
tree | f0aab8f6f5e781d5947b1a5553b6648eb7b7a4ab /tests/codeigniter/libraries/Encrypt_test.php | |
parent | 2459285b91d6fc4f5099f9f597529cce1059cb33 (diff) |
[ci skip] 3.1.5 release
Diffstat (limited to 'tests/codeigniter/libraries/Encrypt_test.php')
-rw-r--r-- | tests/codeigniter/libraries/Encrypt_test.php | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/tests/codeigniter/libraries/Encrypt_test.php b/tests/codeigniter/libraries/Encrypt_test.php deleted file mode 100644 index adbca31b2..000000000 --- a/tests/codeigniter/libraries/Encrypt_test.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php -/** - * @requires extension mcrypt - */ -class Encrypt_test extends CI_TestCase { - - public function set_up() - { - if ( ! extension_loaded('mcrypt')) - { - return; - } - elseif (version_compare(PHP_VERSION, '7.1.0-alpha', '>=')) - { - return $this->markTestSkipped('ext/mcrypt is deprecated since PHP 7.1 and will generate notices here.'); - } - - $this->encrypt = new Mock_Libraries_Encrypt(); - $this->ci_instance_var('encrypt', $this->encrypt); - - $this->ci_set_config('encryption_key', "Encryptin'glike@boss!"); - $this->msg = 'My secret message'; - } - - // -------------------------------------------------------------------- - - public function test_encode() - { - $this->assertNotEquals($this->msg, $this->encrypt->encode($this->msg)); - } - - // -------------------------------------------------------------------- - - public function test_decode() - { - $encoded_msg = $this->encrypt->encode($this->msg); - $this->assertEquals($this->msg, $this->encrypt->decode($encoded_msg)); - } - - // -------------------------------------------------------------------- - - public function test_optional_key() - { - $key = 'Ohai!ù0129°03182%HD1892P0'; - $encoded_msg = $this->encrypt->encode($this->msg, $key); - $this->assertEquals($this->msg, $this->encrypt->decode($encoded_msg, $key)); - } - - // -------------------------------------------------------------------- - - public function test_default_cipher() - { - $this->assertEquals('rijndael-256', $this->encrypt->get_cipher()); - } - - // -------------------------------------------------------------------- - - public function test_set_cipher() - { - $this->encrypt->set_cipher(MCRYPT_BLOWFISH); - $this->assertEquals('blowfish', $this->encrypt->get_cipher()); - } - - // -------------------------------------------------------------------- - - public function test_default_mode() - { - $this->assertEquals('cbc', $this->encrypt->get_mode()); - } - - // -------------------------------------------------------------------- - - public function test_set_mode() - { - $this->encrypt->set_mode(MCRYPT_MODE_CFB); - $this->assertEquals('cfb', $this->encrypt->get_mode()); - } - -} |