From 3b6cdef7d231d9112a8c0bbe742c99b3de7908db Mon Sep 17 00:00:00 2001
From: efalcy <efalcy@afi-sa.fr>
Date: Tue, 10 Nov 2015 16:04:46 +0100
Subject: [PATCH] dev #5524 fix and add tests for recunts action

---
 .../controllers/NoticeAjaxControllerTest.php  | 29 +++++++++++++++++--
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php
index 6c41c5e6635..305fbb47f73 100644
--- a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php
+++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php
@@ -2149,14 +2149,37 @@ class NoticeAjaxControllerRessourceEpubPictoTypeTest extends AbstractControllerT
 
 
 class NoticeAjaxControllerRecountsTest extends AbstractControllerTestCase {
+  protected $_storm_default_to_volatile = true;
   public function setUp() {
     parent::setUp();
-    $this->dispatch('/noticeajax/recounts/');
+    $record = $this->fixture('Class_Notice',['id'=> 10,
+                                             'titre_principal' => 'Le photographe',
+                                             'auteur_principal' => 'Guibert',
+                                             'unimarc' =>file_get_contents(realpath(dirname(__FILE__)).'../../../../../fixtures/audiard_herosdiscret.uni')]);
+
+
+
+
+    Class_Profil::getCurrentProfil()
+      ->setCfgModules(['recherche' =>
+                       ['viewnotice0' => [
+                                         'analytics' => '702',
+                                         'analytics_title' => '6',
+                                         'analytics_authors' => 'a'
+                         ]]]);
+
+    $this->dispatch('/noticeajax/recounts/id_notice/10');
   }
 
 
   /** @test */
-  public function recountsShouldBePresent() {
-    $this->assertXpath('//ul/li');
+  public function dupontelShouldBePresent() {
+    $this->assertXpathContentContains('//ul/li','Acteur / Dupontel',$this->_response->getBody());
   }
+
+  /** @test */
+  public function leHenryShouldBePresent() {
+    $this->assertXpathContentContains('//ul/li','Intervenant / Le Henry',$this->_response->getBody());
+  }
+
 }
\ No newline at end of file
-- 
GitLab