19 declare(strict_types=1);
28 $this->assertInstanceOf(ilOrgUnitPermission::class, $permission);
29 $this->assertEquals(0, $permission->getId());
31 $this->assertEquals(0, $permission->getContextId());
32 $this->assertEquals(0, $permission->getPositionId());
33 $this->assertEquals([], $permission->getOperations());
34 $this->assertEquals([], $permission->getPossibleOperations());
35 $this->assertEquals([], $permission->getSelectedOperationIds());
36 $this->assertEquals(
null, $permission->getContext());
37 $this->assertEquals(
false, $permission->isProtected());
38 $this->assertEquals(
true, $permission->isTemplate());
39 $this->assertEquals(
false, $permission->isOperationIdSelected(1));
44 $mock_operation = $this->createMock(ilOrgUnitOperation::class);
45 $mock_context = $this->createMock(ilOrgUnitOperationContext::class);
48 $this->assertEquals(666, $permission->getId());
49 $this->assertEquals(777, $permission->withParentId(777)->getParentId());
50 $this->assertEquals(888, $permission->withContextId(888)->getContextId());
51 $this->assertEquals(999, $permission->withPositionId(999)->getPositionId());
52 $this->assertEquals([$mock_operation], $permission->withOperations([$mock_operation])->getOperations());
53 $this->assertEquals([$mock_operation], $permission->withPossibleOperations([$mock_operation])->getPossibleOperations());
54 $this->assertEquals([1,2], $permission->withSelectedOperationIds([1,2])->getSelectedOperationIds());
55 $this->assertEquals($mock_context, $permission->withContext($mock_context)->getContext());
56 $this->assertEquals(
true, $permission->withProtected(
true)->isProtected());
57 $this->assertEquals(
false, $permission->withParentId(777)->isTemplate());
58 $this->assertEquals(
true, $permission->withSelectedOperationIds([1,2])->isOperationIdSelected(1));
testOrgUnitPermissionConstruction()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testOrgUnitPermissionModification()