ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ObjectiveConstructorTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20namespace ILIAS\Tests\Setup;
21
22use PHPUnit\Framework\TestCase;
26
32class ObjectiveConstructorTest extends TestCase
33{
36 private \Closure $closure;
37
38 protected function setUp(): void
39 {
40 parent::setUp();
41 $this->objectiveCollection = new ObjectiveCollection(
42 "",
43 false,
44 new NullObjective()
45 );
46
47 $this->closure = function (): ObjectiveCollection {
49 };
50
51 $this->testObj = new ObjectiveConstructor(
52 "My description",
53 $this->closure
54 );
55 }
56
57 public function testGetDescription(): void
58 {
59 $this->assertEquals(
60 "My description",
61 $this->testObj->getDescription()
62 );
63 }
64
65 public function testCreate(): void
66 {
67 $this->assertEquals($this->objectiveCollection, $this->testObj->create());
68 }
69}
A objective collection is a objective that is achieved once all subobjectives are achieved.
A non-objective, nothing to do to achieve it...