/** * @test */ public function addVotingToObjectStorageHoldingVotings() { $voting = new \Visol\EasyvoteEducation\Domain\Model\Voting(); $votingsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('attach'), array(), '', FALSE); $votingsObjectStorageMock->expects($this->once())->method('attach')->with($this->equalTo($voting)); $this->inject($this->subject, 'votings', $votingsObjectStorageMock); $this->subject->addVoting($voting); }