diff --git a/phpunit/coverage/index.html b/phpunit/coverage/index.html index ea24a94..59fe350 100644 --- a/phpunit/coverage/index.html +++ b/phpunit/coverage/index.html @@ -43,13 +43,13 @@ Total
-
- 23.47% covered (danger) +
+ 23.50% covered (danger)
-
23.47%
-
667 / 2842
+
23.50%
+
668 / 2842
10.14% covered (danger) @@ -71,13 +71,13 @@ api
-
- 17.55% covered (danger) +
+ 17.65% covered (danger)
-
17.55%
-
179 / 1020
+
17.65%
+
180 / 1020
5.56% covered (danger) @@ -276,7 +276,7 @@ High: 90% to 100%

- Generated by php-code-coverage 5.2.1 using PHP 7.0.15-0ubuntu0.16.04.4 with Xdebug 2.4.0 and PHPUnit 6.1.3 at Fri May 12 21:51:59 UTC 2017. + Generated by php-code-coverage 5.2.1 using PHP 7.0.15-0ubuntu0.16.04.4 with Xdebug 2.4.0 and PHPUnit 6.1.3 at Fri May 12 21:54:47 UTC 2017.

diff --git a/phpunit/tests/user/create.php b/phpunit/tests/user/create.php index 9c59b9d..4a12274 100644 --- a/phpunit/tests/user/create.php +++ b/phpunit/tests/user/create.php @@ -76,11 +76,37 @@ /* * @depends testCreateCorrect */ - public function testCreateAlready(){ + public function testCreateAlreadyCode(){ /* (1) Création requête */ $req = new Request('userDefault/create', [ 'code' => '12-AB-CD-EF', + 'username' => 'xxx', + 'firstname' => 'a bcdef123456', + 'lastname' => 'ab cdef123456', + 'mail' => 'ab@cd.ef' + ]); + + /* (2) Gestion erreur */ + $this->assertEquals($req->error->get(), Err::Success); + + /* (3) Gestion erreur */ + $res = $req->dispatch(); + + /* (4) Gestion erreur */ + $this->assertEquals($res->error->get(), Err::AlreadyExists); + + + } + + /* + * @depends testCreateCorrect + */ + public function testCreateAlreadyUsername(){ + + /* (1) Création requête */ + $req = new Request('userDefault/create', [ + 'code' => '01-10-01-10', 'username' => 'abcdef123456', 'firstname' => 'a bcdef123456', 'lastname' => 'ab cdef123456',