diff --git a/library/Class/AlbumRessource.php b/library/Class/AlbumRessource.php index 158c1d12a3193e06f2ff155149b0c398813de45a..43a3fcf823a960afd8c78ffde5d66c595b1119ed 100644 --- a/library/Class/AlbumRessource.php +++ b/library/Class/AlbumRessource.php @@ -74,7 +74,9 @@ class Class_AlbumRessource extends Storm_Model_Abstract { 'description' => '', 'ordre' => 0, 'link_to' => '', - 'matiere' => '' + 'matiere' => '', + 'vignette' => '', + 'url' => '' ); /** @@ -509,6 +511,9 @@ class Class_AlbumRessource extends Storm_Model_Abstract { * @return string */ public function getOriginalUrl() { + if ($this->hasUrl()) + return $this->getUrl(); + return $this->getLocatedFile($this->getOriginalsUrl()); } diff --git a/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php b/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php index b3fd6da7d5d9f134f91fdfcf869b162aace26971..2a9ba1ee4275ac220977ec664f69638e51b770fe 100644 --- a/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php +++ b/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php @@ -517,7 +517,13 @@ class BibNumeriqueControllerAlbumMultiMediasTest extends AbstractControllerTestC Class_AlbumRessource::newInstanceWithId(4) ->setFichier('dark_night.mp4') ->setTitre('Batman Dark Knight') - ->setVignette('batman.jpg')]); + ->setVignette('batman.jpg'), + + + Class_AlbumRessource::newInstanceWithId(4) + ->setUrl('http://progressive.totaleclips.com.edgesuite.net/107/e107950_227.mp4') + ->setTitre('Hunger Games') + ->setVignette('hunger.jpg')]); $this->dispatch('/opac/bib-numerique/album-xspf-playlist/id/999.xml', true); } @@ -565,6 +571,15 @@ class BibNumeriqueControllerAlbumMultiMediasTest extends AbstractControllerTestC '//xspf:playlist/xspf:trackList/xspf:track/xspf:title', 'Batman Dark Knight'); } + + + /** @test */ + public function thirsTrackLocationShouldBeTotaleClipsDotCom() { + $this->_xpath->assertXPathContentContains($this->_response->getBody(), + '//xspf:playlist/xspf:trackList/xspf:track/xspf:location', + 'http://progressive.totaleclips.com.edgesuite.net/107/e107950_227.mp4'); + } + } ?> \ No newline at end of file