sAppRoot = __DIR__ . '/../../sources/application/status'; } /** * @expectedException \Exception */ public function testStatusGetAppRootWrongPath() { include_once($this->sAppRoot . '/status.inc.php'); $sAppRootFilenamewrong = 'approot.inc.php_wrong'; StatusGetAppRoot($sAppRootFilenamewrong); } /** * */ public function testStatusGetAppRootGood() { include_once($this->sAppRoot . '/status.inc.php'); StatusGetAppRoot(); $this->assertNotEmpty(APPROOT); } /** * @expectedException \Exception */ public function testStatusCheckConfigFileWrongPath() { include_once($this->sAppRoot . '/status.inc.php'); $sConfigFilenamewrong = 'config-itop.php_wrong'; StatusCheckConfigFile($sConfigFilenamewrong); } /** * */ public function testStatusCheckConfigFileGood() { include_once($this->sAppRoot . '/status.inc.php'); StatusCheckConfigFile(); $this->assertTrue(true); } /** * @expectedException \MySQLException */ public function testStatusStartupWrongDbPwd() { include_once($this->sAppRoot . '/status.inc.php'); StatusCheckConfigFile(); require_once(APPROOT . '/core/cmdbobject.class.inc.php'); require_once(APPROOT . '/application/utils.inc.php'); require_once(APPROOT . '/core/contexttag.class.inc.php'); $oConfigWrong = new Config(ITOP_DEFAULT_CONFIG_FILE); $oConfigWrong->Set('db_pwd', $oConfigWrong->Get('db_pwd') . '_unittest'); StatusStartup($oConfigWrong); } /** * */ public function testStatusStartupGood() { include_once($this->sAppRoot . '/status.inc.php'); StatusStartup(); $this->assertTrue(true); } }