diff --git a/VERSIONS_HOTLINE/31237 b/VERSIONS_HOTLINE/31237 new file mode 100644 index 0000000000000000000000000000000000000000..200ba773a8ab7b78520529741ca74323b8cc91f3 --- /dev/null +++ b/VERSIONS_HOTLINE/31237 @@ -0,0 +1 @@ + - ticket #31237 : Correction de l'affichage de la langue dans un détail notice \ No newline at end of file diff --git a/library/Class/Notice.php b/library/Class/Notice.php index bd76d4bc4351c23e774891f0b44ea747eaf2ecee..6b2449a6635e1fb3de52ca61bb5243bc6f3d2601 100644 --- a/library/Class/Notice.php +++ b/library/Class/Notice.php @@ -686,6 +686,7 @@ class Class_Notice extends Storm_Model_Abstract { case Class_Codification::CODE_URL: return $this->getUrls(); case Class_Codification::CODE_ANNEE: return $this->getAnnee(); case Class_Codification::CODE_PRIX: return $this->getPrix(); + case Class_CodifLangue::CODE_FACETTE: return $this->getLangues(); case Class_Codification::CODE_IDENTIFIANT: return (new Class_Isbn($this->getIsbnOrEan()))->getAll()['isbn10']; case Class_Codification::CODE_NOUVEAUTE: return $this->isNouveaute() ? $this->_('Oui'): $this->_('Non'); } diff --git a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php index 71713966f8dec1e6cbdfe54f38a902e3574410ac..4ddcb1d302c4e0d7eaf9e29fc20204e51a09c2c8 100644 --- a/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php +++ b/tests/application/modules/opac/controllers/NoticeAjaxControllerTest.php @@ -60,7 +60,8 @@ class NoticeAjaxControllerNonRegressionTest extends AbstractControllerTestCase { -class NoticeAjaxControllerNoticeWithGamUrlTestCase extends AbstractControllerTestCase { + +class NoticeAjaxControllerDetailNoticeWithGamUrlTestCase extends AbstractControllerTestCase { protected $_wesley; @@ -91,21 +92,34 @@ class NoticeAjaxControllerNoticeWithGamUrlTestCase extends AbstractControllerTes $this->fixture('Class_CosmoVar', ['id' => 'types_docs', 'liste' => "1:cd\r\n200:non identifié\r\n201:livres\r\n202:bd"]); + $this->dispatch('/opac/noticeajax/detail/id_notice/1', true); } /** @test */ public function withNoticeFoundResponseShouldContainsLienInternet() { - $this->dispatch('/opac/noticeajax/detail/id_notice/1', true); $this->assertXPathContentContains('//a', 'http://www.gamannecy.com//upload/albums/201202/0602527840871_thumb.jpg', $this->_response->getBody()); } -} + /** @test */ + public function ddForYearShouldContains() { + $this->assertXPathContentContains('//dd[preceding-sibling::dt[contains(text(),"Ann")]]', + '2000'); + } -class NoticeAjaxControllerNoticeWithCustomLinks extends AbstractControllerTestCase { + + /** @test */ + public function ddForLanguageShouldContainsAnglais() { + $this->assertXPathContentContains('//dd[preceding-sibling::dt[contains(text(),"Langue(s)")]]', + 'anglais'); + } +} + + +class NoticeAjaxControllerNoticeWithCustomLinks extends AbstractControllerTestCase { public function setUp() { parent::setUp();