From 55eb721567c84d0a30914f76615691990d005ac3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Sun, 6 Jan 2013 17:27:51 +0000 Subject: fixed old/broken unit tests; update documentation --- tests/unit/Security/TSecurityManagerTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/unit/Security/TSecurityManagerTest.php') 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); -- cgit v1.2.3