diff --git a/VERSIONS_HOTLINE/29412 b/VERSIONS_HOTLINE/29412 new file mode 100644 index 0000000000000000000000000000000000000000..dae89ac67ecdb9e12195b9ce4f328fd5873f5db7 --- /dev/null +++ b/VERSIONS_HOTLINE/29412 @@ -0,0 +1 @@ + - ticket #29412 : correction du vignettage des articles dans le résultat de recherche. \ No newline at end of file diff --git a/application/modules/admin/controllers/CmsController.php b/application/modules/admin/controllers/CmsController.php index 0fd612d0efa6d9d623ea5f1fa203e5a9341a6de4..66d2bcc98328ce489415244c46aa825d4eac5c5a 100644 --- a/application/modules/admin/controllers/CmsController.php +++ b/application/modules/admin/controllers/CmsController.php @@ -48,6 +48,8 @@ class Admin_CmsController extends ZendAfi_Controller_Action { protected function _postEditAction($article) { $article->index(); + if($record = $article->getNotice()) + (new Class_WebService_Vignette())->updateUrlsFromCacheServer($record); } diff --git a/tests/application/modules/admin/controllers/CmsControllerTest.php b/tests/application/modules/admin/controllers/CmsControllerTest.php index 30811d21ce7d3cb6c74f4282a22a6f2f3a1fbe1c..0feee7d131f3647bfaad1c39dba308c859c37fb2 100644 --- a/tests/application/modules/admin/controllers/CmsControllerTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerTest.php @@ -844,6 +844,29 @@ class CmsControllerArticleConcertEditActionPostTest extends CmsControllerWithPer public function setUp() { parent::setUp(); + $filesystem = new Storm_FileSystem_Volatile(); + $thumbnail_paths = PATH_TEMP .'vignettes_titre/'; + $filesystem + ->mkdir($thumbnail_paths) + ->cd($thumbnail_paths); + + Class_WebService_Vignette::setFileSystem($filesystem); + + $image = Storm_Test_ObjectWrapper::mock(); + Class_WebService_Thumbnail_Provider_Article::setDefaultImageFactory( + Storm_Test_ObjectWrapper::mock() + ->whenCalled('newImage') + ->answers($image)); + + $image + ->whenCalled('thumbnailImage') + ->with(160, 220, true, true) + ->answers(null) + ->whenCalled('writeImage') + ->with(PATH_TEMP . 'vignettes_titre/ERIKTRUFFAZLADYLANDQUARTETENCONCERT-4-TOM----8.jpg') + ->answers(null) + ->beStrict(); + Class_Notice::beVolatile(); Class_NoticeDomain::beVolatile(); Class_IntBib::beVolatile(); @@ -1019,6 +1042,12 @@ class CmsControllerArticleConcertEditActionPostTest extends CmsControllerWithPer public function flashMessengerShouldNotContainsPopup() { $this->assertNotFlashMessengerPopup(); } + + + /** @test */ + public function langueRecordThumbShouldBeSet() { + $this->assertContains('temp/vignettes_titre/ERIKTRUFFAZLADYLANDQUARTETENCONCERT-4-TOM----8.jpg', Class_Article::find(4)->getNotice()->getUrlVignette()); + } }