diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-24 14:33:35 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-24 14:33:35 +0200 |
commit | d98785a1661b46f0a1cb83168347fda4c4c7dde9 (patch) | |
tree | cd01c7256be6d70f56d19ab418eca1154ee8793c /tests/codeigniter/libraries | |
parent | c0f678dc369d5bc5302acc4f38809b0f1d0538fe (diff) |
Fix #1922
Diffstat (limited to 'tests/codeigniter/libraries')
-rw-r--r-- | tests/codeigniter/libraries/Encrypt_test.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/codeigniter/libraries/Encrypt_test.php b/tests/codeigniter/libraries/Encrypt_test.php index 998d806b3..21ac85f03 100644 --- a/tests/codeigniter/libraries/Encrypt_test.php +++ b/tests/codeigniter/libraries/Encrypt_test.php @@ -9,6 +9,7 @@ class Encrypt_test extends CI_TestCase { $this->ci_set_config('encryption_key', "Encryptin'glike@boss!"); $this->msg = 'My secret message'; + $this->mcrypt = extension_loaded('mcrypt'); } // -------------------------------------------------------------------- @@ -39,6 +40,12 @@ class Encrypt_test extends CI_TestCase { public function test_default_cipher() { + if ( ! $this->mcrypt) + { + $this->markTestSkipped('MCrypt not available'); + return; + } + $this->assertEquals('rijndael-256', $this->encrypt->get_cipher()); } @@ -47,6 +54,12 @@ class Encrypt_test extends CI_TestCase { public function test_set_cipher() { + if ( ! $this->mcrypt) + { + $this->markTestSkipped('MCrypt not available'); + return; + } + $this->encrypt->set_cipher(MCRYPT_BLOWFISH); $this->assertEquals('blowfish', $this->encrypt->get_cipher()); } @@ -55,6 +68,12 @@ class Encrypt_test extends CI_TestCase { public function test_default_mode() { + if ( ! $this->mcrypt) + { + $this->markTestSkipped('MCrypt not available'); + return; + } + $this->assertEquals('cbc', $this->encrypt->get_mode()); } @@ -62,6 +81,12 @@ class Encrypt_test extends CI_TestCase { public function test_set_mode() { + if ( ! $this->mcrypt) + { + $this->markTestSkipped('MCrypt not available'); + return; + } + $this->encrypt->set_mode(MCRYPT_MODE_CFB); $this->assertEquals('cfb', $this->encrypt->get_mode()); } |