ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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 9 of file ObjectiveCollectionTest.php.

Member Function Documentation

◆ testAchieve()

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

Definition at line 72 of file ObjectiveCollectionTest.php.

References Vendor\Package\$c, and $res.

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

◆ testGetHash()

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

Definition at line 24 of file ObjectiveCollectionTest.php.

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

◆ testGetLabel()

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

Definition at line 43 of file ObjectiveCollectionTest.php.

References Vendor\Package\$c.

44  {
45  $c = new Setup\ObjectiveCollection("LABEL", false);
46  $this->assertEquals("LABEL", $c->getLabel());
47  }

◆ testGetObjectives()

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

Definition at line 13 of file ObjectiveCollectionTest.php.

References Vendor\Package\$c.

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

◆ testGetPreconditions()

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

Definition at line 57 of file ObjectiveCollectionTest.php.

References Vendor\Package\$c.

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

◆ testIsNotable()

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

Definition at line 49 of file ObjectiveCollectionTest.php.

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

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