From e7360661be984a2311adc5f40d8af891b26a3664 Mon Sep 17 00:00:00 2001 From: odain Date: Mon, 19 Oct 2020 11:42:48 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B03381=20-=20finish=20integrating=20health?= =?UTF-8?q?check=20status.php=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/status/StatusTest.php | 14 +++++++++----- {test/status => webservices}/status.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) rename {test/status => webservices}/status.php (90%) diff --git a/test/status/StatusTest.php b/test/status/StatusTest.php index dac665b5b..62eb2009e 100644 --- a/test/status/StatusTest.php +++ b/test/status/StatusTest.php @@ -15,12 +15,16 @@ use Combodo\iTop\Test\UnitTest\ItopTestCase; * @backupGlobals disabled */ class StatusTest extends ItopTestCase { + public function setUp() + { + parent::setUp(); + } - /** + /** * */ public function testStatusWrongUrl() { - $sPath = __DIR__ . '/status_wrong.php'; + $sPath = APPROOT . '/status_wrong.php'; exec("php $sPath", $aOutput, $iRet); $this->assertNotEquals(0, $iRet, "Problem executing status page: $sPath, $iRet, aOutput:\n" . var_export($aOutput, true)); @@ -31,7 +35,7 @@ class StatusTest extends ItopTestCase { * */ public function testStatusGood() { - $sPath = __DIR__ . '/status.php'; + $sPath = APPROOT . '/webservices/status.php'; exec("php $sPath", $aOutput, $iRet); $this->assertEquals(0, $iRet, "Problem executing status page: $sPath, $iRet, aOutput:\n" . var_export($aOutput, true)); @@ -41,10 +45,10 @@ class StatusTest extends ItopTestCase { * */ public function testStatusGoodWithJson() { - $sPath = __DIR__ . '/status.php'; + $sPath = APPROOT . '/webservices/status.php'; exec("php $sPath", $aOutput, $iRet); - $sAdditionnalInfo = "aOutput:\n" . var_export($aOutput, true); + $sAdditionnalInfo = "aOutput:\n" . var_export($aOutput, true) . '.'; //Check response $this->assertNotEmpty($aOutput[0], 'Empty response. ' . $sAdditionnalInfo); diff --git a/test/status/status.php b/webservices/status.php similarity index 90% rename from test/status/status.php rename to webservices/status.php index c81b17aff..21d235539 100644 --- a/test/status/status.php +++ b/webservices/status.php @@ -1,7 +1,7 @@