diff --git a/tests/library/Class/NoticeTest.php b/tests/library/Class/NoticeTest.php index 48902b32c3bb9dfe7cbe5bbee6285162c21440b1..d29b5dcab38db0d6c869648638b8a0d5f5829cf6 100644 --- a/tests/library/Class/NoticeTest.php +++ b/tests/library/Class/NoticeTest.php @@ -199,22 +199,25 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase { /** @test */ public function noticeForArticleWithoutThumbnailShouldGenerateItInTempDir() { - $image = Storm_Test_ObjectWrapper::mock(); - Class_WebService_Thumbnail_Provider_Article::setDefaultImageFactory( - Storm_Test_ObjectWrapper::mock() - ->whenCalled('newImage') - ->with(Class_Url::absolute('marsu.jpg')) - ->answers($image) - ->beStrict()); - - $image - ->whenCalled('thumbnailImage') - ->with(160, 220, true, true) - ->answers(null) - ->whenCalled('writeImage') - ->with(PATH_TEMP . 'vignettes_titre/SPIROU.jpg') - ->answers(null) - ->beStrict(); + $image = $this->mock() + ->whenCalled('thumbnailImage') + ->with(160, 220, true, true) + ->answers(null) + + ->whenCalled('writeImage') + ->with(PATH_TEMP . 'vignettes_titre/SPIROU.jpg') + ->answers(null) + + ->beStrict(); + + $image_factory = $this->mock() + ->whenCalled('newImage') + ->with(Class_Url::absolute('marsu.jpg')) + ->answers($image) + ->beStrict(); + + Class_Notice_Thumbnail_ProviderAbstract::setDefaultImageFactory($image_factory); + $this->assertEquals('/temp/vignettes_titre/SPIROU.jpg', $this->_notice_article_without_thumbnails->fetchUrlLocalVignette());