From 124a1e990e9c34f438aef92dd5e9712df7e7a732 Mon Sep 17 00:00:00 2001 From: pbarroca <pbarroca@afi-sa.fr> Date: Tue, 6 Oct 2015 12:46:27 +0200 Subject: [PATCH] rel #30143: fix tests --- tests/library/Class/NoticeTest.php | 35 ++++++++++++++++-------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tests/library/Class/NoticeTest.php b/tests/library/Class/NoticeTest.php index 48902b32c3b..d29b5dcab38 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()); -- GitLab