From fa5e6e8b54ed304a9a6780c14601cb3040e13adf Mon Sep 17 00:00:00 2001 From: Ghislain Loas <ghislo@sandbox.pergame.net> Date: Thu, 29 Oct 2015 11:18:30 +0100 Subject: [PATCH] dev #30963 add fixture to fix failure --- .../NoticeAjaxControllerCdScriptTest.php | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerCdScriptTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerCdScriptTest.php index cbe54b8416e..9f908af6c5d 100644 --- a/tests/application/modules/opac/controllers/NoticeAjaxControllerCdScriptTest.php +++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerCdScriptTest.php @@ -22,14 +22,29 @@ class NoticeAjaxControllerCdScriptRecordTest extends AbstractControllerTestCase { protected + $_storm_default_to_volatile = true, $_record_le_kiosque, $_item_le_kiosque, $_service, - $_sigb_le_kiosque; + $_sigb_le_kiosque, + $_paul; public function setUp() { parent::setUp(); + $this->_paul = $this->fixture('Class_Users', + ['id' => 15, + 'login' => 'paul', + 'nom' => 'Le Pollux', + 'prenom' => 'Paul', + 'id_sigb' => '654987', + 'mail' => 'anemail@web.com', + 'naissance' => '2002-12-14', + 'password' => 'pollux', + 'date_fin' => '2015-12-14']); + + ZendAfi_Auth::getInstance()->logUser($this->_paul); + $config = Class_Profil::getCurrentProfil()->getCfgNoticeAsArray(); $config['exemplaires']['grouper'] = '1'; Class_Profil::getCurrentProfil()->setCfgNotice($config); @@ -51,6 +66,7 @@ class NoticeAjaxControllerCdScriptRecordTest extends AbstractControllerTestCase 'id_bib' => '3', 'cote' => '', 'zone995' => 'a:3:{i:0;a:2:{s:4:"code";s:1:"a";s:6:"valeur";s:10:"Le Kiosque";}i:1;a:2:{s:4:"code";s:1:"b";s:6:"valeur";s:3:"kio";}i:2;a:2:{s:4:"code";s:1:"f";s:6:"valeur";s:3:"319";}}']); + $this->_record_le_kiosque = $this->fixture('Class_Notice', ['id' => 2, 'exemplaires' => [$this->_item_le_kiosque]]); @@ -59,14 +75,15 @@ class NoticeAjaxControllerCdScriptRecordTest extends AbstractControllerTestCase 'remote_library_id' => 2]); $this->_service->setTimeSource(new TimeSourceForTest('2015-10-28 09:00:00')); - $this->dispatch('/opac/noticeajax/exemplaires/id_notice/2', true); $this->_sigb_le_kiosque = $this->_service->getNotice('456789')->getExemplaireByCodeBarre('456789'); + + $this->dispatch('/opac/noticeajax/exemplaires/id_notice/2', true); } /** @test */ public function linkToJumelShouldBePresent() { - $this->assertXPathContentContains('//table//a[contains(@href, "www.jumel39.fr/docnum.php?bib=2&res=kio&lien=456789&time=1446019200")]', 'Description en ligne'); + $this->assertXPathContentContains('//table//a[contains(@href, "www.jumel39.fr/docnum.php?bib=2&res=kio&lien=456789&time=1446019200&user=654987:Le Pollux:Paul:2002-12-14:empty@email:2015-12-14")]', 'Description en ligne', $this->_response->getBody()); } -- GitLab