From 4758ed7e7f2fb5f4d31a85f2da12826e78a562dd Mon Sep 17 00:00:00 2001
From: pbarroca <pbarroca@afi-sa.fr>
Date: Tue, 3 Nov 2015 09:29:28 +0100
Subject: [PATCH] rel #32225 fix web service Premiere

---
 VERSIONS_HOTLINE/32225                                         | 1 +
 library/Class/WebService/Premiere.php                          | 2 +-
 .../admin/controllers/SystemeControllerWebServicesTest.php     | 3 +--
 3 files changed, 3 insertions(+), 3 deletions(-)
 create mode 100644 VERSIONS_HOTLINE/32225

diff --git a/VERSIONS_HOTLINE/32225 b/VERSIONS_HOTLINE/32225
new file mode 100644
index 00000000000..2c46d69461a
--- /dev/null
+++ b/VERSIONS_HOTLINE/32225
@@ -0,0 +1 @@
+ - ticket #32225 : enrichissement Premiere: adaptation au changement du site
\ No newline at end of file
diff --git a/library/Class/WebService/Premiere.php b/library/Class/WebService/Premiere.php
index f1d97a2877a..9bbca85d110 100644
--- a/library/Class/WebService/Premiere.php
+++ b/library/Class/WebService/Premiere.php
@@ -63,7 +63,7 @@ class Class_WebService_Premiere {
     }
 
     // Recherche du bon bloc
-    $start = '<div class="rSnippet" itemprop="description" content="';
+    $start = '<div class="field-item even" property="content:encoded">';
     if (!$pos = strPos($data, $start))
       return '';
     $pos = $pos + strlen($start);
diff --git a/tests/application/modules/admin/controllers/SystemeControllerWebServicesTest.php b/tests/application/modules/admin/controllers/SystemeControllerWebServicesTest.php
index b6e6e60a06e..d4ba3f49298 100644
--- a/tests/application/modules/admin/controllers/SystemeControllerWebServicesTest.php
+++ b/tests/application/modules/admin/controllers/SystemeControllerWebServicesTest.php
@@ -18,8 +18,6 @@
  * along with BOKEH; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
  */
-require_once 'AdminAbstractControllerTestCase.php';
-
 class SystemeControllerWebServicesIndexActionTest extends Admin_AbstractControllerTestCase {
   public function setUp() {
     parent::setUp();
@@ -64,6 +62,7 @@ class SystemeControllerWebServicesActionTest extends Admin_AbstractControllerTes
    */
   public function webServicePremiereGetResumeShouldWork() {
     $this->dispatch('/admin/systeme/webservices/id_service/Premiere/id_fonction/1', true);
+
     $this->assertXPathContentContains('//pre[@class="resultat"]',
                                       'Jake Sully est un ancien marine', $this->_response->getBody());
   }
-- 
GitLab