/** * @test */ public function addImageToObjectStorageHoldingImage() { $image = new \TYPO3\CMS\Extbase\Domain\Model\FileReference(); $imageObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('attach'), array(), '', FALSE); $imageObjectStorageMock->expects($this->once())->method('attach')->with($this->equalTo($image)); $this->inject($this->subject, 'image', $imageObjectStorageMock); $this->subject->addImage($image); }