|
|
@ -69,13 +69,11 @@ class UserTest extends CIDatabaseTestCase |
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
$this->library = new Aauth(NULL, $session); |
|
|
|
|
|
|
|
|
|
|
|
$this->seeInDatabase($this->config->dbTableUsers, [ |
|
|
|
$this->seeInDatabase($this->config->dbTableUsers, [ |
|
|
|
'id' => 2, |
|
|
|
|
|
|
|
'email' => 'user@example.com', |
|
|
|
'email' => 'user@example.com', |
|
|
|
'username' => 'user', |
|
|
|
'username' => 'user', |
|
|
|
]); |
|
|
|
]); |
|
|
|
$this->library->updateUser(2, 'user1@example.com', 'password987654', 'user1'); |
|
|
|
$this->library->updateUser(2, 'user1@example.com', 'password987654', 'user1'); |
|
|
|
$this->seeInDatabase($this->config->dbTableUsers, [ |
|
|
|
$this->seeInDatabase($this->config->dbTableUsers, [ |
|
|
|
'id' => 2, |
|
|
|
|
|
|
|
'email' => 'user1@example.com', |
|
|
|
'email' => 'user1@example.com', |
|
|
|
'username' => 'user1', |
|
|
|
'username' => 'user1', |
|
|
|
]); |
|
|
|
]); |
|
|
@ -116,9 +114,9 @@ class UserTest extends CIDatabaseTestCase |
|
|
|
|
|
|
|
|
|
|
|
public function testDeleteUser() |
|
|
|
public function testDeleteUser() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->seeNumRecords(2, $this->config->dbTableUsers, []); |
|
|
|
$this->seeNumRecords(2, $this->config->dbTableUsers, ['deleted' => 0]); |
|
|
|
$this->library->deleteUser(2); |
|
|
|
$this->library->deleteUser(2); |
|
|
|
$this->seeNumRecords(1, $this->config->dbTableUsers, []); |
|
|
|
$this->seeNumRecords(1, $this->config->dbTableUsers, ['deleted' => 0]); |
|
|
|
|
|
|
|
|
|
|
|
$this->assertFalse($this->library->deleteUser(99)); |
|
|
|
$this->assertFalse($this->library->deleteUser(99)); |
|
|
|
$this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]); |
|
|
|
$this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]); |
|
|
|