From 11f2517f24aca0580fec7d3560108458da787342 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Sun, 6 Jan 2013 18:09:15 +0000 Subject: backported r3233, r3234 to trunk/ --- tests/unit/Security/TSecurityManagerTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/unit/Security') 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