GracefulDeath::around PHP Method

around() public static method

public static around ( $main )
    public static function around($main)
    {
        return new Builder($main);
    }

Usage Example

 public function testTooManyViolentDeath()
 {
     $numberOfFailures = 12;
     $inAmountOfTime = 60;
     GracefulDeath::around(function () {
         $this->raiseFatalError();
     })->liveForever()->avoidFutileMedicalCare($numberOfFailures, $inAmountOfTime)->reanimationPolicy($this->willBeCalled($this->exactly($numberOfFailures - 1)))->afterNaturalDeath($this->willBeCalled($this->never()))->afterViolentDeath($this->willBeCalled($this->once()))->run();
 }
All Usage Examples Of GracefulDeath::around