ILIAS  release_8 Revision v8.24
ILIAS\Tests\Setup\ObjectiveCollectionTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\ObjectiveCollectionTest:
+ Collaboration diagram for ILIAS\Tests\Setup\ObjectiveCollectionTest:

Public Member Functions

 testGetObjectives ()
 
 testGetHash ()
 
 testGetLabel ()
 
 testIsNotable ()
 
 testGetPreconditions ()
 
 testAchieve ()
 

Detailed Description

Definition at line 26 of file ObjectiveCollectionTest.php.

Member Function Documentation

◆ testAchieve()

ILIAS\Tests\Setup\ObjectiveCollectionTest::testAchieve ( )

Definition at line 89 of file ObjectiveCollectionTest.php.

89 : void
90 {
91 $g1 = $this->newObjective();
92 $g2 = $this->newObjective();
93 $g3 = $this->newObjective();
94
95 $c = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
96
97 $env = $this->createMock(Setup\Environment::class);
98
99 foreach ([$g1,$g2,$g3] as $g) {
100 $g
101 ->expects($this->never())
102 ->method("achieve");
103 }
104
105 $res = $c->achieve($env);
106 $this->assertSame($env, $res);
107 }
$c
Definition: cli.php:38
$res
Definition: ltiservices.php:69

References $c, and $res.

◆ testGetHash()

ILIAS\Tests\Setup\ObjectiveCollectionTest::testGetHash ( )

Definition at line 41 of file ObjectiveCollectionTest.php.

41 : void
42 {
43 $g1 = $this->newObjective();
44 $g2 = $this->newObjective();
45 $g3 = $this->newObjective();
46
47 $c1 = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
48 $c2 = new Setup\ObjectiveCollection("", false, $g1, $g2);
49 $c3 = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
50
51 $this->assertIsString($c1->getHash());
52 $this->assertIsString($c2->getHash());
53 $this->assertIsString($c3->getHash());
54
55 $this->assertEquals($c1->getHash(), $c1->getHash());
56 $this->assertNotEquals($c1->getHash(), $c2->getHash());
57 $this->assertEquals($c1->getHash(), $c3->getHash());
58 }

◆ testGetLabel()

ILIAS\Tests\Setup\ObjectiveCollectionTest::testGetLabel ( )

Definition at line 60 of file ObjectiveCollectionTest.php.

60 : void
61 {
62 $c = new Setup\ObjectiveCollection("LABEL", false);
63 $this->assertEquals("LABEL", $c->getLabel());
64 }

References $c.

◆ testGetObjectives()

ILIAS\Tests\Setup\ObjectiveCollectionTest::testGetObjectives ( )

Definition at line 30 of file ObjectiveCollectionTest.php.

30 : void
31 {
32 $g1 = $this->newObjective();
33 $g2 = $this->newObjective();
34 $g3 = $this->newObjective();
35
36 $c = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
37
38 $this->assertEquals([$g1, $g2, $g3], $c->getObjectives());
39 }

References $c.

◆ testGetPreconditions()

ILIAS\Tests\Setup\ObjectiveCollectionTest::testGetPreconditions ( )

Definition at line 74 of file ObjectiveCollectionTest.php.

74 : void
75 {
76 $g1 = $this->newObjective();
77 $g2 = $this->newObjective();
78 $g3 = $this->newObjective();
79
80 $c = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
81
82 $env = $this->createMock(Setup\Environment::class);
83
84 $pre = $c->getPreconditions($env);
85 $this->assertEquals([$g1,$g2, $g3], $pre);
86 }

References $c.

◆ testIsNotable()

ILIAS\Tests\Setup\ObjectiveCollectionTest::testIsNotable ( )

Definition at line 66 of file ObjectiveCollectionTest.php.

66 : void
67 {
68 $c1 = new Setup\ObjectiveCollection("", false);
69 $c2 = new Setup\ObjectiveCollection("", true);
70 $this->assertFalse($c1->isNotable());
71 $this->assertTrue($c2->isNotable());
72 }

The documentation for this class was generated from the following file: