Neos\Flow\Tests\Functional\Aop\Fixtures\TargetClass01::sayHelloAndThrow PHP Метод

sayHelloAndThrow() публичный Метод

public sayHelloAndThrow ( boolean $throwException ) : string
$throwException boolean
Результат string
    public function sayHelloAndThrow($throwException)
    {
        if ($throwException) {
            throw new \Exception();
        }
        return 'Hello';
    }

Usage Example

 /**
  * @test
  */
 public function adviceRecoversFromException()
 {
     $targetClass = new Fixtures\TargetClass01();
     try {
         $targetClass->sayHelloAndThrow(true);
     } catch (\Exception $exception) {
     }
     $this->assertSame('Hello World', $targetClass->sayHelloAndThrow(false));
 }