|
|
|
@ -81,35 +81,35 @@ class UserTest extends CIDatabaseTestCase
|
|
|
|
|
]); |
|
|
|
|
$this->assertEquals(lang('Aauth.infoUpdateSuccess'), $this->library->getInfosArray()[0]); |
|
|
|
|
|
|
|
|
|
// $this->library->clearInfos(); |
|
|
|
|
// $this->assertFalse($this->library->updateUser(2, 'admin@example.com', null, null)); |
|
|
|
|
// $this->assertEquals(lang('Aauth.existsAlreadyEmail'), $this->library->getErrorsArray()[0]); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2, 'admin@example.com', null, null)); |
|
|
|
|
$this->assertEquals(lang('Aauth.existsAlreadyEmail'), $this->library->getErrorsArray()[0]); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2, 'adminexample.com', null, null)); |
|
|
|
|
$this->assertEquals(lang('Aauth.invalidEmail'), $this->library->getErrorsArray()[0]); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2, null, 'pass', null)); |
|
|
|
|
$this->assertEquals(lang('Aauth.invalidPassword'), $this->library->getErrorsArray()[0]); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2, null, 'password12345678901011121314151617', null)); |
|
|
|
|
$this->assertEquals(lang('Aauth.invalidPassword'), $this->library->getErrorsArray()[0]); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2, null, null, 'admin')); |
|
|
|
|
$this->assertEquals(lang('Aauth.existsAlreadyUsername'), $this->library->getErrorsArray()[0]); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2, null, null, 'user+')); |
|
|
|
|
$this->assertEquals(lang('Aauth.invalidUsername'), $this->library->getErrorsArray()[0]); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(2)); |
|
|
|
|
$this->assertCount(0, $this->library->getErrorsArray()); |
|
|
|
|
|
|
|
|
|
$this->library->clearErrors(); |
|
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
$this->assertFalse($this->library->updateUser(99)); |
|
|
|
|
$this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]); |
|
|
|
|
} |
|
|
|
|