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