示例#1
0
 /**
  * Determine if this endpoint can re-enabled.
  *
  * @param Endpoint $newActive
  *
  * @return bool
  */
 private function canBeActivated(Endpoint $newActive)
 {
     // if newActive is currently in error, see if it can be re-enabled
     if ($newActive->isError() === true) {
         $offlineInterval = new \DateTime();
         $offlineInterval->modify('-60 minutes');
         return $newActive->getLastConnected() !== null && $newActive->getLastConnected() <= $offlineInterval;
     }
     return true;
 }
示例#2
0
 /**
  * test status can't be set to something weird.
  * 
  * @throws \InvalidArgumentException
  */
 public function testCreateFromString()
 {
     $endpoint = Endpoint::createFromString('http://www.blabla.com');
     self::assertInstanceOf('\\WebservicesNl\\Common\\Endpoint\\Endpoint', $endpoint);
 }