Neos\Flow\Tests\Functional\Persistence\Fixtures\Post::setAuthor PHP Method

setAuthor() public method

public setAuthor ( TestValueObject $author )
$author TestValueObject
    public function setAuthor(TestValueObject $author)
    {
        $this->author = $author;
    }

Usage Example

 /**
  * This test fixes FLOW-296 but is only affecting MySQL.
  *
  * @test
  */
 public function valueObjectsAreNotCascadeRemovedWhenARelatedEntityIsDeleted()
 {
     $post1 = new Fixtures\Post();
     $post1->setAuthor(new Fixtures\TestValueObject('Some Name'));
     $post2 = new Fixtures\Post();
     $post2->setAuthor(new Fixtures\TestValueObject('Some Name'));
     $this->postRepository->add($post1);
     $this->postRepository->add($post2);
     $this->persistenceManager->persistAll();
     $this->postRepository->remove($post1);
     $this->persistenceManager->persistAll();
     // if all goes well the value object is not deleted
     $this->assertTrue(true);
 }