From fbb229d00633331c0a2e4133bd2877b41d09e20e Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Thu, 25 Jun 2020 09:57:28 +0200 Subject: [PATCH] Ajout gros test générique vue Materiels (/materiels/view) (v3.7.9.44) --- README.md | 9 +++++++-- tests/TestCase/Controller/General.php | 16 ++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ddd18d0..4f20d03 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ Logiciel testé et validé sur les configurations suivantes : VERSION ACTUELLE -Date: 23/06/2020 -Version: 3.7.9.43 +Date: 25/06/2020 +Version: 3.7.9.44 Author: EP Commentaire: - Ajout d'un gros test générique de la vue détaillée de Materiels (/materiels/view) qui teste le CONTENU de la vue @@ -102,6 +102,11 @@ La liste ci-dessous est aussi en ligne ici : https://tinyurl.com/labinvent#headi ----------------------------------------------------------------------------------------------------------- +25/06/2020 v3.7.9.43-44 (EP) + - Ajout d'un gros test générique de la vue détaillée de Materiels (/materiels/view) qui teste le CONTENU de la vue + - bugfixes : ce test, plus status-to-be-archived => status-tobearchived, plus SurcategoriesController => SurCategoriesController + - ... + 23/06/2020 v3.7.9.40-42 (EP) - Nouvelle page qui affiche les messages de log PAR niveau (level info, debug, notice, error...) : disponible depuis la page Outils (/pages/logs) - Toules les actions importantes (add,edit,delete, changement statut...) sont désormais loggées et donc affichables via la page Outils ci-dessus diff --git a/tests/TestCase/Controller/General.php b/tests/TestCase/Controller/General.php index 82066e2..99b1233 100644 --- a/tests/TestCase/Controller/General.php +++ b/tests/TestCase/Controller/General.php @@ -142,10 +142,10 @@ class General extends TestCase { protected function getEntitiesName() { //throw new NotImplementedException("Méthode getEntitiesName() non implémentée !!"); - $test_class_name = get_class($this); + $test_class_name = get_class($this); // MaterielsControllerTest, SurCategoriesControllerTest, ... //debug($test_class_name); $entities_name = explode('\\', substr($test_class_name,0,strpos($test_class_name, 'ControllerTest'))); - //debug($entities_name); exit; + //debug($entities_name); return $entities_name[count($entities_name)-1]; } protected function getNbEntitiesInFixture() { @@ -178,8 +178,11 @@ class General extends TestCase { protected function _getController() { //if (!$this->controller_instance) $this->controller_instance = new MaterielsController(); - $entities_name = $this->getEntitiesName(); // ex: 'Materiels', 'Suivis', ... + $entities_name = $this->getEntitiesName(); // ex: 'Materiels', 'Suivis', 'SurCategories'... + //$entities_name = 'SurCategories'; + //debug("entities_name is $entities_name"); $controller_name = $this->_getControllerFullNameFromEntitiesName($entities_name); + //debug("controller_name is $controller_name"); exit; if (!$this->controller_instance) $this->controller_instance = new $controller_name(); return $this->controller_instance; } @@ -188,8 +191,13 @@ class General extends TestCase { $controller_name = self::_getControllerFullNameFromEntitiesName($entities_name); return new $controller_name(); } + /* + * $entities_name is 'Materiels', 'Suivis', 'SurCategories'... + * @return : App\Controller\SurCategoriesController, ... + */ private static function _getControllerFullNameFromEntitiesName($entities_name) { - $entities_name = ucfirst(strtolower($entities_name)); // Materiels, Suivis, Emprunts... + //$entities_name = ucfirst(strtolower($entities_name)); // Materiels, Suivis, Emprunts... + //$entities_name = ucfirst(strtolower($entities_name)); // Materiels, Suivis, Emprunts... //$controller_name = 'App\\Controller\\'.$this->getEntitiesName().'Controller'; // ex: 'Materiels' ou 'Suivis'... return 'App\\Controller\\'.$entities_name.'Controller'; // ex: 'MaterielsController' ou 'SuivisController'... //$controller_name = 'App\\Controller\\'.$this->getEntitiesName().'Controller'; // ex: 'Materiels' ou 'Suivis'... -- libgit2 0.21.2