Skip to content
Snippets Groups Projects
Commit 73d2c06d authored by llaffont's avatar llaffont
Browse files

Sur kiosque Mur / Panier: le retour à la liste renvoie vers le panier #9486

parent 628fcb10
Branches
Tags
No related merge requests found
......@@ -65,18 +65,15 @@ class ZendAfi_View_Helper_UrlNotice extends Zend_View_Helper_HtmlElement {
}
} else {
$options = ['controller' => 'recherche',
'action' => 'viewnotice',
'clef' => $notice->getClefAlpha(),
'id' => $notice->getId()];
if (array_isset('retour_panier', $preferences))
$options['retour_panier'] = $preferences['retour_panier'];
if (array_isset('id_catalogue', $preferences))
$options['id_catalogue'] = $preferences['id_catalogue'];
$options = array_merge(['controller' => 'recherche',
'action' => 'viewnotice',
'clef' => $notice->getClefAlpha(),
'id' => $notice->getId()],
array_intersect_key(array_filter($preferences),
['retour_panier' => '',
'id_panier' => 0,
'id_catalogue' => 0]));
}
return $this->view->url($options);
......
......@@ -28,25 +28,7 @@ abstract class ZendAfi_View_Helper_Accueil_KiosqueMurTestCase extends ViewHelper
defineConstant("PATH_SKIN", "./public/opac/skins/original/");
$this->_helper = new ZendAfi_View_Helper_Accueil_Kiosque(3, $this->getPreferences());
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
}
public function getPreferences() {
return ['type_module' => 'KIOSQUE',
'division' => 3,
'preferences' => array_merge(['style_liste' => 'mur'],
$this->getExtraPreferences())];
}
abstract public function getExtraPreferences();
}
class ZendAfi_View_Helper_Accueil_KiosqueMurWithCatalogueTest extends ZendAfi_View_Helper_Accueil_KiosqueMurTestCase {
public function setUp() {
parent::setUp();
$notices = [Class_Notice::newInstanceWithId(2,
['unimarc' => "00627nam0 22002291 450 00100080000001000180000802100070002610000410003310100130007410500390008720000690012621000360019521500290023122500230026067600060028368600100028970000290029983000270032883500060035593000140036193200220037500028922 a2-07-052818-9 aFR a20010130 d 0frea01 ba1 afreceng 1[2001-01-30-00.00.00.000000][][][]1 aHarry Potter et le prisonnier d'AzkabanfJoanne Kathleen Rowling aPariscGallimard jeunessed2000 a465 p.3465cill.d18 cm 2aFolio juniorv1006 10 aR ROW1 aRowlingbJoanne Kathleen 1A32A partir de 10 ans aJ aRomans4R aSorcier-Sorcière",
......@@ -73,6 +55,21 @@ class ZendAfi_View_Helper_Accueil_KiosqueMurWithCatalogueTest extends ZendAfi_Vi
}
public function getPreferences() {
return ['type_module' => 'KIOSQUE',
'division' => 3,
'preferences' => array_merge(['style_liste' => 'mur'],
$this->getExtraPreferences())];
}
abstract public function getExtraPreferences();
}
class ZendAfi_View_Helper_Accueil_KiosqueMurWithCatalogueTest extends ZendAfi_View_Helper_Accueil_KiosqueMurTestCase {
public function getExtraPreferences() {
return ['id_catalogue' => 12];
}
......@@ -96,4 +93,30 @@ class ZendAfi_View_Helper_Accueil_KiosqueMurWithCatalogueTest extends ZendAfi_Vi
}
class ZendAfi_View_Helper_Accueil_KiosqueMurWithPanierTest extends ZendAfi_View_Helper_Accueil_KiosqueMurTestCase {
public function getExtraPreferences() {
return ['id_panier' => 15];
}
/** @test */
public function firstNoticeTitleShouldLinkToNotice2WithIdPanier15() {
$this->assertXPath($this->_html,
'//div[@class="notice"]//span/a[contains(@href, "recherche/viewnotice/clef/POTTER/id/2/id_panier/15")]',
$this->_html);
}
/** @test */
public function firstNoticeImgShouldLinkToNotice2WithIdPanier15() {
$this->assertXPath($this->_html,
'//div[@class="notice"]//a[contains(@href, "recherche/viewnotice/clef/POTTER/id/2/id_panier/15")]//img',
$this->_html);
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment