Skip to content
Snippets Groups Projects
Commit ec087702 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge branch 'hotline#29569_portail' into 'stable'

Hotline#29569 portail

See merge request !1110
parents efae7fe7 87ff061c
Branches
Tags
1 merge request!1120Master
- 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