Inheritance: extends BaseMonitor
コード例 #1
0
 /**
  * @param HttpPingMonitor $httpPingMonitor
  */
 public function httpPingDown(HttpPingMonitor $httpPingMonitor)
 {
     $additionalInfo = '';
     if ($httpPingMonitor->getCheckPhrase() && !$httpPingMonitor->getResponseContainsPhrase()) {
         $additionalInfo = " Response did not contain \"{$httpPingMonitor->getCheckPhrase()}\"";
     }
     $this->sendNotification('whenHttpPingDown', "HTTP Ping Failed: {$httpPingMonitor->getUrl()}!", "HTTP Ping Failed for {$httpPingMonitor->getUrl()}! Response Code {$httpPingMonitor->getResponseCode()}.{$additionalInfo}", BaseSender::TYPE_ERROR);
 }
コード例 #2
0
 /** @test */
 public function it_throws_an_exception_for_nonexistent_url()
 {
     $httpPingMonitor = new HttpPingMonitor([]);
     $this->setExpectedException(InvalidConfiguration::class);
     $httpPingMonitor->runMonitor();
 }