protected function setupDummyPost($withTags = false) { $author = new Fixtures\Domain\Model\User(); $author->setEmailAddress('[email protected]'); $post = new Fixtures\Domain\Model\Post(); $post->setAuthor($author); $post->setName('myName'); $post->setPrivate(true); if ($withTags === true) { $post->addTag(new Fixtures\Domain\Model\Tag('Tag1')); $post->addTag(new Fixtures\Domain\Model\Tag('Tag2')); } $this->persistenceManager->add($post); $postIdentifier = $this->persistenceManager->getIdentifierByObject($post); $this->persistenceManager->persistAll(); $this->persistenceManager->clearState(); return $postIdentifier; }