/** * @param \Pluswerk\Simpleblog\Domain\Model\Blog $blog * @param \Pluswerk\Simpleblog\Domain\Model\Post $post */ public function addAction(\Pluswerk\Simpleblog\Domain\Model\Blog $blog, \Pluswerk\Simpleblog\Domain\Model\Post $post) { //$post->setPostdate(new \DateTime()); //$this->postRepository->add($post); $post->setAuthor($this->objectManager->get('Pluswerk\\Simpleblog\\Domain\\Repository\\AuthorRepository')->findOneByUid($GLOBALS['TSFE']->fe_user->user['uid'])); $blog->addPost($post); $this->objectManager->get('Pluswerk\\Simpleblog\\Domain\\Repository\\BlogRepository')->update($blog); $this->redirect('show', 'Blog', NULL, array('blog' => $blog)); }
/** * @test */ public function setAuthorForAuthorSetsAuthor() { $authorFixture = new \Pluswerk\Simpleblog\Domain\Model\Author(); $this->subject->setAuthor($authorFixture); $this->assertAttributeEquals($authorFixture, 'author', $this->subject); }