/** * @test */ public function removeCategoryFromObjectStorageHoldingCategory() { $category = new \DERHANSEN\SfEventMgt\Domain\Model\Category(); $categoryObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $categoryObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($category)); $this->inject($this->subject, 'category', $categoryObjectStorageMock); $this->subject->removeCategory($category); }