当前位置: 首页>>代码示例>>PHP>>正文


PHP Project::disable方法代码示例

本文整理汇总了PHP中Kanboard\Model\Project::disable方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::disable方法的具体用法?PHP Project::disable怎么用?PHP Project::disable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kanboard\Model\Project的用法示例。


在下文中一共展示了Project::disable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAllowEverybody

 public function testAllowEverybody()
 {
     $user = new User($this->container);
     $this->assertNotFalse($user->create(array('username' => 'unittest#1', 'password' => 'unittest')));
     $this->assertNotFalse($user->create(array('username' => 'unittest#2', 'password' => 'unittest')));
     $p = new Project($this->container);
     $pp = new ProjectPermission($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
     $this->assertFalse($pp->isEverybodyAllowed(1));
     $this->assertTrue($pp->isUserAllowed(1, 1));
     $this->assertFalse($pp->isUserAllowed(1, 2));
     $this->assertFalse($pp->isUserAllowed(1, 3));
     $this->assertEquals(array(), $pp->getMembers(1));
     $this->assertEquals(array('Unassigned'), $pp->getMemberList(1));
     $this->assertEmpty($pp->getMemberProjects(1));
     $this->assertEmpty($pp->getMemberProjects(2));
     $this->assertEmpty($pp->getMemberProjects(3));
     $this->assertEmpty($pp->getMemberProjectIds(1));
     $this->assertEmpty($pp->getMemberProjectIds(2));
     $this->assertEmpty($pp->getMemberProjectIds(3));
     $this->assertEmpty($pp->getActiveMemberProjectIds(1));
     $this->assertEmpty($pp->getActiveMemberProjectIds(2));
     $this->assertEmpty($pp->getActiveMemberProjectIds(3));
     $this->assertEmpty($pp->getActiveMemberProjects(1));
     $this->assertEmpty($pp->getActiveMemberProjects(2));
     $this->assertEmpty($pp->getActiveMemberProjects(3));
     $this->assertTrue($p->update(array('id' => 1, 'is_everybody_allowed' => 1)));
     $this->assertTrue($pp->isEverybodyAllowed(1));
     $this->assertTrue($pp->isUserAllowed(1, 1));
     $this->assertTrue($pp->isUserAllowed(1, 2));
     $this->assertTrue($pp->isUserAllowed(1, 3));
     $this->assertEquals(array('1' => 'admin', '2' => 'unittest#1', '3' => 'unittest#2'), $pp->getMembers(1));
     $this->assertEquals(array('Unassigned', '1' => 'admin', '2' => 'unittest#1', '3' => 'unittest#2'), $pp->getMemberList(1));
     $this->assertNotEmpty($pp->getMemberProjects(1));
     $this->assertNotEmpty($pp->getMemberProjects(2));
     $this->assertNotEmpty($pp->getMemberProjects(3));
     $this->assertNotEmpty($pp->getMemberProjectIds(1));
     $this->assertNotEmpty($pp->getMemberProjectIds(2));
     $this->assertNotEmpty($pp->getMemberProjectIds(3));
     $this->assertNotEmpty($pp->getActiveMemberProjectIds(1));
     $this->assertNotEmpty($pp->getActiveMemberProjectIds(2));
     $this->assertNotEmpty($pp->getActiveMemberProjectIds(3));
     $this->assertNotEmpty($pp->getActiveMemberProjects(1));
     $this->assertNotEmpty($pp->getActiveMemberProjects(2));
     $this->assertNotEmpty($pp->getActiveMemberProjects(3));
     $this->assertTrue($p->disable(1));
     $this->assertEmpty($pp->getActiveMemberProjectIds(1));
     $this->assertEmpty($pp->getActiveMemberProjectIds(2));
     $this->assertEmpty($pp->getActiveMemberProjectIds(3));
     $this->assertEmpty($pp->getActiveMemberProjects(1));
     $this->assertEmpty($pp->getActiveMemberProjects(2));
     $this->assertEmpty($pp->getActiveMemberProjects(3));
 }
开发者ID:Folcky,项目名称:kanboard,代码行数:53,代码来源:ProjectPermissionTest.php

示例2: testDisable

 public function testDisable()
 {
     $p = new Project($this->container);
     $this->assertEquals(1, $p->create(array('name' => 'UnitTest')));
     $this->assertTrue($p->disable(1));
     $this->assertTrue($p->enable(1));
     $project = $p->getById(1);
     $this->assertNotEmpty($project);
     $this->assertEquals(1, $project['is_active']);
     $this->assertFalse($p->enable(1234567));
 }
开发者ID:perburn,项目名称:kanboard,代码行数:11,代码来源:ProjectTest.php


注:本文中的Kanboard\Model\Project::disable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。