diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codeigniter/libraries/Encryption_test.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/codeigniter/libraries/Encryption_test.php b/tests/codeigniter/libraries/Encryption_test.php index ca1a4cd60..da9870fc5 100644 --- a/tests/codeigniter/libraries/Encryption_test.php +++ b/tests/codeigniter/libraries/Encryption_test.php @@ -74,18 +74,20 @@ class Encryption_test extends CI_TestCase { // Add some randomness to the selected driver $driver = mt_rand(0,1); $params = array( + 'driver' => $driver_index[$driver], 'cipher' => $test[0], 'mode' => $test[1], 'key' => openssl_random_pseudo_bytes($test[2]) ); - $this->encryption->initialize(array('driver' => $driver_index[$driver])); - $ciphertext = $this->encryption->encrypt($message, $params); + $this->encryption->initialize($params); + $ciphertext = $this->encryption->encrypt($message); $driver = (int) ! $driver; + $params['driver'] = $driver_index[$driver]; - $this->encryption->initialize(array('driver' => $driver_index[$driver])); - $this->assertEquals($message, $this->encryption->decrypt($ciphertext, $params)); + $this->encryption->initialize($params); + $this->assertEquals($message, $this->encryption->decrypt($ciphertext)); } } |