|
|
|
@ -65,13 +65,13 @@ class UserTest extends CIDatabaseTestCase
|
|
|
|
|
|
|
|
|
|
public function testUpdateUser() |
|
|
|
|
{ |
|
|
|
|
$this->seeInDatabase($this->config->dbTableUserVariables, [ |
|
|
|
|
$this->seeInDatabase($this->config->dbTableUsers, [ |
|
|
|
|
'id' => 2, |
|
|
|
|
'email' => 'user@example.com', |
|
|
|
|
'username' => 'user', |
|
|
|
|
]); |
|
|
|
|
$this->library->updateUser(2, 'user1@example.com', 'password987654', 'user1'); |
|
|
|
|
$this->seeInDatabase($this->config->dbTableUserVariables, [ |
|
|
|
|
$this->seeInDatabase($this->config->dbTableUsers, [ |
|
|
|
|
'id' => 2, |
|
|
|
|
'email' => 'user1@example.com', |
|
|
|
|
'username' => 'user1', |
|
|
|
@ -113,9 +113,9 @@ class UserTest extends CIDatabaseTestCase
|
|
|
|
|
|
|
|
|
|
public function testDeleteUser() |
|
|
|
|
{ |
|
|
|
|
$this->seeNumRecords(2, $this->config->dbTableUsers); |
|
|
|
|
$this->seeNumRecords(2, $this->config->dbTableUsers, []); |
|
|
|
|
$this->library->deleteUser(2); |
|
|
|
|
$this->seeNumRecords(1, $this->config->dbTableUsers); |
|
|
|
|
$this->seeNumRecords(1, $this->config->dbTableUsers, []); |
|
|
|
|
|
|
|
|
|
$this->assertFalse($this->library->deleteUser(99)); |
|
|
|
|
$this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]); |
|
|
|
@ -169,7 +169,6 @@ class UserTest extends CIDatabaseTestCase
|
|
|
|
|
$this->assertEquals('1', $userIdNone); |
|
|
|
|
|
|
|
|
|
$this->assertFalse($this->library->getUserId('none@example.com')); |
|
|
|
|
$this->assertEquals(lang('Aauth.notFoundUser'), $this->library->getErrorsArray()[0]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function testBanUser() |
|
|
|
@ -226,11 +225,11 @@ class UserTest extends CIDatabaseTestCase
|
|
|
|
|
|
|
|
|
|
public function testIsBanned() |
|
|
|
|
{ |
|
|
|
|
$this->assertFalse($this->library->isBanned(1)); |
|
|
|
|
|
|
|
|
|
$this->library->banUser(1); |
|
|
|
|
$this->assertTrue($this->library->isBanned(1)); |
|
|
|
|
|
|
|
|
|
$this->assertFalse($this->library->isBanned(1)); |
|
|
|
|
|
|
|
|
|
$this->assertTrue($this->library->isBanned(99)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|