From 5b47c2d3867b35c2b17ceaffcf0f77a7d8176764 Mon Sep 17 00:00:00 2001 From: Alex Arnaud <alex.arnaud@biblibre.com> Date: Tue, 21 Jul 2015 11:02:04 +0200 Subject: [PATCH] hotline #15721 : add test --- .../View/Helper/Accueil/BibNumerique.php | 1 - .../View/Helper/Accueil/BibNumeriqueTest.php | 41 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/library/ZendAfi/View/Helper/Accueil/BibNumerique.php b/library/ZendAfi/View/Helper/Accueil/BibNumerique.php index 0f138621c24..3698e83803e 100644 --- a/library/ZendAfi/View/Helper/Accueil/BibNumerique.php +++ b/library/ZendAfi/View/Helper/Accueil/BibNumerique.php @@ -33,7 +33,6 @@ class ZendAfi_View_Helper_Accueil_BibNumerique extends ZendAfi_View_Helper_Accue if ($album->getImages()) return false; $html=$this->view->renderAlbum($album); - $html .= $this->view->recordAlbums($album->getNotice()); return $html; } diff --git a/tests/library/ZendAfi/View/Helper/Accueil/BibNumeriqueTest.php b/tests/library/ZendAfi/View/Helper/Accueil/BibNumeriqueTest.php index 789d3cbed72..a3fda703ad0 100644 --- a/tests/library/ZendAfi/View/Helper/Accueil/BibNumeriqueTest.php +++ b/tests/library/ZendAfi/View/Helper/Accueil/BibNumeriqueTest.php @@ -611,6 +611,47 @@ class BibNumeriqueAlbumHarlockAsListeTest extends AbstractBibNumeriqueViewHelper + +class BibNumeriqueAlbumWithMp3RessourcesTest extends BibNumeriqueViewCollectionTestCase { + protected $html; + public function setUp() { + parent::setUp(); + + $album = Class_Album::find(1); + $album->setTypeDocId(Class_TypeDoc::AUDIO_RECORD)->save(); + + $ressource1 = $this->fixture('Class_AlbumRessource', ['id' => 1, + 'titre' => 'Cartes', + 'fichier' => 'cartes.mp3']); + + $preferences = array('boite' => '', + 'titre' => 'Harlock', + 'id_categories' => '', + 'id_albums' => '1', + 'nb_aff' => 2, + 'op_largeur_img' => 150, + 'op_hauteur_img' => 150, + 'type_aff' => Class_Systeme_ModulesAccueil_BibliothequeNumerique::DISPLAY_ALBUM_TEASER, + 'style_liste' => 'none'); + + $album->setRessource([$ressource1->setAlbum($album)]); + $helper = new ZendAfi_View_Helper_Accueil_BibNumerique(12, ['division' => 1, + 'type_module' => 'BIB_NUMERIQUE', + 'preferences' => $preferences]); + + $helper->setView(new ZendAfi_Controller_Action_Helper_View()); + $this->html = $helper->getBoite(); + } + + + /** @test */ + public function audioPlayerShouldBeDisplayeOnBibNumericBox() { + $this->assertXpath($this->html, '//audio[@preload="preload"]', $this->html); + } +} + + + class BibNumeriqueFixture { /** @return array */ public static function createOneCategorieTreePreference() { -- GitLab