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