Пример #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']);
 }
Пример #2
0
 public function test_CheckDown()
 {
     $manager = new HealthManager();
     $manager->addCheck(new HttpResolveCheck('http://badhostname'));
     $this->assertTrue($manager->runAll()->isDown());
 }
Пример #3
0
 public function test_CheckDown()
 {
     $manager = new HealthManager();
     $manager->addCheck(new MysqlCheck('localhost', 'root', 'badpasswordandstuff'));
     $this->assertTrue($manager->runAll()->isDown());
 }