DragonBe\Vies\Vies::setHeartBeat PHP Method

setHeartBeat() public method

Sets the heartbeat functionality to verify if the VIES service is alive or not, especially since this service tends to have a bad reputation of its availability.
public setHeartBeat ( HeartBeat $heartBeat )
$heartBeat HeartBeat
    public function setHeartBeat(HeartBeat $heartBeat)
    {
        $this->heartBeat = $heartBeat;
    }

Usage Example

Beispiel #1
0
 /**
  * @covers \DragonBe\Vies\Vies::getHeartBeat
  * @covers \DragonBe\Vies\Vies::setHeartBeat
  */
 public function testServiceIsDown()
 {
     $vies = new Vies();
     $hb = $this->createHeartBeatMock(false);
     $vies->setHeartBeat($hb);
     $this->assertFalse($vies->getHeartBeat()->isAlive());
 }