diff --git a/VERSIONS_HOTLINE/141438 b/VERSIONS_HOTLINE/141438 new file mode 100644 index 0000000000000000000000000000000000000000..592c1b47863c8e925e9cbded94d8bfc7cbfb24fc --- /dev/null +++ b/VERSIONS_HOTLINE/141438 @@ -0,0 +1 @@ + - ticket #141438 : Magasin de thèmes : Correction du bouton d'export des paniers au format unimarc ou liste \ No newline at end of file diff --git a/library/ZendAfi/Controller/Plugin/Abstract.php b/library/ZendAfi/Controller/Plugin/Abstract.php index 5f98c568cd7133be5f11930fc7a5f6796270a79b..f8f983d9de7ed088f1bdc6d5b8e547348763e444 100644 --- a/library/ZendAfi/Controller/Plugin/Abstract.php +++ b/library/ZendAfi/Controller/Plugin/Abstract.php @@ -275,4 +275,9 @@ abstract class ZendAfi_Controller_Plugin_Abstract { public function isPopupRequest() { return $this->_controller->isPopupRequest(); } + + + public function getViewRenderer() { + return $this->_controller->getHelper('ViewRenderer'); + } } diff --git a/library/ZendAfi/Controller/Plugin/Template/Borrower.php b/library/ZendAfi/Controller/Plugin/Template/Borrower.php index 9fb454de5b34added37f8db751949f597ce18926..5dd8c72f99defc2d5c9796859ec8045ad40a4e58 100644 --- a/library/ZendAfi/Controller/Plugin/Template/Borrower.php +++ b/library/ZendAfi/Controller/Plugin/Template/Borrower.php @@ -79,17 +79,17 @@ class ZendAfi_Controller_Plugin_Template_Borrower extends ZendAfi_Controller_Plu : Class_PanierNotice::findFirstBy(['id_user' => $this->_user->getId(), 'libelle' => $this->_getParam('selection_label')])); if (!$selection) { - $this->getHelper('ViewRenderer')->setNoRender(); + $this->getViewRenderer()->setNoRender(); return $this->_response->setHttpResponseCode(520); } if (!$selection->canBeEditedByMe()) { - $this->getHelper('ViewRenderer')->setNoRender(); + $this->getViewRenderer()->setNoRender(); return $this->_response->setHttpResponseCode(520); } if (!$record = Class_Notice::find($this->_getParam('record_id'))) { - $this->getHelper('ViewRenderer')->setNoRender(); + $this->getViewRenderer()->setNoRender(); return $this->_response->setHttpResponseCode(520); } @@ -305,7 +305,7 @@ class ZendAfi_Controller_Plugin_Template_Borrower extends ZendAfi_Controller_Plu ? $this->_view->selection->toUnimarcIso2709() : $this->_view->selection->toTabbedList(); - $this->getHelper('ViewRenderer')->setNoRender(); + $this->getViewRenderer()->setNoRender(); $name = sprintf('%s_id_%s_%s', (new Class_TimeSource)->dateYmd(), @@ -432,4 +432,4 @@ class ZendAfi_Controller_Plugin_Template_Borrower extends ZendAfi_Controller_Plu $this->_helper->notify($this->_('Une erreur c\'est produite. Votre image de profil n\'a pas été modifiée.')); return $this->_redirectClose($this->_getReferer()); } -} \ No newline at end of file +} diff --git a/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php b/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php index 981b59de19a7a65d45e6489c6a069f41e678a4e8..2af23e416400aec6c241d5671f012c78329cfeb2 100644 --- a/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php +++ b/tests/scenarios/Templates/TemplatesAbonneSelectionsTest.php @@ -47,7 +47,6 @@ abstract class TemplatesAbonneSelectionsTestCase extends TemplatesIntonationTest $mes_bd = $this->fixture('Class_PanierNotice', ['id' => 2, - 'id_panier' => 1, 'libelle' => 'Mes BD', 'date_maj' => '10/02/2011', 'notices' => 'COMBAT ORDINAIRE;BLACKSAD', @@ -361,12 +360,53 @@ class TemplatesAbonneSelectionsRenommerLaSelectionTest extends TemplatesAbonneSe -class TemplatesAbonneSelectionsExporterLaSelectionTest extends TemplatesAbonneSelectionsTestCase { +class TemplatesAbonneSelectionsExporterLaSelectionTest + extends TemplatesAbonneSelectionsTestCase { + + public function setUp() { + parent::setUp(); + + $this->fixture(Class_Notice::class, + ['id' => 56, + 'clef_alpha' => 'COMBAT ORDINAIRE']) + ->set_subfield('200', 'f', 'J K Rowling'); + $this->fixture(Class_Notice::class, + ['id' => 57, + 'clef_alpha' => 'BLACKSAD']) + ->set_subfield('200', 'f', 'George RR Martin'); + } + + /** @test */ public function buttonUnimarcShoulbBePresent() { $this->dispatch('/opac/abonne/exporter-la-selection/selection_id/2/id_profil/72'); $this->assertXPathContentContains('//div', 'UNIMARC'); } + + + /* hotline: #141438 */ + /** @test */ + public function formatUnimarcShouldContainsExpectedUnimarc() { + $this->dispatch('/opac/abonne/exporter-la-selection/selection_id/2/id_profil/72/format/unimarc'); + $this->assertContains('00026nam0 22000251i 450 00026nam0 22000251i 450 ', + $this->_response->getBody()); + } + + + /* hotline: #141438 */ + /** @test */ + public function formatListShouldContainsExpectedAuthorJKRowling() { + $this->dispatch('/opac/abonne/exporter-la-selection/selection_id/2/id_profil/72/format/list'); + $this->assertContains('J K Rowling', $this->_response->getBody()); + } + + + /* hotline: #141438 */ + /** @test */ + public function formatListShouldContainsExpectedAuthorGeorgeRRMartin() { + $this->dispatch('/opac/abonne/exporter-la-selection/selection_id/2/id_profil/72/format/list'); + $this->assertContains('George RR Martin', $this->_response->getBody()); + } }