From 22031be1f3a006481a9b429ae77bfd76bc2e69c0 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki <arthur.suzuki@biblibre.com> Date: Wed, 11 May 2022 15:24:58 +0200 Subject: [PATCH] hotline#156974 : fix return type in createDomainElement (View.php) --- VERSIONS_HOTLINE/156974 | 1 + .../Intonation/Library/Widget/Search/View.php | 2 +- .../Templates/TemplatesSearchTest.php | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 VERSIONS_HOTLINE/156974 diff --git a/VERSIONS_HOTLINE/156974 b/VERSIONS_HOTLINE/156974 new file mode 100644 index 00000000000..27f5b6f039a --- /dev/null +++ b/VERSIONS_HOTLINE/156974 @@ -0,0 +1 @@ + - correctif #156974 : Magasin de Thèmes : Correctif dans la fonction de selection d'un domaine de recherche. \ No newline at end of file diff --git a/library/templates/Intonation/Library/Widget/Search/View.php b/library/templates/Intonation/Library/Widget/Search/View.php index f13dc2d7a98..d31fc0b86bd 100644 --- a/library/templates/Intonation/Library/Widget/Search/View.php +++ b/library/templates/Intonation/Library/Widget/Search/View.php @@ -370,7 +370,7 @@ abstract class IntonationSearchRenderAbstract { } - protected function _createDomainElement() : ?ZendAfi_Form { + protected function _createDomainElement() : ?Zend_Form_Element { if (!$domain_ids = trim($this->_settings->getDomainIds())) return null; diff --git a/tests/scenarios/Templates/TemplatesSearchTest.php b/tests/scenarios/Templates/TemplatesSearchTest.php index 1910d9cd070..eda30b9a836 100644 --- a/tests/scenarios/Templates/TemplatesSearchTest.php +++ b/tests/scenarios/Templates/TemplatesSearchTest.php @@ -1328,4 +1328,34 @@ class TemplatesSearchSearchSubmitButtonTest extends Admin_AbstractControllerTes $this->assertXPath($xpath); } +} + + + + +class TemplatesSearchWithDomainIdsSettingsFromIndexPageTest extends Admin_AbstractControllerTestCase { + public function setUp() { + parent::setUp(); + $this->_buildTemplateProfil(['id' => 1, + 'libelle' => 'My search page']) + ->setBoiteOfTypeInDivision(1, + Intonation_Library_Widget_Search_Definition::CODE, + ['tri' => Class_CriteresRecherche::SORT_NOVELTY_DESC, + 'search_button' => 'Recherche simple', + 'placeholder' => 'Pomme, poire', + 'domain_ids' => '2-g3-4']); + + $this->dispatch('/'); + } + + /** @test */ + public function pageShouldContainsSearchWidget() { + $this->assertXPath('//div[contains(@class, "boite rech_simple")]'); + } + + + /** @test */ + public function expressionRecherchePlaceHolderShouldBePommePoire() { + $this->assertXPath('//input[@name="expressionRecherche"][@placeholder="Pomme, poire"]'); + } } \ No newline at end of file -- GitLab