ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 28 of file ObjectiveCollectionTest.php.

Member Function Documentation

◆ testAchieve()

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

Definition at line 91 of file ObjectiveCollectionTest.php.

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

References $c, and $res.

◆ testGetHash()

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

Definition at line 43 of file ObjectiveCollectionTest.php.

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

◆ testGetLabel()

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

Definition at line 62 of file ObjectiveCollectionTest.php.

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

References $c.

◆ testGetObjectives()

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

Definition at line 32 of file ObjectiveCollectionTest.php.

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

References $c.

◆ testGetPreconditions()

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

Definition at line 76 of file ObjectiveCollectionTest.php.

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

References $c.

◆ testIsNotable()

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

Definition at line 68 of file ObjectiveCollectionTest.php.

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

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