From 097b43d61f35fa1b435bb489a1f37e48b7532406 Mon Sep 17 00:00:00 2001
From: efalcy <efalcy@afi-sa.fr>
Date: Wed, 10 Feb 2016 16:39:58 +0100
Subject: [PATCH] dev #37124 : fix tests

---
 library/ZendAfi/View/Helper/BibView.php        |  6 +++---
 .../opac/controllers/BibControllerTest.php     | 18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/library/ZendAfi/View/Helper/BibView.php b/library/ZendAfi/View/Helper/BibView.php
index d196f327392..bdc9fbffd7a 100644
--- a/library/ZendAfi/View/Helper/BibView.php
+++ b/library/ZendAfi/View/Helper/BibView.php
@@ -182,19 +182,19 @@ class ZendAfi_View_Helper_BibView extends ZendAfi_View_Helper_BaseHelper {
         return '';
 
       $count++;
-      $content.=$this->_renderBlock($this->_renderOptions($field),$field->getLabel(),'custom'.$count);
+      $content.=$this->_renderBlock($this->_renderOptions($field,$count),$field->getLabel(),'custom'.$count);
     }
     return $content;
   }
 
 
 
-  protected function _renderOptions($field) {
+  protected function _renderOptions($field,$count) {
     $options = $field->getSelectedOptionsList();
 
     if (empty($options)) {
       return $this->_renderInfo($field->getValue(),
-                                             $field->getLabel() . ' : ','custom'.$count);
+                                $field->getLabel() . ' : ','custom'.$count);
     }
     $content_options='';
     foreach (array_filter($options) as $option) {
diff --git a/tests/application/modules/opac/controllers/BibControllerTest.php b/tests/application/modules/opac/controllers/BibControllerTest.php
index 6ed86b314dd..c858d2be42d 100644
--- a/tests/application/modules/opac/controllers/BibControllerTest.php
+++ b/tests/application/modules/opac/controllers/BibControllerTest.php
@@ -337,7 +337,7 @@ class BibControllerBibViewAnnecyTest extends BibControllerBibViewTestCase {
 
   /** @test */
   function AdresseShouldBe1RueJeanJaures() {
-    $this->assertXPathContentContains('//tr', '1 rue Jean Jaures');
+    $this->assertXPathContentContains('//dd', '1 rue Jean Jaures');
   }
 
 
@@ -407,7 +407,7 @@ class BibControllerTextCustomFieldsTest extends BibControllerBibViewTestCase {
     $this->bib_annecy->setCustomField('Lieu', 'Far Far Away');
     $this->bib_annecy->saveWithCustomFields();
     $this->dispatch('bib/bibview/id/4', true);
-    $this->assertXPathContentContains("//table//td", "Lieu :", $this->_response->getBody());
+    $this->assertXPathContentContains("//div//dt", "Lieu :", $this->_response->getBody());
   }
 
 
@@ -416,7 +416,7 @@ class BibControllerTextCustomFieldsTest extends BibControllerBibViewTestCase {
     $this->bib_annecy->setCustomField('Lieu', 'Far Far Away');
     $this->bib_annecy->saveWithCustomFields();
     $this->dispatch('bib/bibview/id/4', true);
-    $this->assertXPathContentContains("//table//td", "Far Far Away", $this->_response->getBody());
+    $this->assertXPathContentContains("//div//dd", "Far Far Away", $this->_response->getBody());
   }
 
 
@@ -425,7 +425,7 @@ class BibControllerTextCustomFieldsTest extends BibControllerBibViewTestCase {
     $this->bib_annecy->setCustomField('Lieu', '');
     $this->bib_annecy->saveWithCustomFields();
     $this->dispatch('bib/bibview/id/4', true);
-    $this->assertNotXPathContentContains("//table//td", "Lieu :", $this->_response->getBody());
+    $this->assertNotXPathContentContains("//div//dd", "Lieu :", $this->_response->getBody());
   }
 }
 
@@ -452,26 +452,26 @@ class BibControllerMultiCheckBoxCustomFieldsTest extends BibControllerBibViewTes
 
 
   /** @test */
-  public function customFieldLieuShouldBeDisplayed() {
-    $this->assertXPathContentContains("//table//td", "Services :");
+  public function customFieldServicesShouldBeDisplayed() {
+    $this->assertXPathContentContains("//div//h2", "Services");
   }
 
 
   /** @test */
   public function servicesShouldContainsWifi() {
-    $this->assertXPathContentContains('//table//td', 'Wifi');
+    $this->assertXPathContentContains('//div[@class="custom1"]//dd', 'Wifi');
   }
 
 
   /** @test */
   public function servicesShouldContainsRestauration() {
-    $this->assertXPathContentContains('//table//td', 'Restauration');
+    $this->assertXPathContentContains('//div//dd[@class="Restauration"]', 'Restauration',$this->_response->getBody());
   }
 
 
   /** @test */
   public function servicesShouldNotContainsProjection() {
-    $this->assertNotXPathContentContains('//table//td', 'Projection');
+    $this->assertNotXPathContentContains('//div//dd', 'Projection');
   }
 
 
-- 
GitLab