/** * @test */ public function removeTagFromObjectStorageHoldingTags() { $tag = new \MUM\BjrFreizeit\Domain\Model\Tags(); $tagsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $tagsObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($tag)); $this->inject($this->subject, 'tags', $tagsObjectStorageMock); $this->subject->removeTag($tag); }