Commit 5d17273526c75ba27a6881fa3e5adf838336d4cd
1 parent
4b88a346
Exists in
master
and in
1 other branch
désactivé messages debug
Showing
2 changed files
with
16 additions
and
16 deletions
Show diff stats
tests/TestCase/Controller/General.php
... | ... | @@ -13,8 +13,8 @@ use Cake\ORM\TableRegistry; |
13 | 13 | class General extends IntegrationTestCase { |
14 | 14 | |
15 | 15 | // Si DEBUG, affiche plus d'infos |
16 | - protected $DEBUG=true; | |
17 | - //protected $DEBUG=false; | |
16 | + //protected $DEBUG=true; | |
17 | + protected $DEBUG=false; | |
18 | 18 | |
19 | 19 | |
20 | 20 | //TODO: definine this in a superclass | ... | ... |
tests/TestCase/Controller/MaterielsControllerTest.php
... | ... | @@ -2091,19 +2091,19 @@ class MaterielsControllerTest extends General { |
2091 | 2091 | */ |
2092 | 2092 | // 1) ACCÈS AUTORISÉ |
2093 | 2093 | if ($access_condition===0) { |
2094 | - debug("is 0"); | |
2094 | + $this->d("is 0"); | |
2095 | 2095 | $this->_testExecActionForId($action,$id,true); |
2096 | 2096 | } |
2097 | 2097 | // 2) ACCÈS REFUSÉ |
2098 | 2098 | elseif ($access_condition===-1) { |
2099 | - debug("is -1"); | |
2099 | + $this->d("is -1"); | |
2100 | 2100 | $this->_testExecActionForId($action,$id,false); |
2101 | 2101 | } |
2102 | 2102 | // 3) ACCÈS AUTORISÉ SOUS CONDITION |
2103 | 2103 | // ATTENTION : toujours tester le cas où ca marche (AUTORISÉ) en dernier |
2104 | 2104 | // Utile pour des actions telles que 'delete' !!! |
2105 | 2105 | elseif (is_array($access_condition)) { |
2106 | - debug("is array"); | |
2106 | + $this->d("is array"); | |
2107 | 2107 | $access_condition_on_status = $access_condition[0]; |
2108 | 2108 | $access_condition_on_belonging = $access_condition[1]; |
2109 | 2109 | // 4 cas possibles : |
... | ... | @@ -2112,7 +2112,7 @@ class MaterielsControllerTest extends General { |
2112 | 2112 | */ |
2113 | 2113 | //if ($access_condition_on_status===0 && $access_condition_on_belonging===0) { |
2114 | 2114 | if ([$access_condition_on_status,$access_condition_on_belonging]===[0,0]) { |
2115 | - debug("- is [0,0]"); | |
2115 | + $this->d("- is [0,0]"); | |
2116 | 2116 | $this->_testExecActionForId($action,$id,true); |
2117 | 2117 | } |
2118 | 2118 | /* |
... | ... | @@ -2121,7 +2121,7 @@ class MaterielsControllerTest extends General { |
2121 | 2121 | * - (2) on crée un materiel (F,T) => on teste que l'accès être bien REFUSÉ, SAUF si le profil est RESP (AUTORISÉ) |
2122 | 2122 | */ |
2123 | 2123 | elseif ([$access_condition_on_status,$access_condition_on_belonging]===[0,1]) { |
2124 | - debug("- is [0,1]"); | |
2124 | + $this->d("- is [0,1]"); | |
2125 | 2125 | //$m = $this->Materiels->get($id); |
2126 | 2126 | // - (1) (T,F) |
2127 | 2127 | $this->_updateMatosBelongingToCurrentUserAndInSameGroup($id, true, false); |
... | ... | @@ -2137,7 +2137,7 @@ class MaterielsControllerTest extends General { |
2137 | 2137 | * - (2) on crée un matériel qui n'A PAS le statut demandé => on teste que l'accès être bien REFUSÉ |
2138 | 2138 | */ |
2139 | 2139 | elseif (is_string($access_condition_on_status) && $access_condition_on_belonging===0) { |
2140 | - debug("- is [*,0]"); | |
2140 | + $this->d("- is [*,0]"); | |
2141 | 2141 | //$m = $this->Materiels->get($id); |
2142 | 2142 | // - (1) statut OK |
2143 | 2143 | $this->_updateMatosWithStatusAs($id, $access_condition_on_status, true); |
... | ... | @@ -2152,29 +2152,29 @@ class MaterielsControllerTest extends General { |
2152 | 2152 | * On va donc tester le couple (A,B), ce qui nous donne 3 cas : |
2153 | 2153 | */ |
2154 | 2154 | elseif (is_string($access_condition_on_status) && $access_condition_on_belonging===1) { |
2155 | - debug("- is [*,1]"); | |
2155 | + $this->d("- is [*,1]"); | |
2156 | 2156 | //$m = $this->Materiels->get($id); |
2157 | 2157 | // (1) (T,F) => accès REFUSÉ |
2158 | - debug("(TF) should be KO"); | |
2158 | + $this->d("(TF) should be KO"); | |
2159 | 2159 | $this->_updateMatosWithStatusAs($id, $access_condition_on_status, true); |
2160 | 2160 | $this->_updateMatosBelongingToCurrentUserAndInSameGroup($id, false, false); |
2161 | 2161 | $m = $this->Materiels->get($id); |
2162 | - debug("$m->status, $m->nom_responsable, $m->nom_createur"); | |
2162 | + $this->d("$m->status, $m->nom_responsable, $m->nom_createur"); | |
2163 | 2163 | $this->_testExecActionForId($action,$id,false); |
2164 | 2164 | // (2) (F,T) => accès REFUSÉ |
2165 | - debug("(FT) should be KO"); | |
2165 | + $this->d("(FT) should be KO"); | |
2166 | 2166 | $this->_updateMatosWithStatusAs($id, $access_condition_on_status, false); |
2167 | 2167 | $this->_updateMatosBelongingToCurrentUserAndInSameGroup($id, true, true); |
2168 | 2168 | $m = $this->Materiels->get($id); |
2169 | - debug("$m->status, $m->nom_responsable, $m->nom_createur"); | |
2169 | + $this->d("$m->status, $m->nom_responsable, $m->nom_createur"); | |
2170 | 2170 | $this->_testExecActionForId($action,$id,false); |
2171 | 2171 | // (3) (F,F) => accès REFUSÉ => inutile de tester ce cas |
2172 | 2172 | // (4) (T,T) => accès AUTORISÉ |
2173 | - debug("(TT) should be OK"); | |
2173 | + $this->d("(TT) should be OK"); | |
2174 | 2174 | $this->_updateMatosWithStatusAs($id, $access_condition_on_status, true); |
2175 | 2175 | $this->_updateMatosBelongingToCurrentUserAndInSameGroup($id, true, $this->USER_IS_RESP()); |
2176 | 2176 | $m = $this->Materiels->get($id); |
2177 | - debug("$m->status, $m->nom_responsable, $m->nom_createur"); | |
2177 | + $this->d("$m->status, $m->nom_responsable, $m->nom_createur"); | |
2178 | 2178 | $this->_testExecActionForId($action,$id,true); |
2179 | 2179 | } |
2180 | 2180 | else throw new \ErrorException("La conditions d'accès $access_condition est incorrecte (1)"); |
... | ... | @@ -2252,7 +2252,7 @@ class MaterielsControllerTest extends General { |
2252 | 2252 | if (! in_array($action, ['add', 'index'])) $full_action .= "/$id"; |
2253 | 2253 | $this->$getpost($full_action, $data); |
2254 | 2254 | //debug("2"); debug($_SESSION);return; |
2255 | - debug("Execution action : \$this->$getpost($full_action, data); (avec data=)"); debug($data); | |
2255 | + $this->d("Execution action : \$this->$getpost($full_action, data); (avec data=)"); $this->d($data); | |
2256 | 2256 | //debug($_SESSION);return; |
2257 | 2257 | /* |
2258 | 2258 | if ($SUCCESS) $this->assertNoRedirect(); | ... | ... |