ILIAS  release_7 Revision v7.30-3-g800a261c036
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 10 of file ObjectiveCollectionTest.php.

Member Function Documentation

◆ testAchieve()

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

Definition at line 73 of file ObjectiveCollectionTest.php.

References $c, and $res.

73  : void
74  {
75  $g1 = $this->newObjective();
76  $g2 = $this->newObjective();
77  $g3 = $this->newObjective();
78 
79  $c = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
80 
81  $env = $this->createMock(Setup\Environment::class);
82 
83  foreach ([$g1,$g2,$g3] as $g) {
84  $g
85  ->expects($this->never())
86  ->method("achieve");
87  }
88 
89  $res = $c->achieve($env);
90  $this->assertSame($env, $res);
91  }
$c
Definition: cli.php:37
foreach($_POST as $key=> $value) $res

◆ testGetHash()

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

Definition at line 25 of file ObjectiveCollectionTest.php.

25  : void
26  {
27  $g1 = $this->newObjective();
28  $g2 = $this->newObjective();
29  $g3 = $this->newObjective();
30 
31  $c1 = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
32  $c2 = new Setup\ObjectiveCollection("", false, $g1, $g2);
33  $c3 = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
34 
35  $this->assertIsString($c1->getHash());
36  $this->assertIsString($c2->getHash());
37  $this->assertIsString($c3->getHash());
38 
39  $this->assertEquals($c1->getHash(), $c1->getHash());
40  $this->assertNotEquals($c1->getHash(), $c2->getHash());
41  $this->assertEquals($c1->getHash(), $c3->getHash());
42  }

◆ testGetLabel()

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

Definition at line 44 of file ObjectiveCollectionTest.php.

References $c.

44  : void
45  {
46  $c = new Setup\ObjectiveCollection("LABEL", false);
47  $this->assertEquals("LABEL", $c->getLabel());
48  }
$c
Definition: cli.php:37

◆ testGetObjectives()

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

Definition at line 14 of file ObjectiveCollectionTest.php.

References $c.

14  : void
15  {
16  $g1 = $this->newObjective();
17  $g2 = $this->newObjective();
18  $g3 = $this->newObjective();
19 
20  $c = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
21 
22  $this->assertEquals([$g1, $g2, $g3], $c->getObjectives());
23  }
$c
Definition: cli.php:37

◆ testGetPreconditions()

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

Definition at line 58 of file ObjectiveCollectionTest.php.

References $c.

58  : void
59  {
60  $g1 = $this->newObjective();
61  $g2 = $this->newObjective();
62  $g3 = $this->newObjective();
63 
64  $c = new Setup\ObjectiveCollection("", false, $g1, $g2, $g3);
65 
66  $env = $this->createMock(Setup\Environment::class);
67 
68  $pre = $c->getPreconditions($env);
69  $this->assertEquals([$g1,$g2, $g3], $pre);
70  }
$c
Definition: cli.php:37

◆ testIsNotable()

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

Definition at line 50 of file ObjectiveCollectionTest.php.

50  : void
51  {
52  $c1 = new Setup\ObjectiveCollection("", false);
53  $c2 = new Setup\ObjectiveCollection("", true);
54  $this->assertFalse($c1->isNotable());
55  $this->assertTrue($c2->isNotable());
56  }

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