public function testFileGenerate(UnitTester $I)
 {
     $data = ['host' => 'localhost', 'port' => '80'];
     $fileGenerator = new NagiosFileGenerator(__DIR__ . '../../../src/tmpl/nagios.php', config_path() . '/nagios.php');
     $fileGenerator->make($data);
     $stubFile = file_get_contents(__DIR__ . '/../' . '_stubs/nagios.php');
     $createdDbFile = file_get_contents(config_path() . '/nagios.php');
     $I->assertFileExists(config_path() . '/nagios.php');
     $I->assertEquals($stubFile, $createdDbFile);
 }
 public function tryToTest(UnitTester $I)
 {
     $data = ['host' => 'localhost', 'username' => 'grafana', 'password' => 'secret', 'port' => '80'];
     $installManager = \App::make('Stigma\\Installation\\InstallManager');
     $grafanaInstallation = $installManager->getGrafanaInstallation();
     $grafanaInstallation->setup($data);
     $I->assertFileExists(config_path() . '/grafana.php');
     $generatedFile = file_get_contents(config_path() . '/grafana.php');
     $comparedFile = file_get_contents(__DIR__ . '/../_stubs/grafana.php');
     $I->assertEquals($comparedFile, $generatedFile);
 }
예제 #3
0
 public function testSetup(UnitTester $I)
 {
     $data = ['host' => 'localhost', 'port' => '80'];
     $installManager = \App::make('Stigma\\Installation\\InstallManager');
     $nagiosInstallation = $installManager->getNagiosInstallation();
     $ret = $nagiosInstallation->setup($data);
     $stubFile = file_get_contents(__DIR__ . '/../' . '_stubs/nagios.php');
     $createdFile = file_get_contents(config_path() . '/nagios.php');
     $I->assertTrue($ret);
     $I->assertFileExists(config_path() . '/nagios.php');
     $I->assertEquals($stubFile, $createdFile);
 }
 public function tryToSetup(UnitTester $I)
 {
     if (file_exists(config_path() . '/influxdb.php')) {
         $I->deleteFile(config_path() . '/influxdb.php');
     }
     $data = ['host' => 'localhost', 'database' => 'stigma', 'username' => 'username', 'password' => 'password'];
     $installManager = \App::make('Stigma\\Installation\\InstallManager');
     $influxdbInstallation = $installManager->getInfluxdbInstallation();
     $ret = $influxdbInstallation->setup($data);
     $stubFile = file_get_contents(__DIR__ . '/../' . '_stubs/influxdb.php');
     $createdFile = file_get_contents(config_path() . '/influxdb.php');
     $I->assertTrue($ret);
     $I->assertFileExists(config_path() . '/influxdb.php');
     $I->assertEquals($stubFile, $createdFile);
 }