/** * @test */ public function removePostFromObjectStorageHoldingPosts() { $post = new \Lobcher\Simpleblog\Domain\Model\Post(); $postsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $postsObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($post)); $this->inject($this->subject, 'posts', $postsObjectStorageMock); $this->subject->removePost($post); }
/** * @test */ public function setImageForFileReferenceSetsImage() { $fileReferenceFixture = new \TYPO3\CMS\Extbase\Domain\Model\FileReference(); $this->subject->setImage($fileReferenceFixture); $this->assertAttributeEquals($fileReferenceFixture, 'image', $this->subject); }