summaryrefslogtreecommitdiff
path: root/tests/unit/Security
diff options
context:
space:
mode:
authorctrlaltca <>2013-01-06 18:09:15 +0000
committerctrlaltca <>2013-01-06 18:09:15 +0000
commit11f2517f24aca0580fec7d3560108458da787342 (patch)
tree85ae5c74c23dce62b68b2c3505345a486513c3e9 /tests/unit/Security
parent37bd6206f9765a5ddfa8dc04b4e13e6bb268d0db (diff)
backported r3233, r3234 to trunk/
Diffstat (limited to 'tests/unit/Security')
-rw-r--r--tests/unit/Security/TSecurityManagerTest.php7
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);