/** * @test * @return void */ public function removeRelatedRemovesRelatedForRelated() { $event = new \DERHANSEN\SfEventMgt\Domain\Model\Event(); $relatedObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', ['detach'], [], '', false); $relatedObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($event)); $this->inject($this->subject, 'related', $relatedObjectStorageMock); $this->subject->removeRelated($event); }