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

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

public setCurrentName ( Name $name = null ) : void
$name Name
Результат void
    public function setCurrentName(Fixtures\Name $name = null)
    {
        $this->currentName = $name;
    }

Usage Example

 /**
  * @test
  */
 public function containWithSplObjectStorageInRuntimeEvaluation()
 {
     $targetClass = new Fixtures\TargetClass01();
     $name = new Fixtures\Name('Flow');
     $otherName = new Fixtures\Name('Neos');
     $splObjectStorage = new \SplObjectStorage();
     $splObjectStorage->attach($name);
     $targetClass->setCurrentName($name);
     $this->assertEquals('Hello, special guest', $targetClass->greetMany($splObjectStorage));
     $targetClass->setCurrentName(null);
     $this->assertEquals('Hello, Flow', $targetClass->greetMany($splObjectStorage));
     $targetClass->setCurrentName($otherName);
     $this->assertEquals('Hello, Flow', $targetClass->greetMany($splObjectStorage));
 }