Enable/Disable users
This commit is contained in:
@@ -35,7 +35,7 @@ abstract class Base extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->app = new JsonRPC\Client(API_URL);
|
||||
$this->app->authentication('jsonrpc', API_KEY);
|
||||
$this->app->debug = true;
|
||||
// $this->app->debug = true;
|
||||
|
||||
$this->admin = new JsonRPC\Client(API_URL);
|
||||
$this->admin->authentication('admin', 'admin');
|
||||
|
||||
18
tests/integration/UserTest.php
Normal file
18
tests/integration/UserTest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/Base.php';
|
||||
|
||||
class UserTest extends Base
|
||||
{
|
||||
public function testDisableUser()
|
||||
{
|
||||
$this->assertEquals(2, $this->app->createUser(array('username' => 'someone', 'password' => 'test123')));
|
||||
$this->assertTrue($this->app->isActiveUser(2));
|
||||
|
||||
$this->assertTrue($this->app->disableUser(2));
|
||||
$this->assertFalse($this->app->isActiveUser(2));
|
||||
|
||||
$this->assertTrue($this->app->enableUser(2));
|
||||
$this->assertTrue($this->app->isActiveUser(2));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user