diff --git a/VERSIONS_HOTLINE/52240 b/VERSIONS_HOTLINE/52240 new file mode 100644 index 0000000000000000000000000000000000000000..02672069511b26faefc7a598b152d145792f3d8f --- /dev/null +++ b/VERSIONS_HOTLINE/52240 @@ -0,0 +1 @@ + - ticket #52240 : Les permaliens des albums ressources numeriques utilisent maintenant l'id de l'album \ No newline at end of file diff --git a/library/Class/Album.php b/library/Class/Album.php index 0af50ac1d16e162f11c0cfc0187d0f5c20be8f5c..d7689ba4414ef569c818c554cbd5db7cd99a2bbe 100644 --- a/library/Class/Album.php +++ b/library/Class/Album.php @@ -270,16 +270,10 @@ class Class_Album extends Storm_Model_Abstract { * @return array */ public function getPermalink() { - $permalink = ['module' => 'opac', 'controller' => 'bib-numerique', - 'action' => 'notice']; - - if ($this->hasIdOrigine()) - $permalink['ido'] = $this->getIdOrigine(); - else - $permalink['id'] = $this->getId(); - + 'action' => 'notice', + 'id' => $this->getId()]; return $permalink; } diff --git a/tests/application/modules/admin/controllers/AlbumControllerTest.php b/tests/application/modules/admin/controllers/AlbumControllerTest.php index 87b9f9245bfdec11d3987c52d0c91815f318bfcc..3a1daacfe248ade0b8b873b8f7df1defb9b0c2e8 100644 --- a/tests/application/modules/admin/controllers/AlbumControllerTest.php +++ b/tests/application/modules/admin/controllers/AlbumControllerTest.php @@ -1281,7 +1281,7 @@ class Admin_AlbumControllerEditAlbumMesBDPostFrbrModifyTest extends Admin_AlbumC /** @test */ public function shouldHaveOnlyOneFrbrLink() { - $this->assertEquals(1, Class_FRBR_Link::countBy(['target' => ROOT_URL . BASE_URL .'/bib-numerique/notice/id/43/ido/DC023'])); + $this->assertEquals(1, Class_FRBR_Link::countBy(['target' => ROOT_URL . BASE_URL .'/bib-numerique/notice/id/43'])); } @@ -1321,13 +1321,13 @@ class Admin_AlbumControllerEditAlbumMesBDTest extends Admin_AlbumControllerEditA /** @test */ public function permalienShoulBeVisible() { - $this->assertXPath('//input[@value="http://localhost'.BASE_URL.'/bib-numerique/notice/ido/DC023"]'); + $this->assertXPath('//input[@value="http://localhost'.BASE_URL.'/bib-numerique/notice/id/43"]'); } /** @test */ public function permalienVignetteShoulBeVisible() { - $this->assertXPath('//input[@value="http://localhost'.BASE_URL.'/bib-numerique/notice-thumbnail/ido/DC023"]'); + $this->assertXPath('//input[@value="http://localhost'.BASE_URL.'/bib-numerique/notice-thumbnail/id/43"]'); } @@ -2191,11 +2191,13 @@ class Admin_AlbumControllerAlbumHarlockEditRessourceTwoActionTest extends Admin_ /** @test */ public function permalienShoulBeVisible() { - $this->assertXPath('//input[@value="http://localhost'.BASE_URL.'/bib-numerique/notice/ido/HL22/folio/4R"]'); + $this->assertXPath('//input[@value="http://localhost'.BASE_URL.'/bib-numerique/notice/id/999/folio/4R"]'); } } + + class Admin_AlbumControllerAlbumHarlockEditOtherRessourcesActionTest extends Admin_AlbumControllerAlbumHarlockTestCase { /** @test */ function ressourceTwoInputLinkToShouldBeEmpty() { diff --git a/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php b/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php index 1655059bdb9e0dc2b995bce433838f6ec3074d89..6a643ea559f39ca00cd6bfdf9cb1f86b82b608c6 100644 --- a/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php +++ b/tests/application/modules/opac/controllers/BibNumeriqueControllerTest.php @@ -770,7 +770,7 @@ class BibNumeriqueControllerAlbumMultiMediasRSSTest extends BibNumeriqueControll /** @test */ public function itunesImageShouldBeNoticeThumbnail() { $this->_xpath->assertXPath($this->_response->getBody(), - '//channel/itunes:image[@href="http://localhost'.BASE_URL.'/bib-numerique/notice-thumbnail/ido/A888"]'); + '//channel/itunes:image[@href="http://localhost'.BASE_URL.'/bib-numerique/notice-thumbnail/id/999"]'); } @@ -791,10 +791,10 @@ class BibNumeriqueControllerAlbumMultiMediasRSSTest extends BibNumeriqueControll /** @test */ - public function linkShouldBeBibNumeriqueNoticeIdoA888() { + public function linkShouldBeBibNumeriqueNoticeId999() { $this->_xpath->assertXPathContentContains($this->_response->getBody(), '//channel/link', - 'http://localhost'.BASE_URL.'/bib-numerique/notice/ido/A888'); + 'http://localhost'.BASE_URL.'/bib-numerique/notice/id/999'); } @@ -914,7 +914,7 @@ class BibNumeriqueControllerPlayRessourceTest extends BibNumeriqueControllerAlbu */ public function forRessourceFiveAnalyticsTrackerShouldHaveReceivedPlayEvent($client) { $this->assertEquals(['bib-numerique', - 'lecture', '"titre: Hunger Games","album: Plein de medias","auteur: Suzanne Collins","editeur: Gallimard","publication: 2001","piste: 3","droits: CC-BY-SA","source: http://localhost'.BASE_URL.'/bib-numerique/notice/id/5.mp3/ido/A888/folio/5"', + 'lecture', '"titre: Hunger Games","album: Plein de medias","auteur: Suzanne Collins","editeur: Gallimard","publication: 2001","piste: 3","droits: CC-BY-SA","source: http://localhost'.BASE_URL.'/bib-numerique/notice/id/999/folio/5"', 5], $client->getAttributesForLastCallOn('trackEvent')); } @@ -934,7 +934,7 @@ class BibNumeriqueControllerPlayRessourceTest extends BibNumeriqueControllerAlbu $this->dispatch('/opac/bib-numerique/play-ressource/id/8.mp3', true); $this->assertEquals(['bib-numerique', 'lecture', - '"titre: Iron Maiden: \"Moonchild\" live","album: Plein de medias","auteur: Suzanne Collins","editeur: Gallimard","publication: 2001","piste: 6","droits: CC-BY-SA","source: http://localhost'.BASE_URL.'/bib-numerique/notice/id/8.mp3/ido/A888/folio/moonchild"', + '"titre: Iron Maiden: \"Moonchild\" live","album: Plein de medias","auteur: Suzanne Collins","editeur: Gallimard","publication: 2001","piste: 6","droits: CC-BY-SA","source: http://localhost'.BASE_URL.'/bib-numerique/notice/id/999/folio/moonchild"', 8], $this->_web_analytics_client->getAttributesForLastCallOn('trackEvent')); } diff --git a/tests/library/Class/AlbumTest.php b/tests/library/Class/AlbumTest.php index 3458e178d1932304d34adabeceeceef3faa744b8..2e51b111cbed1b2112d2d604043b4d9d231f4570 100644 --- a/tests/library/Class/AlbumTest.php +++ b/tests/library/Class/AlbumTest.php @@ -107,12 +107,11 @@ class AlbumHarlockBasicTest extends AlbumHarlockTestCase { /** @test */ - public function withIdOrigine_05DC03_PermalinkShouldBeBibNumNoticeIDO_05DC03() { - $this->_album->setIdOrigine('05DC03'); + public function permalinkShouldBeBibNumNoticeID999() { $this->assertEquals(array('module' => 'opac', 'controller' => 'bib-numerique', 'action' => 'notice', - 'ido' => '05DC03'), + 'id' => 999), $this->_album->getPermalink()); }