3 changed files with 26 additions and 19 deletions
@ -95,9 +95,9 @@ class UserModelTest extends CIDatabaseTestCase |
|||||||
|
|
||||||
public function testUpdate() |
public function testUpdate() |
||||||
{ |
{ |
||||||
$this->assertFalse($this->model->update(2, ['email' => '[email protected]'])); |
// $this->assertFalse($this->model->update(2, ['email' => '[email protected]'])); |
||||||
print_r($this->model->errors()); |
// print_r($this->model->errors()); |
||||||
$this->assertEquals(lang('Aauth.existsAlreadyEmail'), $this->model->errors()[0]); |
// $this->assertEquals(lang('Aauth.existsAlreadyEmail'), $this->model->errors()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->model->update(2, ['email' => 'adminexample.com'])); |
// $this->assertFalse($this->model->update(2, ['email' => 'adminexample.com'])); |
||||||
// $this->assertEquals(lang('Aauth.invalidEmail'), $this->model->errors()[0]); |
// $this->assertEquals(lang('Aauth.invalidEmail'), $this->model->errors()[0]); |
||||||
|
@ -78,27 +78,34 @@ class UserTest extends CIDatabaseTestCase |
|||||||
]); |
]); |
||||||
$this->assertEquals(lang('Aauth.infoUpdateSuccess'), $this->library->getInfosArray()[0]); |
$this->assertEquals(lang('Aauth.infoUpdateSuccess'), $this->library->getInfosArray()[0]); |
||||||
|
|
||||||
// moved to UserModelTest, not working here :/ |
$this->library = new Aauth(null, true); |
||||||
// $this->assertFalse($this->library->updateUser(2, '[email protected]', null, null)); |
$this->assertFalse($this->library->updateUser(2, '[email protected]', null, null)); |
||||||
// $this->assertEquals(lang('Aauth.existsAlreadyEmail'), $this->library->getErrorsArray()[0]); |
print_r(getErrorsArray()); |
||||||
|
$this->assertEquals(lang('Aauth.existsAlreadyEmail'), $this->library->getErrorsArray()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->library->updateUser(2, 'adminexample.com', null, null)); |
$this->library = new Aauth(null, true); |
||||||
// $this->assertEquals(lang('Aauth.invalidEmail'), $this->library->getErrorsArray()[0]); |
$this->assertFalse($this->library->updateUser(2, 'adminexample.com', null, null)); |
||||||
|
$this->assertEquals(lang('Aauth.invalidEmail'), $this->library->getErrorsArray()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->library->updateUser(2, null, 'pass', null)); |
$this->library = new Aauth(null, true); |
||||||
// $this->assertEquals(lang('Aauth.invalidPassword'), $this->library->getErrorsArray()[0]); |
$this->assertFalse($this->library->updateUser(2, null, 'pass', null)); |
||||||
|
$this->assertEquals(lang('Aauth.invalidPassword'), $this->library->getErrorsArray()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->library->updateUser(2, null, 'password12345678901011121314151617', null)); |
$this->library = new Aauth(null, true); |
||||||
// $this->assertEquals(lang('Aauth.invalidPassword'), $this->library->getErrorsArray()[0]); |
$this->assertFalse($this->library->updateUser(2, null, 'password12345678901011121314151617', null)); |
||||||
|
$this->assertEquals(lang('Aauth.invalidPassword'), $this->library->getErrorsArray()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->library->updateUser(2, null, null, 'admin')); |
$this->library = new Aauth(null, true); |
||||||
// $this->assertEquals(lang('Aauth.existsAlreadyUsername'), $this->library->getErrorsArray()[0]); |
$this->assertFalse($this->library->updateUser(2, null, null, 'admin')); |
||||||
|
$this->assertEquals(lang('Aauth.existsAlreadyUsername'), $this->library->getErrorsArray()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->library->updateUser(2, null, null, 'user+')); |
$this->library = new Aauth(null, true); |
||||||
// $this->assertEquals(lang('Aauth.invalidUsername'), $this->library->getErrorsArray()[0]); |
$this->assertFalse($this->library->updateUser(2, null, null, 'user+')); |
||||||
|
$this->assertEquals(lang('Aauth.invalidUsername'), $this->library->getErrorsArray()[0]); |
||||||
|
|
||||||
// $this->assertFalse($this->library->updateUser(2)); |
$this->library = new Aauth(null, true); |
||||||
// $this->assertCount(0, $this->library->getErrorsArray()); |
$this->assertFalse($this->library->updateUser(2)); |
||||||
|
$this->assertCount(0, $this->library->getErrorsArray()); |
||||||
|
|
||||||
$this->library = new Aauth(null, true); |
$this->library = new Aauth(null, true); |
||||||
$this->assertFalse($this->library->updateUser(99)); |
$this->assertFalse($this->library->updateUser(99)); |
||||||
|
Loading…
Reference in new issue