From 922b046375035ecff9844985d17d87afeeff4726 Mon Sep 17 00:00:00 2001 From: Lucas Mascaro Date: Thu, 10 Dec 2015 10:56:06 +0100 Subject: [PATCH] corrections --- coverage/StaticRepo.php.html | 22 ++--- coverage/dashboard.html | 10 +- coverage/index.html | 18 ++-- coverage/repos/MedecinRepo.php.html | 136 +++++++++++++++------------- coverage/repos/PatientRepo.php.html | 2 +- coverage/repos/RDVRepo.php.html | 2 +- coverage/repos/StatsRepo.php.html | 2 +- coverage/repos/dashboard.html | 10 +- coverage/repos/index.html | 18 ++-- repositories/repos/MedecinRepo.php | 8 ++ repositories/repos/PatientRepo.php | 7 ++ test/RDVRepoTest.php | 4 +- 12 files changed, 130 insertions(+), 109 deletions(-) diff --git a/coverage/StaticRepo.php.html b/coverage/StaticRepo.php.html index 9462b25..6552234 100644 --- a/coverage/StaticRepo.php.html +++ b/coverage/StaticRepo.php.html @@ -291,24 +291,24 @@
102
    public static function checkParam($variable, $dbtype){
103
        /* [1] on vérifie que $dbtype est un String
104
        =============================================================*/ -
105
        if( !is_string($dbtype) ) return false; +
105
        if( !is_string($dbtype) ) return false;
106
107
108
        /* [2] Vérifications
109
        =============================================================*/ -
110
        $checker = true; // contiendra VRAI si la vérification s'avère correcte -
111
        $matches = []; +
110
        $checker = true; // contiendra VRAI si la vérification s'avère correcte +
111
        $matches = [];
112
        //si on a un type scalairexlongueur, on traite -
113
        if(preg_match_all('/((?:[a-z][a-z]+))(\\d+)/is',$dbtype,$matches)){ +
113
        if(preg_match_all('/((?:[a-z][a-z]+))(\\d+)/is',$dbtype,$matches)){
114
            $dbtype = $matches[1][0];
115
            isset($matches[2][0])? $len = $matches[2][0] : $len = 8;
116
        }
117
118
        switch($dbtype){
119
            // [1] 'M' / 'F'  -
120
            case 'Civilite': -
121
                $checker = $checker && is_string($variable) && in_array($variable,['M','F']); -
122
                break; +
120
            case 'Civilite': +
121
                $checker = $checker && is_string($variable) && in_array($variable,['M','F']); +
122
                break;
123
124
            // [2] Chaine de caractère (longueur variable)
125
            case 'String': @@ -316,8 +316,8 @@
127
                break;
128
129
            case 'Integer': -
130
                $checker = $checker && is_int($variable) && $variable<pow(2,32); -
131
                break; +
130
                $checker = $checker && is_int($variable) && $variable<pow(2,32); +
131
                break;
132
133
            case 'SmallInteger':
134
                $checker = $checker && is_int($variable) && $variable<pow(2,16); @@ -338,7 +338,7 @@
149
150
        /* [3] On retourne le résultat de la vérif
151
        =============================================================*/ -
152
        return $checker; +
152
        return $checker;
153
154
    }
155
@@ -358,7 +358,7 @@ Dead Code

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/coverage/dashboard.html b/coverage/dashboard.html index 2ee1112..a474818 100644 --- a/coverage/dashboard.html +++ b/coverage/dashboard.html @@ -113,9 +113,9 @@ - add83% checkParam84% delNumeric85% + add85% getAll85% add88% @@ -136,8 +136,8 @@ checkParam23 delNumeric10 + add5 getAll4 - add2 add2 @@ -148,7 +148,7 @@ @@ -237,7 +237,7 @@ $(document).ready(function() { chart.yAxis.axisLabel('Cyclomatic Complexity'); d3.select('#classComplexity svg') - .datum(getComplexityData([[86.95652173913,36,"StaticRepo<\/a>"],[95.238095238095,7,"MedecinRepo<\/a>"],[95.652173913043,9,"PatientRepo<\/a>"],[92.682926829268,11,"RDVRepo<\/a>"],[92.307692307692,9,"StatsRepo<\/a>"]], 'Class Complexity')) + .datum(getComplexityData([[86.95652173913,36,"StaticRepo<\/a>"],[95.652173913043,11,"MedecinRepo<\/a>"],[95.652173913043,9,"PatientRepo<\/a>"],[92.682926829268,11,"RDVRepo<\/a>"],[92.307692307692,9,"StatsRepo<\/a>"]], 'Class Complexity')) .transition() .duration(500) .call(chart); @@ -261,7 +261,7 @@ $(document).ready(function() { chart.yAxis.axisLabel('Method Complexity'); d3.select('#methodComplexity svg') - .datum(getComplexityData([[100,3,"StaticRepo::getConnexion<\/a>"],[100,1,"StaticRepo::testConnexion<\/a>"],[85.714285714286,10,"StaticRepo::delNumeric<\/a>"],[84.615384615385,22,"StaticRepo::checkParam<\/a>"],[100,1,"MedecinRepo::getById<\/a>"],[83.333333333333,2,"MedecinRepo::add<\/a>"],[100,1,"MedecinRepo::delete<\/a>"],[100,1,"MedecinRepo::search<\/a>"],[100,1,"MedecinRepo::getPatients<\/a>"],[100,1,"MedecinRepo::getAll<\/a>"],[100,1,"PatientRepo::getById<\/a>"],[93.75,2,"PatientRepo::add<\/a>"],[94.444444444444,2,"PatientRepo::update<\/a>"],[100,1,"PatientRepo::delete<\/a>"],[100,1,"PatientRepo::updateMedecinTraitant<\/a>"],[100,1,"PatientRepo::search<\/a>"],[100,1,"PatientRepo::getAll<\/a>"],[100,1,"RDVRepo::getById<\/a>"],[100,1,"RDVRepo::getByDate<\/a>"],[100,1,"RDVRepo::delete<\/a>"],[88.888888888889,2,"RDVRepo::add<\/a>"],[100,1,"RDVRepo::updateDateTime<\/a>"],[100,1,"RDVRepo::getByPatientAndDate<\/a>"],[85.714285714286,4,"RDVRepo::getAll<\/a>"],[91.304347826087,8,"StatsRepo::getAgePatient<\/a>"],[100,1,"StatsRepo::getRDVStat<\/a>"]], 'Method Complexity')) + .datum(getComplexityData([[100,3,"StaticRepo::getConnexion<\/a>"],[100,1,"StaticRepo::testConnexion<\/a>"],[85.714285714286,10,"StaticRepo::delNumeric<\/a>"],[84.615384615385,22,"StaticRepo::checkParam<\/a>"],[100,2,"MedecinRepo::getById<\/a>"],[85.714285714286,5,"MedecinRepo::add<\/a>"],[100,1,"MedecinRepo::delete<\/a>"],[100,1,"MedecinRepo::search<\/a>"],[100,1,"MedecinRepo::getPatients<\/a>"],[100,1,"MedecinRepo::getAll<\/a>"],[100,1,"PatientRepo::getById<\/a>"],[93.75,2,"PatientRepo::add<\/a>"],[94.444444444444,2,"PatientRepo::update<\/a>"],[100,1,"PatientRepo::delete<\/a>"],[100,1,"PatientRepo::updateMedecinTraitant<\/a>"],[100,1,"PatientRepo::search<\/a>"],[100,1,"PatientRepo::getAll<\/a>"],[100,1,"RDVRepo::getById<\/a>"],[100,1,"RDVRepo::getByDate<\/a>"],[100,1,"RDVRepo::delete<\/a>"],[88.888888888889,2,"RDVRepo::add<\/a>"],[100,1,"RDVRepo::updateDateTime<\/a>"],[100,1,"RDVRepo::getByPatientAndDate<\/a>"],[85.714285714286,4,"RDVRepo::getAll<\/a>"],[91.304347826087,8,"StatsRepo::getAgePatient<\/a>"],[100,1,"StatsRepo::getRDVStat<\/a>"]], 'Method Complexity')) .transition() .duration(500) .call(chart); diff --git a/coverage/index.html b/coverage/index.html index edf73f6..a9c8bff 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -43,13 +43,13 @@ Total
-
- 92.22% covered (success) +
+ 92.31% covered (success)
-
92.22%
-
166 / 180
+
92.31%
+
168 / 182
69.23% covered (warning) @@ -71,13 +71,13 @@ repos
-
- 94.03% covered (success) +
+ 94.12% covered (success)
-
94.03%
-
126 / 134
+
94.12%
+
128 / 136
72.73% covered (warning) @@ -136,7 +136,7 @@ High: 90% to 100%

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/coverage/repos/MedecinRepo.php.html b/coverage/repos/MedecinRepo.php.html index f327b9a..a827db2 100644 --- a/coverage/repos/MedecinRepo.php.html +++ b/coverage/repos/MedecinRepo.php.html @@ -61,13 +61,13 @@
5 / 6
CRAP
-
- 95.24% covered (success) +
+ 95.65% covered (success)
-
95.24%
-
20 / 21
+
95.65%
+
22 / 23
@@ -88,15 +88,15 @@
83.33%
5 / 6
- 7 + 11
-
- 95.24% covered (success) +
+ 95.65% covered (success)
-
95.24%
-
20 / 21
+
95.65%
+
22 / 23
@@ -109,7 +109,7 @@
100.00%
1 / 1
- 1 + 2
100.00% covered (success) @@ -117,11 +117,11 @@
100.00%
-
3 / 3
+
4 / 4
-  add +  add
0.00% covered (danger) @@ -130,19 +130,19 @@
0.00%
0 / 1
- 2.02 + 5.07
-
- 83.33% covered (warning) +
+ 85.71% covered (warning)
-
83.33%
-
5 / 6
+
85.71%
+
6 / 7
-  delete +  delete
100.00% covered (success) @@ -163,7 +163,7 @@ -  search +  search
100.00% covered (success) @@ -184,7 +184,7 @@ -  getPatients +  getPatients
100.00% covered (success) @@ -205,7 +205,7 @@ -  getAll +  getAll
100.00% covered (success) @@ -242,53 +242,59 @@ {     public static function getById($id){ -         $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Id = :id'); -         $req->execute(['id' => $id]); -         return StaticRepo::delNumeric( $req->fetch(), true ); - -     } - -     public static function add($civilite,$prenom,$nom){ -         $req = StaticRepo::getConnexion()->prepare('INSERT INTO Medecin VALUES (DEFAULT,:civilite,:prenom,:nom)'); -         $result = $req->execute(['civilite' => $civilite, -             'nom' => $nom, -             'prenom' => $prenom]); -         if($result != false){return StaticRepo::getConnexion()->lastInsertId();} -         else{return false;} -     } - -     public static function delete($idMedecin){ -         $req = StaticRepo::getConnexion()->prepare('DELETE FROM Medecin WHERE Id = :id'); -         return $req->execute(['id' => $idMedecin]); -     } - -     public static function search($nom,$prenom){ -         $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); -         $req->execute(['nom' => $nom, -             'prenom' => $prenom]); - -         return StaticRepo::delNumeric($req->fetchAll()); -     } - -     public static function getPatients($idMedecin){ - -         $req = StaticRepo::getConnexion()->prepare('SELECT Patient.* FROM Patient,Medecin -                     WHERE Medecin.Id = :id -                     AND Medecin.Id = Patient.MedecinTraitant'); + +         if(!StaticRepo::checkParam($id,'Integer')){return false;} + +         $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Id = :id'); +         $req->execute(['id' => $id]); +         return StaticRepo::delNumeric( $req->fetch(), true ); + +     } + +     public static function add($civilite,$prenom,$nom){ + +         if(!StaticRepo::checkParam($civilite,'Civilite') && !StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45')){return false;} + +         $req = StaticRepo::getConnexion()->prepare('INSERT INTO Medecin VALUES (DEFAULT,:civilite,:prenom,:nom)'); +         $result = $req->execute(['civilite' => $civilite, +             'nom' => $nom, +             'prenom' => $prenom]); +         if($result != false){return StaticRepo::getConnexion()->lastInsertId();} +         else{return false;} +     } + +     public static function delete($idMedecin){ +         $req = StaticRepo::getConnexion()->prepare('DELETE FROM Medecin WHERE Id = :id'); +         return $req->execute(['id' => $idMedecin]); +     } + +     public static function search($nom,$prenom){ +         $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Nom LIKE :nom AND Prenom LIKE :prenom'); +         $req->execute(['nom' => $nom, +             'prenom' => $prenom]); + +         return StaticRepo::delNumeric($req->fetchAll()); +     } -         $req->execute(['id' => $idMedecin]); -         return StaticRepo::delNumeric($req->fetchAll()); -     } - -     public static function getAll(){ +     public static function getPatients($idMedecin){ + +         $req = StaticRepo::getConnexion()->prepare('SELECT Patient.* FROM Patient,Medecin +                     WHERE Medecin.Id = :id +                     AND Medecin.Id = Patient.MedecinTraitant'); -         $req = StaticRepo::getConnexion()->query('SELECT * FROM Medecin ORDER BY nom, prenom ASC'); - -         return StaticRepo::delNumeric( $req->fetchAll() ); +         $req->execute(['id' => $idMedecin]); +         return StaticRepo::delNumeric($req->fetchAll()); +     } -     } +     public static function getAll(){ - } +         $req = StaticRepo::getConnexion()->query('SELECT * FROM Medecin ORDER BY nom, prenom ASC'); + +         return StaticRepo::delNumeric( $req->fetchAll() ); + +     } + + } @@ -301,7 +307,7 @@ Dead Code

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/coverage/repos/PatientRepo.php.html b/coverage/repos/PatientRepo.php.html index 6719660..597fb60 100644 --- a/coverage/repos/PatientRepo.php.html +++ b/coverage/repos/PatientRepo.php.html @@ -362,7 +362,7 @@ Dead Code

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/coverage/repos/RDVRepo.php.html b/coverage/repos/RDVRepo.php.html index b73629d..e972094 100644 --- a/coverage/repos/RDVRepo.php.html +++ b/coverage/repos/RDVRepo.php.html @@ -341,7 +341,7 @@ Dead Code

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/coverage/repos/StatsRepo.php.html b/coverage/repos/StatsRepo.php.html index 6c4ec2a..6dc50e8 100644 --- a/coverage/repos/StatsRepo.php.html +++ b/coverage/repos/StatsRepo.php.html @@ -213,7 +213,7 @@ Dead Code

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/coverage/repos/dashboard.html b/coverage/repos/dashboard.html index 543e0b4..fb456a7 100644 --- a/coverage/repos/dashboard.html +++ b/coverage/repos/dashboard.html @@ -112,7 +112,7 @@ - add83% + add85% getAll85% add88% @@ -131,8 +131,8 @@ + add5 getAll4 - add2 add2 @@ -143,7 +143,7 @@
@@ -232,7 +232,7 @@ $(document).ready(function() { chart.yAxis.axisLabel('Cyclomatic Complexity'); d3.select('#classComplexity svg') - .datum(getComplexityData([[95.238095238095,7,"MedecinRepo<\/a>"],[95.652173913043,9,"PatientRepo<\/a>"],[92.682926829268,11,"RDVRepo<\/a>"],[92.307692307692,9,"StatsRepo<\/a>"]], 'Class Complexity')) + .datum(getComplexityData([[95.652173913043,11,"MedecinRepo<\/a>"],[95.652173913043,9,"PatientRepo<\/a>"],[92.682926829268,11,"RDVRepo<\/a>"],[92.307692307692,9,"StatsRepo<\/a>"]], 'Class Complexity')) .transition() .duration(500) .call(chart); @@ -256,7 +256,7 @@ $(document).ready(function() { chart.yAxis.axisLabel('Method Complexity'); d3.select('#methodComplexity svg') - .datum(getComplexityData([[100,1,"MedecinRepo::getById<\/a>"],[83.333333333333,2,"MedecinRepo::add<\/a>"],[100,1,"MedecinRepo::delete<\/a>"],[100,1,"MedecinRepo::search<\/a>"],[100,1,"MedecinRepo::getPatients<\/a>"],[100,1,"MedecinRepo::getAll<\/a>"],[100,1,"PatientRepo::getById<\/a>"],[93.75,2,"PatientRepo::add<\/a>"],[94.444444444444,2,"PatientRepo::update<\/a>"],[100,1,"PatientRepo::delete<\/a>"],[100,1,"PatientRepo::updateMedecinTraitant<\/a>"],[100,1,"PatientRepo::search<\/a>"],[100,1,"PatientRepo::getAll<\/a>"],[100,1,"RDVRepo::getById<\/a>"],[100,1,"RDVRepo::getByDate<\/a>"],[100,1,"RDVRepo::delete<\/a>"],[88.888888888889,2,"RDVRepo::add<\/a>"],[100,1,"RDVRepo::updateDateTime<\/a>"],[100,1,"RDVRepo::getByPatientAndDate<\/a>"],[85.714285714286,4,"RDVRepo::getAll<\/a>"],[91.304347826087,8,"StatsRepo::getAgePatient<\/a>"],[100,1,"StatsRepo::getRDVStat<\/a>"]], 'Method Complexity')) + .datum(getComplexityData([[100,2,"MedecinRepo::getById<\/a>"],[85.714285714286,5,"MedecinRepo::add<\/a>"],[100,1,"MedecinRepo::delete<\/a>"],[100,1,"MedecinRepo::search<\/a>"],[100,1,"MedecinRepo::getPatients<\/a>"],[100,1,"MedecinRepo::getAll<\/a>"],[100,1,"PatientRepo::getById<\/a>"],[93.75,2,"PatientRepo::add<\/a>"],[94.444444444444,2,"PatientRepo::update<\/a>"],[100,1,"PatientRepo::delete<\/a>"],[100,1,"PatientRepo::updateMedecinTraitant<\/a>"],[100,1,"PatientRepo::search<\/a>"],[100,1,"PatientRepo::getAll<\/a>"],[100,1,"RDVRepo::getById<\/a>"],[100,1,"RDVRepo::getByDate<\/a>"],[100,1,"RDVRepo::delete<\/a>"],[88.888888888889,2,"RDVRepo::add<\/a>"],[100,1,"RDVRepo::updateDateTime<\/a>"],[100,1,"RDVRepo::getByPatientAndDate<\/a>"],[85.714285714286,4,"RDVRepo::getAll<\/a>"],[91.304347826087,8,"StatsRepo::getAgePatient<\/a>"],[100,1,"StatsRepo::getRDVStat<\/a>"]], 'Method Complexity')) .transition() .duration(500) .call(chart); diff --git a/coverage/repos/index.html b/coverage/repos/index.html index ad5e289..674c43c 100644 --- a/coverage/repos/index.html +++ b/coverage/repos/index.html @@ -44,13 +44,13 @@ Total
-
- 94.03% covered (success) +
+ 94.12% covered (success)
-
94.03%
-
126 / 134
+
94.12%
+
128 / 136
72.73% covered (warning) @@ -72,13 +72,13 @@ MedecinRepo.php
-
- 95.24% covered (success) +
+ 95.65% covered (success)
-
95.24%
-
20 / 21
+
95.65%
+
22 / 23
83.33% covered (warning) @@ -193,7 +193,7 @@ High: 90% to 100%

- Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:44:35 UTC 2015. + Generated by PHP_CodeCoverage 3.0.2 using PHP 7.0.0 and PHPUnit 5.1.0 at Thu Dec 10 9:54:17 UTC 2015.

diff --git a/repositories/repos/MedecinRepo.php b/repositories/repos/MedecinRepo.php index f5dfa0c..aae6211 100755 --- a/repositories/repos/MedecinRepo.php +++ b/repositories/repos/MedecinRepo.php @@ -10,6 +10,9 @@ class MedecinRepo { public static function getById($id){ + + if(!StaticRepo::checkParam($id,'Integer')){return false;} + $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Medecin WHERE Id = :id'); $req->execute(['id' => $id]); return StaticRepo::delNumeric( $req->fetch(), true ); @@ -17,6 +20,9 @@ class MedecinRepo } public static function add($civilite,$prenom,$nom){ + + if(!StaticRepo::checkParam($civilite,'Civilite') && !StaticRepo::checkParam($prenom,'String45') && !StaticRepo::checkParam($nom,'String45')){return false;} + $req = StaticRepo::getConnexion()->prepare('INSERT INTO Medecin VALUES (DEFAULT,:civilite,:prenom,:nom)'); $result = $req->execute(['civilite' => $civilite, 'nom' => $nom, @@ -40,6 +46,8 @@ class MedecinRepo public static function getPatients($idMedecin){ + if(!StaticRepo::checkParam($idMedecin,'Integer')){return false;} + $req = StaticRepo::getConnexion()->prepare('SELECT Patient.* FROM Patient,Medecin WHERE Medecin.Id = :id AND Medecin.Id = Patient.MedecinTraitant'); diff --git a/repositories/repos/PatientRepo.php b/repositories/repos/PatientRepo.php index 86e7c88..cb4c2c9 100755 --- a/repositories/repos/PatientRepo.php +++ b/repositories/repos/PatientRepo.php @@ -15,6 +15,9 @@ class PatientRepo // } public static function getById($id){ + + if(!StaticRepo::checkParam($id,'Integer')){return false;} + $req = StaticRepo::getConnexion()->prepare('SELECT * FROM Patient WHERE Id = :id'); $req->execute(['id' => $id]); return StaticRepo::delNumeric( $req->fetch(), true ); @@ -68,6 +71,8 @@ class PatientRepo public static function delete($idPatient){ + if(!StaticRepo::checkParam($idPatient,'Integer')){return false;} + $req = StaticRepo::getConnexion()->prepare('DELETE FROM Patient WHERE Patient.Id = :id'); return $req->execute(['id' => $idPatient]); @@ -75,6 +80,8 @@ class PatientRepo public static function updateMedecinTraitant($idPatient,$idMedecin){ + if(!StaticRepo::checkParam($idPatient,'Integer') && !StaticRepo::checkParam($idMedecin,'Integer')){return false;} + $req = StaticRepo::getConnexion()->prepare('UPDATE Patient SET MedecinTraitant = :medecin WHERE Id = :id'); return $req->execute(['medecin' => $idMedecin, 'id' => $idPatient]); diff --git a/test/RDVRepoTest.php b/test/RDVRepoTest.php index 1e10f8c..5a9d04a 100644 --- a/test/RDVRepoTest.php +++ b/test/RDVRepoTest.php @@ -55,9 +55,9 @@ class RDVRepoTest extends PHPUnit_Framework_TestCase } public function testGetAll(){ - $this->assertEquals(count($this->repo->getAll(-1)),98); + $this->assertEquals(count($this->repo->getAll(-1)),99); $this->assertEquals(count($this->repo->getAll(0)),100); - $this->assertEquals(count($this->repo->getAll(1)),2); + $this->assertEquals(count($this->repo->getAll(1)),1); } }