/** * @test */ public function removeBezirkeFromObjectStorageHoldingBezirke() { $bezirke = new \Fakturaberlin\Werkstattsuche\Domain\Model\Bezirk(); $bezirkeObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $bezirkeObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($bezirke)); $this->inject($this->subject, 'bezirke', $bezirkeObjectStorageMock); $this->subject->removeBezirke($bezirke); }