From c46d0f5662874c2bb300dbab4c8b02bfebd5679d Mon Sep 17 00:00:00 2001 From: odain Date: Mon, 30 Mar 2020 17:45:25 +0200 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=20N=C2=B02888=20Impossib?= =?UTF-8?q?ility=20to=20import=20iTop=20User=20with=20password=20policy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/core/BulkChangeTest.inc.php | 72 ++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 test/core/BulkChangeTest.inc.php 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