Commit 45822473 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #67188 fix liraries order in article form

parent ca9b41f5
- ticket #67188 : Administration : les bibliothèques sont triées par nom dans le sélecteur de catégorie du formulaire de modification des articles.
\ No newline at end of file
......@@ -34,7 +34,7 @@ class BibLoader extends Storm_Model_Loader {
protected $_portail;
public function findAllWithPortail() {
$all_bibs = Class_Bib::getLoader()->findAll();
$all_bibs = Class_Bib::findAllBy(['order' => 'libelle']);
array_unshift($all_bibs, $this->getPortail());
return $all_bibs;
}
......
......@@ -90,4 +90,27 @@ class BibTest extends Storm_Test_ModelTestCase {
}
?>
\ No newline at end of file
class BibFindAllWithPortailTest extends Storm_Test_ModelTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
$this->fixture('Class_Bib',
['id' => 1,
'libelle' => 'BBB']);
$this->fixture('Class_Bib',
['id' => 2,
'libelle' => 'AAA']);
}
/** @test */
public function bibBBBShouldBeLast() {
$this->assertEquals(1, Class_Bib::findAllWithPortail()[2]->getId());
}
}
\ No newline at end of file
Markdown is supported
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