Skip to content
Snippets Groups Projects
Commit 396bf529 authored by Matthias Meusburger's avatar Matthias Meusburger
Browse files

hotline#12905: Catalogue dynamique

 - Fix getListeSuggestion request and add test.
parent 8313a24c
Branches
Tags
6 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!63Rf13038,!56Rf13038 Front,!47Hotline 6.40,!45Hotline#12905 Catalogue Dynamique,!43Hotline#12905 Catalogue Dynamique
......@@ -166,7 +166,7 @@ class Class_CodifThesaurus extends Storm_Model_Abstract {
}
if($mode=="2")
$req="select id,libelle,id_origine from codif_thesaurus where id_thesaurus like '".$theme."%' and libelle like'".addslashes($recherche)."%' order by id_thesaurus limit ".$limite_resultat;
$req="select id,id_thesaurus,libelle,id_origine from codif_thesaurus where id_thesaurus like '".$theme."%' and libelle like'".addslashes($recherche)."%' order by id_thesaurus limit ".$limite_resultat;
if($mode=="3")
$req="select id,libelle,id_origine from codif_thesaurus where id_thesaurus like '".$theme."%' and libelle like'%".addslashes($recherche)."%' order by id_thesaurus limit ".$limite_resultat;
......
......@@ -45,19 +45,22 @@ class AjaxControllerThesaurusTest extends AbstractControllerTestCase {
$mock_sql = $this->mock();
$mock_sql
->whenCalled('fetchAll')
->with("select id,id_thesaurus,libelle,id_origine from codif_thesaurus where id_thesaurus like 'PUBL%' and libelle like'pirate%' order by id_thesaurus limit 100",
false)
->answers([
['id_thesaurus' => 1,
'id_origine' => 1,
'id' => 1]
]);
])
->beStrict();
Zend_Registry::set('sql', $mock_sql);
$this->fixture('Class_CodifThesaurus', ['id' => 1,
'id_origine' => 1,
'id_thesaurus' => 1,
'id_thesaurus' => 'PUBL',
'libelle' => 'pirate']);
$this->dispatch('/admin/ajax/listesuggestion/type_autorite/thesaurus/mode/2/valeur/1/id_champ/suggest', true);
$this->dispatch('/admin/ajax/listesuggestion/type_autorite/thesaurus/mode/2/valeur/pirate/id_champ/PUBL', true);
$this->assertXPathContentContains('//div[@class="tag_liste"][@clef="1"]', '1 : pirate', $this->_response->getBody());
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment