getCertificateDaysUntilExpiration() 공개 메소드

 /** @test */
 public function it_can_parse_a_certificate_days_to_expiration()
 {
     $monitor = new SSLCertificateMonitor(['url' => 'https://www.example.com/']);
     $certificate = $this->certificate;
     $certificate['validTo_time_t'] = strtotime('+2 days');
     $monitor->processCertificate($certificate);
     $this->assertEquals(2, $monitor->getCertificateDaysUntilExpiration());
     $certificate['validTo_time_t'] = strtotime('-2 days');
     $monitor->processCertificate($certificate);
     $this->assertEquals(-2, $monitor->getCertificateDaysUntilExpiration());
 }
 /** @test */
 public function it_can_download_the_certificate_for_a_url_successfully()
 {
     $sslCertificateMonitor = new SSLCertificateMonitor(['url' => 'https://www.google.com/']);
     $sslCertificateMonitor->runMonitor();
     $this->assertGreaterThan(1, $sslCertificateMonitor->getCertificateDaysUntilExpiration());
 }
 /**
  * @param SSLCertificateMonitor $sslCertificateMonitor
  */
 public function sslCertificateExpiring(SSLCertificateMonitor $sslCertificateMonitor)
 {
     $this->sendNotification('whenSSLCertificateInvalid', "SSL Certificate Expiring: {$sslCertificateMonitor->getUrl()}", "SSL Certificate for {$sslCertificateMonitor->getUrl()} is expiring on {$sslCertificateMonitor->getCertificateExpiration()} ({$sslCertificateMonitor->getCertificateDaysUntilExpiration()} days).", BaseSender::TYPE_ERROR);
 }