Fixed unit tests for password_renewed_date, broken by the correction of

n°4095.
This commit is contained in:
denis.flaven@combodo.com
2021-08-10 10:40:37 +02:00
parent cdbb4470fc
commit bb5679959e

View File

@@ -275,6 +275,7 @@ class UserLocalTest extends ItopDataTestCase
public function testPasswordRenewal($sBefore, $sExpectedAfter)
{
$oBefore = is_null($sBefore) ? null : date(\AttributeDate::GetInternalFormat(), strtotime($sBefore));
$oNow = date(\AttributeDate::GetInternalFormat());
$oExpectedAfter = is_null($sExpectedAfter) ? null : date(\AttributeDate::GetInternalFormat(), strtotime($sExpectedAfter));
$aUserLocalValues = array('login' => 'john');
@@ -298,7 +299,7 @@ class UserLocalTest extends ItopDataTestCase
//INSERT
$oUserLocal->Set('password', 'fooBar1???');
$oUserLocal->DBWrite();
$this->assertEquals($oBefore, $oUserLocal->Get('password_renewed_date'), 'INSERT changes the "password_renewed_date"');
$this->assertEquals($oNow, $oUserLocal->Get('password_renewed_date'), 'INSERT sets the "password_renewed_date" to the current date');
//UPDATE password_renewed_date
$oUserLocal->Set('password_renewed_date', $oBefore);