N°3381 - finish integrating healthcheck status.php page

This commit is contained in:
odain
2020-10-19 11:42:48 +02:00
parent 6edb308480
commit e7360661be
2 changed files with 10 additions and 6 deletions

View File

@@ -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);

View File

@@ -1,7 +1,7 @@
<?php
//Include status functions
require_once(__DIR__.'/../../sources/application/status/status.inc.php');
require_once(__DIR__.'/../sources/application/status/status.inc.php');
//Do check Status
try
{