Skip to content

Commit

Permalink
N°3464: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
odain-cbd committed Dec 7, 2020
1 parent 57a085e commit 37351d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/webservices/RestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class RestTest extends ItopDataTestCase

private $sTmpFile = "";
private $bPassJsonDataAsFile = false;
private $sUrl;
private $sLogin;
private $sPassword = "Iuytrez9876543ç_è-(";

Expand All @@ -34,6 +35,11 @@ protected function setUp()
unlink($this->sTmpFile);
}

$sConfigFile = \utils::GetConfig()->GetLoadedFile();
@chmod($sConfigFile, 0770);
$this->sUrl = \MetaModel::GetConfig()->Get('app_root_url');
@chmod($sConfigFile, 0444); // Read-only

$oRestProfile = \MetaModel::GetObjectFromOQL("SELECT URP_Profiles WHERE name = :name", array('name' => 'REST Services User'), true);
$oAdminProfile = \MetaModel::GetObjectFromOQL("SELECT URP_Profiles WHERE name = :name", array('name' => 'Administrator'), true);

Expand Down Expand Up @@ -232,8 +238,7 @@ private function CallRestApi($sJsonDataContent){
$aPostFields['json_data'] = $sJsonDataContent;
}

$sUrl = \MetaModel::GetConfig()->Get('app_root_url');
curl_setopt($ch, CURLOPT_URL, "$sUrl/webservices/rest.php");
curl_setopt($ch, CURLOPT_URL, "$this->sUrl/webservices/rest.php");
curl_setopt($ch, CURLOPT_POST, 1);// set post data to true
curl_setopt($ch, CURLOPT_POSTFIELDS, $aPostFields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Expand Down

0 comments on commit 37351d6

Please sign in to comment.