ILIAS  trunk Revision v11.0_alpha-1689-g66c127b4ae8
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilModulesOrgUnitPositionTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
21 
23 {
24  public function testOrgUnitPositionConstruction(): void
25  {
26  $pos = new ilOrgUnitPosition();
27  $this->assertInstanceOf(ilOrgUnitPosition::class, $pos);
28  $this->assertEquals(0, $pos->getId());
29  $this->assertEquals('', $pos->getTitle());
30  $this->assertEquals('', $pos->getDescription());
31  $this->assertEquals(false, $pos->isCorePosition());
32  $this->assertEquals(0, $pos->getCoreIdentifier());
33  $this->assertEquals('', (string) $pos);
34  $this->assertEquals([], $pos->getAuthorities());
35  }
36 
37  public function testOrgUnitPositionModification(): void
38  {
39  $pos = new ilOrgUnitPosition(666);
40  $this->assertEquals(666, $pos->getId());
41  $this->assertEquals('Hello world', $pos->withTitle('Hello world')->getTitle());
42  $this->assertEquals('Hello world', (string) $pos->withTitle('Hello world'));
43  $this->assertEquals('Hello world is a greeting', $pos->withDescription('Hello world is a greeting')->getDescription());
44  $this->assertEquals(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE, $pos->withCoreIdentifier(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE)->getCoreIdentifier());
45  $this->assertEquals(true, $pos->withCorePosition(true)->isCorePosition());
46  }
47 }