From 9403c1881e530a429a332d2dc4913319087df930 Mon Sep 17 00:00:00 2001
From: lbrun <leo@sandbox.pergame.net>
Date: Fri, 26 Feb 2016 16:31:49 +0100
Subject: [PATCH] dev#37281 : fix tests

---
 .../modules/admin/controllers/BibnumController.php        | 5 ++---
 library/Class/AlbumCategorie.php                          | 8 ++++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/application/modules/admin/controllers/BibnumController.php b/application/modules/admin/controllers/BibnumController.php
index 90821b401bc..d86a9af78a5 100644
--- a/application/modules/admin/controllers/BibnumController.php
+++ b/application/modules/admin/controllers/BibnumController.php
@@ -32,9 +32,8 @@ class Admin_BibnumController extends ZendAfi_Controller_Action {
       ->setAlbums(Class_Album::findAllBy(['cat_id' => 0]));
 
     $albums = [];
-    foreach ($categories as $category) {
-      $albums[] = $category->toArray();
-    }
+    foreach ($categories as $category)
+      $albums[] = $category->getInfosForTree();
 
     $bib = Class_Bib::getPortail();
 
diff --git a/library/Class/AlbumCategorie.php b/library/Class/AlbumCategorie.php
index ac9554c0c20..953d6fad923 100644
--- a/library/Class/AlbumCategorie.php
+++ b/library/Class/AlbumCategorie.php
@@ -244,22 +244,22 @@ class Class_AlbumCategorie extends Storm_Model_Abstract {
   }
 
 
-  public function albumsToArray($albums) {
+  public function getAlbumsInfosForTree($albums) {
 
     $albums_array = [];
     foreach ($albums as $album) {
-      $albums_array []= $album->toArray();
+      $albums_array []= $album->getInfosForTree();
     }
 
     return $albums_array;
   }
 
 
-  public function toArray() {
+  public function getInfoForTree() {
     return
       ['id' => $this->getId(),
        'label' => htmlspecialchars($this->getLibelle()),
-       'categories' => $this->albumsToArray($this->getSousCategories()),
+       'categories' => $this->getAlbumsInfosForTree($this->getSousCategories()),
        'items' => []];
   }
 }
\ No newline at end of file
-- 
GitLab