/** * @test */ public function addPostToObjectStorageHoldingPost() { $post = new \Dawin\LgLgRbBlog\Domain\Model\Post(); $postObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('attach'), array(), '', FALSE); $postObjectStorageMock->expects($this->once())->method('attach')->with($this->equalTo($post)); $this->inject($this->subject, 'post', $postObjectStorageMock); $this->subject->addPost($post); }