コード例 #1
0
ファイル: UserTest.php プロジェクト: perburn/kanboard
 public function testEnableDisable()
 {
     $userModel = new User($this->container);
     $this->assertEquals(2, $userModel->create(array('username' => 'toto')));
     $this->assertTrue($userModel->isActive(2));
     $user = $userModel->getById(2);
     $this->assertEquals(1, $user['is_active']);
     $this->assertTrue($userModel->disable(2));
     $user = $userModel->getById(2);
     $this->assertEquals(0, $user['is_active']);
     $this->assertFalse($userModel->isActive(2));
     $this->assertTrue($userModel->enable(2));
     $user = $userModel->getById(2);
     $this->assertEquals(1, $user['is_active']);
     $this->assertTrue($userModel->isActive(2));
 }