adds some tolerance to LDAP expiry date test case
authorPhilipp Schüle <p.schuele@metaways.de>
Fri, 22 Apr 2016 08:11:21 +0000 (10:11 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 22 Apr 2016 09:13:42 +0000 (11:13 +0200)
... to prevent this problem:
expiry date should still be the same
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'2016-04-22 07:29:30'
+'2016-04-22 07:29:29'

Change-Id: I3ae52b8ca1db0cd6104ec0d4de2a2998875d4898
Reviewed-on: http://gerrit.tine20.com/customers/3075
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Tinebase/User/LdapTest.php

index dfc98ab..6bb68eb 100644 (file)
@@ -274,7 +274,8 @@ class Tinebase_User_LdapTest extends TestCase
         sleep(1);
         Tinebase_User::syncUsers($syncOptions);
         $user = Tinebase_User::getInstance()->getUserByPropertyFromSqlBackend('accountId', $user->getId(), 'Tinebase_Model_FullUser');
-        $this->assertEquals($now->toString(), $user->accountExpires->toString(), 'expiry date should still be the same');
+        $this->assertTrue($now->toString() == $user->accountExpires->toString() ||
+            $now->subSecond(1)->toString() == $user->accountExpires->toString(), 'expiry date should still be the same');
 
         // set expired to -1 year -> user should be deleted
         $user->accountExpires = $now->subYear(1);