Skip to content
Snippets Groups Projects
Commit 87ff061c authored by lbrun's avatar lbrun
Browse files

hotline #29569 order bib into select SuggestionAchat and tests

parent efae7fe7
Branches
Tags
2 merge requests!1120Master,!1110Hotline#29569 portail
- ticket #29569 : Classement des médiathèques de l'onglet bibliothèque dans l'orde alphabétique : Suggestion d'achat
\ No newline at end of file
......@@ -60,7 +60,7 @@ class BibLoader extends Storm_Model_Loader {
}
public function getUserFriendlyBibs() {
$all_bibs = Class_Bib::getLoader()->findAll();
$all_bibs = Class_Bib::getLoader()->findAllBy(['order' => 'libelle']);
$bibs_as_array = [];
foreach($all_bibs as $bib) {
$bibs_as_array[$bib->getId()] = $bib->getLibelle();
......
......@@ -532,4 +532,39 @@ class AbonneControllerSuggestionAchatWithOneSuggestionTest extends AbstractContr
$this->assertXPathContentContains('//dl//dd', 'DVD');
}
}
class AbonneControllerSuggestionAchatBibSelectOrderTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_Bib', ['id' => 11, 'libelle' => 'Test']);
$this->fixture('Class_Bib', ['id' => 12, 'libelle' => 'Mer']);
$this->fixture('Class_Bib', ['id' => 13, 'libelle' => 'Agence']);
$this->fixture('Class_Bib', ['id' => 14, 'libelle' => 'Plage']);
$this->dispatch('abonne/suggestion-achat-add', true);
}
/** @test */
public function BibSelectShouldBeAgence() {
$this->assertXPath('//form//select[@name="bib_id"]//option[2][@value="13"]');
}
/** @test */
public function BibSelectShouldBeMer() {
$this->assertXPath('//form//select[@name="bib_id"]//option[3][@value="12"]');
}
/** @test */
public function BibSelectShouldBePlage() {
$this->assertXPath('//form//select[@name="bib_id"]//option[4][@value="14"]');
}
/** @test */
public function BibSelectShouldBeTest() {
$this->assertXPath('//form//select[@name="bib_id"]//option[5][@value="11"]');
}
}
?>
\ No newline at end of file
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