Exemplo n.º 1
0
 public function test_HealthStatusObjectMapper()
 {
     $objMpr = new HealthStatusObjectMapper();
     $manager = new HealthManager();
     $manager->addCheck(new AlwaysUp())->addCheck(new AlwaysWarn())->addCheck(new AlwaysDown());
     $statusVo = $objMpr->getEncoded($manager->runAll());
     $this->assertEquals($statusVo, ['status' => 'DOWN', 'Fliglio\\Health\\AlwaysUp' => 'UP', 'Fliglio\\Health\\AlwaysWarn' => 'WARN', 'Fliglio\\Health\\AlwaysDown' => 'DOWN']);
 }
Exemplo n.º 2
0
 public function test_CheckDown()
 {
     $manager = new HealthManager();
     $manager->addCheck(new HttpResolveCheck('http://badhostname'));
     $this->assertTrue($manager->runAll()->isDown());
 }
Exemplo n.º 3
0
 public function test_CheckDown()
 {
     $manager = new HealthManager();
     $manager->addCheck(new MysqlCheck('localhost', 'root', 'badpasswordandstuff'));
     $this->assertTrue($manager->runAll()->isDown());
 }