From fe6386d6fbc82db4d1dcc6b9769947108e953267 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 12 May 2017 23:57:45 +0200 Subject: [PATCH] minmod --- phpunit/tests/user/create.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) 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',