From 37351d6b3e3141ca7eca412c5656ac0d8474cdc3 Mon Sep 17 00:00:00 2001 From: odain Date: Mon, 7 Dec 2020 16:23:17 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03464:=20fix=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/webservices/RestTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/webservices/RestTest.php b/test/webservices/RestTest.php index 46ebb24d99..d600660dbf 100644 --- a/test/webservices/RestTest.php +++ b/test/webservices/RestTest.php @@ -17,6 +17,7 @@ class RestTest extends ItopDataTestCase private $sTmpFile = ""; private $bPassJsonDataAsFile = false; + private $sUrl; private $sLogin; private $sPassword = "Iuytrez9876543ç_è-("; @@ -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); @@ -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);