summaryrefslogtreecommitdiff
path: root/tests/unit/Security
diff options
context:
space:
mode:
authorctrlaltca <>2013-01-06 17:27:51 +0000
committerctrlaltca <>2013-01-06 17:27:51 +0000
commit55eb721567c84d0a30914f76615691990d005ac3 (patch)
tree14b283e6f7980e3c45f6109e90fd0fd0f280c8c0 /tests/unit/Security
parent1f6d9caf8397416747aa2105b2aac352cdf92fe3 (diff)
fixed old/broken unit tests; update documentation
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);