ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest:
+ Collaboration diagram for ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest:

Public Member Functions

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

Protected Attributes

Setup Objective $objective
 
Setup Objective $precondition
 
Objective ObjectiveWithPreconditions $with_precondition
 

Detailed Description

Definition at line 30 of file ObjectiveWithPreconditionsTest.php.

Member Function Documentation

◆ setUp()

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

Definition at line 38 of file ObjectiveWithPreconditionsTest.php.

38  : void
39  {
40  $this->objective = $this->newObjective();
41  $this->precondition = $this->newObjective();
42 
43  $this->with_precondition = new Objective\ObjectiveWithPreconditions(
44  $this->objective,
45  $this->precondition
46  );
47  }

◆ testAchieve()

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

Definition at line 97 of file ObjectiveWithPreconditionsTest.php.

References $res.

97  : void
98  {
99  $env = $this->createMock(Setup\Environment::class);
100 
101  $this->objective
102  ->expects($this->once())
103  ->method("achieve")
104  ->with($env)
105  ->willReturn($env);
106 
107  $res = $this->with_precondition->achieve($env);
108  $this->assertSame($env, $res);
109  }
$res
Definition: ltiservices.php:66

◆ testGetHash()

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

Definition at line 49 of file ObjectiveWithPreconditionsTest.php.

49  : void
50  {
51  $hash = $this->with_precondition->getHash();
52  $this->assertNotEquals($this->objective->getHash(), $hash);
53  $this->assertNotEquals($this->precondition->getHash(), $hash);
54  }

◆ testGetLabel()

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

Definition at line 56 of file ObjectiveWithPreconditionsTest.php.

56  : void
57  {
58  $label = "some_label";
59 
60  $this->objective
61  ->expects($this->once())
62  ->method("getLabel")
63  ->willReturn($label);
64 
65  $this->assertEquals($label, $this->with_precondition->getLabel());
66  }

◆ testGetPreconditions()

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

Definition at line 80 of file ObjectiveWithPreconditionsTest.php.

80  : void
81  {
82  $another = $this->newObjective();
83 
84  $env = $this->createMock(Setup\Environment::class);
85 
86  $this->objective
87  ->expects($this->once())
88  ->method("getPreconditions")
89  ->with($env)
90  ->willReturn([$another]);
91 
92  $pre = $this->with_precondition->getPreconditions($env);
93  $this->assertEquals([$this->precondition, $another], $pre);
94  }

◆ testIsNotable()

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

Definition at line 68 of file ObjectiveWithPreconditionsTest.php.

68  : void
69  {
70  $notable = true;
71 
72  $this->objective
73  ->expects($this->once())
74  ->method("isNotable")
75  ->willReturn($notable);
76 
77  $this->assertEquals($notable, $this->with_precondition->isNotable());
78  }

Field Documentation

◆ $objective

Setup Objective ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest::$objective
protected

Definition at line 34 of file ObjectiveWithPreconditionsTest.php.

◆ $precondition

Setup Objective ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest::$precondition
protected

Definition at line 35 of file ObjectiveWithPreconditionsTest.php.

◆ $with_precondition

Objective ObjectiveWithPreconditions ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest::$with_precondition
protected

Definition at line 36 of file ObjectiveWithPreconditionsTest.php.


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