/** * @test */ public function removeCommentFromObjectStorageHoldingComments() { $comment = new \Lobcher\Simpleblog\Domain\Model\Comment(); $commentsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $commentsObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($comment)); $this->inject($this->subject, 'comments', $commentsObjectStorageMock); $this->subject->removeComment($comment); }