Enable/Disable users

This commit is contained in:
Frederic Guillot
2016-02-13 15:38:35 -05:00
parent 567d623446
commit 6161eaef9e
31 changed files with 541 additions and 72 deletions

View File

@@ -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');

View 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));
}
}