ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Tests\Setup\ObjectiveWithPreconditionsTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\ObjectiveWithPreconditionsTest:
+ Collaboration diagram for ILIAS\Tests\Setup\ObjectiveWithPreconditionsTest:

Public Member Functions

 setUp ()
 
 testGetHash ()
 
 testGetLabel ()
 
 testIsNotable ()
 
 testGetPreconditions ()
 
 testAchieve ()
 

Detailed Description

Definition at line 9 of file ObjectiveWithPreconditionsTest.php.

Member Function Documentation

◆ setUp()

ILIAS\Tests\Setup\ObjectiveWithPreconditionsTest::setUp ( )

Definition at line 13 of file ObjectiveWithPreconditionsTest.php.

13  : void
14  {
15  $this->objective = $this->newObjective();
16  $this->precondition = $this->newObjective();
17 
18  $this->with_precondition = new Setup\ObjectiveWithPreconditions(
19  $this->objective,
20  $this->precondition
21  );
22  }

◆ testAchieve()

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

Definition at line 70 of file ObjectiveWithPreconditionsTest.php.

References $res.

71  {
72  $env = $this->createMock(Setup\Environment::class);
73 
74  $this->objective
75  ->expects($this->once())
76  ->method("achieve")
77  ->with($env)
78  ->willReturn($env);
79 
80  $res = $this->with_precondition->achieve($env);
81  $this->assertSame($env, $res);
82  }
foreach($_POST as $key=> $value) $res

◆ testGetHash()

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

Definition at line 24 of file ObjectiveWithPreconditionsTest.php.

25  {
26  $this->assertEquals($this->objective->getHash(), $this->with_precondition->getHash());
27  }

◆ testGetLabel()

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

Definition at line 29 of file ObjectiveWithPreconditionsTest.php.

30  {
31  $label = "some_label";
32 
33  $this->objective
34  ->expects($this->once())
35  ->method("getLabel")
36  ->willReturn($label);
37 
38  $this->assertEquals($label, $this->with_precondition->getLabel());
39  }

◆ testGetPreconditions()

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

Definition at line 53 of file ObjectiveWithPreconditionsTest.php.

54  {
55  $another = $this->newObjective();
56 
57  $env = $this->createMock(Setup\Environment::class);
58 
59  $this->objective
60  ->expects($this->once())
61  ->method("getPreconditions")
62  ->with($env)
63  ->willReturn([$another]);
64 
65  $pre = $this->with_precondition->getPreconditions($env);
66  $this->assertEquals([$this->precondition, $another], $pre);
67  }

◆ testIsNotable()

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

Definition at line 41 of file ObjectiveWithPreconditionsTest.php.

42  {
43  $notable = true;
44 
45  $this->objective
46  ->expects($this->once())
47  ->method("isNotable")
48  ->willReturn($notable);
49 
50  $this->assertEquals($notable, $this->with_precondition->isNotable());
51  }

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