N°7345 Accept DateTime objects for DBObject::Set() calls on AttributeDateTime and children (#618)

This commit is contained in:
Pierre Goiffon
2024-03-12 18:29:55 +01:00
committed by GitHub
parent 6450b52697
commit 27ac1fe276
4 changed files with 81 additions and 22 deletions

View File

@@ -127,7 +127,7 @@ class ImportTest extends ItopDataTestCase {
'"first_name","name", "email", "org_id->name", obsolescence_date',
sprintf('"%s", "%s", "%s", UID, toto', $sFirstName, $sLastName, $sEmail),
sprintf(
'Issue: Internal error: Exception, Wrong format for date attribute obsolescence_date, expecting "Y-m-d" and got "toto";n/a;n/a;n/a;%s;%s;%s;toto', $sFirstName, $sLastName, $sEmail
'Issue: Internal error: CoreUnexpectedValue, Wrong format for date attribute obsolescence_date, expecting "Y-m-d" and got "toto";n/a;n/a;n/a;%s;%s;%s;toto', $sFirstName, $sLastName, $sEmail
),
null,
1,
@@ -174,7 +174,7 @@ CSVFILE;
foreach (["ORGID" => $iOrgId, "UID" => $this->sUid] as $sSearch => $sReplace){
$sLastLineNeedle = str_replace($sSearch, $sReplace, $sLastLineNeedle);
}
$this->assertStringContainsString($sLastLineNeedle, $sLastline, $sLastline);
$this->assertStringContainsString($sLastLineNeedle, $sLastline, 'The script we launched in an external process returned a value different than the expected error message');
$sPattern = "/Person;(\d+);/";
if (preg_match($sPattern,$sLastline,$aMatches)){