/** * @test */ public function removeVoteFromObjectStorageHoldingVotes() { $vote = new \Visol\EasyvoteEducation\Domain\Model\Vote(); $votesObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $votesObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($vote)); $this->inject($this->subject, 'votes', $votesObjectStorageMock); $this->subject->removeVote($vote); }