Commit fbb229d00633331c0a2e4133bd2877b41d09e20e
1 parent
baadb15d
Exists in
master
and in
1 other branch
Ajout gros test générique vue Materiels (/materiels/view) (v3.7.9.44)
- ca teste le CONTENU de la vue - bugfixes : ce test, plus status-to-be-archived => status-tobearchived, plus SurcategoriesController => SurCategoriesController
Showing
2 changed files
with
19 additions
and
6 deletions
Show diff stats
README.md
... | ... | @@ -53,8 +53,8 @@ Logiciel testé et validé sur les configurations suivantes : |
53 | 53 | |
54 | 54 | VERSION ACTUELLE |
55 | 55 | |
56 | -Date: 23/06/2020 | |
57 | -Version: 3.7.9.43 | |
56 | +Date: 25/06/2020 | |
57 | +Version: 3.7.9.44 | |
58 | 58 | Author: EP |
59 | 59 | Commentaire: |
60 | 60 | - 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 |
102 | 102 | |
103 | 103 | ----------------------------------------------------------------------------------------------------------- |
104 | 104 | |
105 | +25/06/2020 v3.7.9.43-44 (EP) | |
106 | + - 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 | |
107 | + - bugfixes : ce test, plus status-to-be-archived => status-tobearchived, plus SurcategoriesController => SurCategoriesController | |
108 | + - ... | |
109 | + | |
105 | 110 | 23/06/2020 v3.7.9.40-42 (EP) |
106 | 111 | - Nouvelle page qui affiche les messages de log PAR niveau (level info, debug, notice, error...) : disponible depuis la page Outils (/pages/logs) |
107 | 112 | - Toules les actions importantes (add,edit,delete, changement statut...) sont désormais loggées et donc affichables via la page Outils ci-dessus | ... | ... |
tests/TestCase/Controller/General.php
... | ... | @@ -142,10 +142,10 @@ class General extends TestCase { |
142 | 142 | |
143 | 143 | protected function getEntitiesName() { |
144 | 144 | //throw new NotImplementedException("Méthode getEntitiesName() non implémentée !!"); |
145 | - $test_class_name = get_class($this); | |
145 | + $test_class_name = get_class($this); // MaterielsControllerTest, SurCategoriesControllerTest, ... | |
146 | 146 | //debug($test_class_name); |
147 | 147 | $entities_name = explode('\\', substr($test_class_name,0,strpos($test_class_name, 'ControllerTest'))); |
148 | - //debug($entities_name); exit; | |
148 | + //debug($entities_name); | |
149 | 149 | return $entities_name[count($entities_name)-1]; |
150 | 150 | } |
151 | 151 | protected function getNbEntitiesInFixture() { |
... | ... | @@ -178,8 +178,11 @@ class General extends TestCase { |
178 | 178 | |
179 | 179 | protected function _getController() { |
180 | 180 | //if (!$this->controller_instance) $this->controller_instance = new MaterielsController(); |
181 | - $entities_name = $this->getEntitiesName(); // ex: 'Materiels', 'Suivis', ... | |
181 | + $entities_name = $this->getEntitiesName(); // ex: 'Materiels', 'Suivis', 'SurCategories'... | |
182 | + //$entities_name = 'SurCategories'; | |
183 | + //debug("entities_name is $entities_name"); | |
182 | 184 | $controller_name = $this->_getControllerFullNameFromEntitiesName($entities_name); |
185 | + //debug("controller_name is $controller_name"); exit; | |
183 | 186 | if (!$this->controller_instance) $this->controller_instance = new $controller_name(); |
184 | 187 | return $this->controller_instance; |
185 | 188 | } |
... | ... | @@ -188,8 +191,13 @@ class General extends TestCase { |
188 | 191 | $controller_name = self::_getControllerFullNameFromEntitiesName($entities_name); |
189 | 192 | return new $controller_name(); |
190 | 193 | } |
194 | + /* | |
195 | + * $entities_name is 'Materiels', 'Suivis', 'SurCategories'... | |
196 | + * @return : App\Controller\SurCategoriesController, ... | |
197 | + */ | |
191 | 198 | private static function _getControllerFullNameFromEntitiesName($entities_name) { |
192 | - $entities_name = ucfirst(strtolower($entities_name)); // Materiels, Suivis, Emprunts... | |
199 | + //$entities_name = ucfirst(strtolower($entities_name)); // Materiels, Suivis, Emprunts... | |
200 | + //$entities_name = ucfirst(strtolower($entities_name)); // Materiels, Suivis, Emprunts... | |
193 | 201 | //$controller_name = 'App\\Controller\\'.$this->getEntitiesName().'Controller'; // ex: 'Materiels' ou 'Suivis'... |
194 | 202 | return 'App\\Controller\\'.$entities_name.'Controller'; // ex: 'MaterielsController' ou 'SuivisController'... |
195 | 203 | //$controller_name = 'App\\Controller\\'.$this->getEntitiesName().'Controller'; // ex: 'Materiels' ou 'Suivis'... | ... | ... |