diff --git a/.gitattributes b/.gitattributes index e487e1d2125fd44d08a8561ed9314610778280e5..66b358533118733d7b0dc0d0c79829db2a2431dd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4151,6 +4151,7 @@ tests/application/modules/admin/controllers/AdminAuthControllerTest.php -text tests/application/modules/admin/controllers/AdminAvisModerationControllerTest.php -text tests/application/modules/admin/controllers/AdminControllerTest.php -text tests/application/modules/admin/controllers/AdminIndexControllerTest.php -text +tests/application/modules/admin/controllers/AlbumControllerEPubTest.php -text tests/application/modules/admin/controllers/AlbumControllerPharoVideosTest.php -text tests/application/modules/admin/controllers/AlbumControllerTest.php -text tests/application/modules/admin/controllers/AlbumControllerVideoAndAudioTest.php -text diff --git a/library/ZendAfi/View/Helper/TagAlbumMediaList.php b/library/ZendAfi/View/Helper/TagAlbumMediaList.php index aa1315c781270618a1ddd356773d556251e4e99e..783275f2f5ff3f1fa366dd209b55e1b35b6c6b25 100644 --- a/library/ZendAfi/View/Helper/TagAlbumMediaList.php +++ b/library/ZendAfi/View/Helper/TagAlbumMediaList.php @@ -26,11 +26,12 @@ class ZendAfi_View_Helper_TagAlbumMediaList extends Zend_View_Helper_HtmlElement $ressources = $album->getRessources(); foreach($ressources as $ressource) { $html .= sprintf('<li>%s</li>', - $this->view->tagAnchor(array('controller' => 'bib-numerique', - 'action' => 'download-resource', - 'id' => $ressource->getId()), + $this->view->tagAnchor(['module' => 'opac', + 'controller' => 'bib-numerique', + 'action' => 'download-resource', + 'id' => $ressource->getId()], $this->view->albumRessourceInfos($ressource), - array('data-ajax' => 'false'))); + ['data-ajax' => 'false'])); } $html .= '</ul>'; diff --git a/tests/application/modules/admin/controllers/AlbumControllerEPubTest.php b/tests/application/modules/admin/controllers/AlbumControllerEPubTest.php new file mode 100644 index 0000000000000000000000000000000000000000..37653de5a57e628a2e0e5e9c5caf718a9edef304 --- /dev/null +++ b/tests/application/modules/admin/controllers/AlbumControllerEPubTest.php @@ -0,0 +1,49 @@ +<?php +/** + * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved. + * + * AFI-OPAC 2.0 is free software; you can redistribute it and/or modify + * it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by + * the Free Software Foundation. + * + * There are special exceptions to the terms and conditions of the AGPL as it + * is applied to this software (see README file). + * + * AFI-OPAC 2.0 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU AFFERO GENERAL PUBLIC LICENSE for more details. + * + * You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE + * along with AFI-OPAC 2.0; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +require_once 'AlbumControllerTest.php'; + +class Admin_AlbumControllerEPubTest extends Admin_AlbumControllerTestCase { + protected $_xpath; + + public function setUp() { + parent::setUp(); + + $album = Class_Album::newInstanceWithId(999) + ->beEPUB() + ->setTitre('Informatique') + ->setRessources([Class_AlbumRessource::newInstanceWithId(4) + ->setUrl('pragmatic_programmers.epub') + ->setTitre('Pragmatic Programmers') + ->setVignette('pragprog.jpg')]); + + $this->dispatch('/admin/album/preview_album/id/999', true); + } + + + /** @test */ + public function linkToDownloadEPubShouldBeModuleOPACBibNumDownload() { + $this->assertXpath('//a[@href="/bib-numerique/download-resource/id/4"]'); + } +} + + +?> \ No newline at end of file diff --git a/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php b/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php index 0ecaf077462b3c296172241272f9a201618f79d3..c3af23c667ca33311b7d2d11372de91a1e2e6b44 100644 --- a/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php +++ b/tests/library/ZendAfi/View/Helper/RenderAlbumTest.php @@ -63,7 +63,7 @@ class ZendAfi_View_Helper_RenderAlbumEPUBTest extends ZendAfi_View_Helper_Render /** @test */ public function pageShouldContainsLinkToDownloadEPUB() { $this->assertXPathContentContains($this->html, - '//a[contains(@href, "bib-numerique/download-resource/id/123")]', + '//a[contains(@href, "'.BASE_URL.'/bib-numerique/download-resource/id/123")]', 'versailles.epub'); } }