DragonBe\Vies\HeartBeat::isAlive PHP Method

isAlive() public method

Checks if the VIES service is online and available
public isAlive ( )
    public function isAlive()
    {
        $status = $this->connect($this->getHost(), $this->getPort());
        if (false === $status) {
            return false;
        }
        return true;
    }

Usage Example

示例#1
0
 /**
  * @covers DragonBe\Vies\HeartBeat::isAlive
  * @covers DragonBe\Vies\HeartBeat::connect
  */
 public function testVerifyServicesIsDown()
 {
     $host = '127.0.0.1';
     $port = -1;
     HeartBeat::$testingEnabled = true;
     HeartBeat::$testingServiceIsUp = false;
     $hb = new HeartBeat($host, $port);
     $result = $hb->isAlive();
     $this->assertFalse($result);
 }