ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilModulesOrgUnitOperationTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 {
25  public function testOrgUnitOperationConstruction(): void
26  {
27  $operation = new ilOrgUnitOperation();
28  $this->assertInstanceOf(ilOrgUnitOperation::class, $operation);
29  $this->assertEquals(0, $operation->getOperationId());
30  $this->assertEquals('', $operation->getOperationString());
31  $this->assertEquals('', $operation->getDescription());
32  $this->assertEquals(0, $operation->getContextId());
33  $this->assertEquals(0, $operation->getListOrder());
34  }
35 
36  public function testOrgUnitOperationModification(): void
37  {
38  $operation = new ilOrgUnitOperation(666);
39  $this->assertEquals(666, $operation->getOperationId());
40  $this->assertEquals(
42  $operation->withOperationString(ilOrgUnitOperation::OP_MANAGE_MEMBERS)->getOperationString()
43  );
44  $this->assertEquals('This is a test', $operation->withDescription('This is a test')->getDescription());
45  $this->assertEquals(777, $operation->withContextId(777)->getContextId());
46  $this->assertEquals(5, $operation->withListOrder(5)->getListOrder());
47  }
48 }