diff --git a/test/core/BulkChangeTest.inc.php b/test/core/BulkChangeTest.inc.php new file mode 100644 index 000000000..b02e1be52 --- /dev/null +++ b/test/core/BulkChangeTest.inc.php @@ -0,0 +1,72 @@ +createObject('Person', array( + 'first_name' => 'isaac', + 'name' => 'asimov', + 'email' => 'isaac.asimov@fundation.org', + 'org_id' => $this->getTestOrgId(), + )); + + $aData = array( + array($oPerson->Get("first_name"), + $oPerson->Get("name"), + $oPerson->Get("email"), + "EN US", + "iasimov", + "harryseldon", + "profileid->name:Administrator" + ) + ); + $aAttributes = array("language" => 3, "login" => 4, "password" => 5, "profile_list" => 6); + $aExtKeys = array("contactid" => + array("first_name" => 0, "name" => 1, "email" => 2)); + $oBulk = new \BulkChange( + "UserLocal", + $aData, + $aAttributes, + $aExtKeys, + array("login"), + null, + null, + "Y-m-d H:i:s", // date format + true // localize + ); + + $oChange = \CMDBObject::GetCurrentChange(); + $aRes = $oBulk->Process($oChange); + static::assertNotNull($aRes); + + foreach ($aRes as $aRow) + { + if (array_key_exists('__STATUS__', $aRow)) + { + $sStatus = $aRow['__STATUS__']; + $this->assertFalse(strstr($sStatus->GetDescription(), "CoreCannotSaveObjectException"), "CSVimport/Datasynchro: Password validation failed with: " . $sStatus->GetDescription()); + } + } + } + +} \ No newline at end of file