/** * @test */ public function addTargetGroupToObjectStorageHoldingTargetGroup() { $targetGroup = new \MUM\BjrFreizeit\Domain\Model\TargetGroup(); $targetGroupObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('attach'), array(), '', FALSE); $targetGroupObjectStorageMock->expects($this->once())->method('attach')->with($this->equalTo($targetGroup)); $this->inject($this->subject, 'targetGroup', $targetGroupObjectStorageMock); $this->subject->addTargetGroup($targetGroup); }