From 42c7b49eccfe227b97698b342fc73d47f01b63fa Mon Sep 17 00:00:00 2001
From: efalcy <efalcy@afi-sa.fr>
Date: Thu, 8 Oct 2015 16:01:38 +0200
Subject: [PATCH] dev #19211 recuperation visuels cd : fix tests

---
 .../Class/Notice/Thumbnail/ProviderThirdParty.php   | 13 ++++++++-----
 .../opac/controllers/NoticeAjaxControllerTest.php   |  2 +-
 tests/library/Class/NoticeTest.php                  |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/library/Class/Notice/Thumbnail/ProviderThirdParty.php b/library/Class/Notice/Thumbnail/ProviderThirdParty.php
index 795aa035ec8..ee9158439f7 100644
--- a/library/Class/Notice/Thumbnail/ProviderThirdParty.php
+++ b/library/Class/Notice/Thumbnail/ProviderThirdParty.php
@@ -35,11 +35,14 @@ class Class_Notice_Thumbnail_ProviderThirdParty
       ->getModulePreference('recherche',
                             'viewnotice' . $this->_record->getTypeDoc(),
                             'thumbnail_fields');
-
-    list($zone, $field) = explode('$', $thumbnail);
-
-    $subfields = $this->_record->get_subfield($zone, $field);
-    return empty($subfields) ? null : $this->_getFirstImage($subfields);
+    $datas = explode(';', $thumbnail);
+    foreach ($datas as $data) {
+      list($zone, $field) = explode('$', $data);
+      $subfields = $this->_record->get_subfield($zone, $field);
+      $image = empty($subfields) ? null : $this->_getFirstImage($subfields);
+      if ($image)
+        return $image;
+    }
   }
 
 
diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php
index 807a67d5d29..623b55810d1 100644
--- a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php
+++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php
@@ -1115,7 +1115,7 @@ class NoticeAjaxControllerVideoMorceauTest extends AbstractControllerTestCase {
 
 
   /**
-   * @group integration
+   * @group no-ci
    * @test
    */
   public function responseShouldContainsPlayer() {
diff --git a/tests/library/Class/NoticeTest.php b/tests/library/Class/NoticeTest.php
index a1cbd47a8e1..66d67373c5a 100644
--- a/tests/library/Class/NoticeTest.php
+++ b/tests/library/Class/NoticeTest.php
@@ -110,7 +110,7 @@ class NoticeVignetteTest extends Storm_Test_ModelTestCase {
 
 
 
-    $preferences= [ 'thumbnail_fields' => '856$u'];
+    $preferences= [ 'thumbnail_fields' => '700$a;856$u'];
     Class_Profil::getCurrentProfil()
       ->setCfgModules(['recherche' => ['viewnotice'.Class_TypeDoc::DISQUE => $preferences]]);
 
-- 
GitLab