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