diff options
Diffstat (limited to 'tests/unit/Security')
-rw-r--r-- | tests/unit/Security/TSecurityManagerTest.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/Security/TSecurityManagerTest.php b/tests/unit/Security/TSecurityManagerTest.php index 2daf6ede..d265d127 100644 --- a/tests/unit/Security/TSecurityManagerTest.php +++ b/tests/unit/Security/TSecurityManagerTest.php @@ -73,10 +73,11 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { $sec=new TSecurityManager (); $sec->init (null); try { - $sec->setEncryption ('DES'); + $sec->setCryptAlgorithm('NotExisting'); + $foo=$sec->encrypt('dummy'); self::fail ('Expected TNotSupportedException not thrown'); } catch (TNotSupportedException $e) { - self::assertEquals('3DES', $sec->getEncryption()); + self::assertEquals('NotExisting', $sec->getCryptAlgorithm()); } } @@ -96,6 +97,8 @@ class TSecurityManagerTest extends PHPUnit_Framework_TestCase { return; } $decrypted = $sec->decrypt($encrypted); + // the decrypted string is padded with \0 + $decrypted = strstr($decrypted, "\0", TRUE); self::assertEquals($plainText,$decrypted); |