Improve API to return id instead of a boolean
This commit is contained in:
@@ -73,8 +73,8 @@ class UserTest extends Base
|
||||
public function testCreate()
|
||||
{
|
||||
$u = new User($this->container);
|
||||
$this->assertTrue($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
|
||||
$this->assertTrue($u->create(array('username' => 'titi', 'is_ldap_user' => 1)));
|
||||
$this->assertNotFalse($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
|
||||
$this->assertNotFalse($u->create(array('username' => 'titi', 'is_ldap_user' => 1)));
|
||||
$this->assertFalse($u->create(array('username' => 'toto')));
|
||||
|
||||
$user = $u->getById(1);
|
||||
@@ -105,7 +105,7 @@ class UserTest extends Base
|
||||
public function testUpdate()
|
||||
{
|
||||
$u = new User($this->container);
|
||||
$this->assertTrue($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
|
||||
$this->assertNotFalse($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
|
||||
$this->assertTrue($u->update(array('id' => 2, 'username' => 'biloute')));
|
||||
|
||||
$user = $u->getById(2);
|
||||
@@ -124,7 +124,7 @@ class UserTest extends Base
|
||||
$tf = new TaskFinder($this->container);
|
||||
$p = new Project($this->container);
|
||||
|
||||
$this->assertTrue($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
|
||||
$this->assertNotFalse($u->create(array('username' => 'toto', 'password' => '123456', 'name' => 'Toto')));
|
||||
$this->assertEquals(1, $p->create(array('name' => 'Project #1')));
|
||||
$this->assertEquals(1, $tc->create(array('title' => 'Task #1', 'project_id' => 1, 'owner_id' => 2)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user