RequireOnceItopFile('sources/application/status/Status.php'); } /** * @expectedException \Exception */ public function testStatusGetAppRootWrongPath() { $sAppRootFilenamewrong = 'approot.inc.php_wrong'; $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusGetAppRoot", $oStatus, [$sAppRootFilenamewrong]); } /** * */ public function testStatusGetAppRootGood() { $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusGetAppRoot", $oStatus, []); $this->assertNotEmpty(APPROOT); } /** * @expectedException \Exception */ public function testStatusCheckConfigFileWrongPath() { $sConfigFilenamewrong = 'config-itop.php_wrong'; $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, [$sConfigFilenamewrong]); } public function testStatusCheckConfigFileGood() { $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusCheckConfigFile", $oStatus, []); $this->assertTrue(true); } /** * @runInSeparateProcess Required because Status constructor invokes MetaModel::Startup... which does nothing when already loaded */ public function testStatusStartupWrongDbPwd() { $this->RequireOnceItopFile('core/cmdbobject.class.inc.php'); $this->RequireOnceItopFile('application/utils.inc.php'); $this->RequireOnceItopFile('core/contexttag.class.inc.php'); $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE); $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd').'_unittest'); $this->expectException(MySQLException::class); new Status($oConfigWrong); } /** * */ public function testStatusStartupGood() { $oStatus = new Status(); $this->InvokeNonPublicMethod("Combodo\iTop\Application\Status\Status", "StatusStartup", $oStatus, []); $this->assertTrue(true); } }