/** * Test getRights function */ public function testGetUsersRights() { $module = new Project_Models_Project(array('db' => $this->sharedFixture)); $module->find(2); $rights = $module->getUsersRights(); $this->assertArrayHasKey(3, $rights); $this->assertArrayHasKey('itemId', $rights[3]); $this->assertEquals($rights[3]['itemId'], 2); $this->assertArrayHasKey('write', $rights[3]); $this->assertEquals($rights[3]['write'], true); $module = new Todo_Models_Todo(array('db' => $this->sharedFixture)); $this->assertEquals(array(), $module->getUsersRights()); }
/** * Test getRights function */ public function testGetUsersRights() { $module = new Project_Models_Project(array('db' => $this->sharedFixture)); $module->find(2); $getRights = $module->getUsersRights(); $this->assertTrue($getRights['currentUser']['admin']); $this->assertEquals($getRights['currentUser']['userId'], '1'); $this->assertEquals($getRights['currentUser']['write'], true); $this->assertEquals($getRights[3]['itemId'], 2); $this->assertEquals($getRights[3]['write'], true); $module = new Timecard_Models_Timecard(array('db' => $this->sharedFixture)); $this->assertEquals(array(), $module->getUsersRights()); }