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',