ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
ObjectiveWithPreconditionsTest.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5
namespace
ILIAS\Tests\Setup\Objective
;
6
7
use
ILIAS\Setup
;
8
use
ILIAS\Setup\Objective
;
9
use
ILIAS\Tests\Setup
as
Test
;
10
use
PHPUnit\Framework\TestCase
;
11
12
class
ObjectiveWithPreconditionsTest
extends
TestCase
13
{
14
use
Test\Helper
;
15
19
protected
$objective
;
20
24
protected
$precondition
;
25
29
protected
$with_precondition
;
30
31
public
function
setUp
() : void
32
{
33
$this->objective = $this->newObjective();
34
$this->precondition = $this->newObjective();
35
36
$this->with_precondition =
new
Objective\ObjectiveWithPreconditions(
37
$this->objective,
38
$this->precondition
39
);
40
}
41
42
public
function
testGetHash
() : void
43
{
44
$hash = $this->with_precondition->getHash();
45
$this->assertNotEquals($this->objective->getHash(), $hash);
46
$this->assertNotEquals($this->precondition->getHash(), $hash);
47
}
48
49
public
function
testGetLabel
() : void
50
{
51
$label =
"some_label"
;
52
53
$this->objective
54
->expects($this->once())
55
->method(
"getLabel"
)
56
->willReturn($label);
57
58
$this->assertEquals($label, $this->with_precondition->getLabel());
59
}
60
61
public
function
testIsNotable
() : void
62
{
63
$notable =
true
;
64
65
$this->objective
66
->expects($this->once())
67
->method(
"isNotable"
)
68
->willReturn($notable);
69
70
$this->assertEquals($notable, $this->with_precondition->isNotable());
71
}
72
73
public
function
testGetPreconditions
() : void
74
{
75
$another = $this->newObjective();
76
77
$env = $this->createMock(Setup\Environment::class);
78
79
$this->objective
80
->expects($this->once())
81
->method(
"getPreconditions"
)
82
->with($env)
83
->willReturn([$another]);
84
85
$pre = $this->with_precondition->getPreconditions($env);
86
$this->assertEquals([$this->precondition, $another], $pre);
87
}
88
89
90
public
function
testAchieve
() : void
91
{
92
$env = $this->createMock(Setup\Environment::class);
93
94
$this->objective
95
->expects($this->once())
96
->method(
"achieve"
)
97
->with($env)
98
->willReturn($env);
99
100
$res
= $this->with_precondition->achieve($env);
101
$this->assertSame($env,
$res
);
102
}
103
}
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\testGetLabel
testGetLabel()
Definition:
ObjectiveWithPreconditionsTest.php:49
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\testIsNotable
testIsNotable()
Definition:
ObjectiveWithPreconditionsTest.php:61
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\setUp
setUp()
Definition:
ObjectiveWithPreconditionsTest.php:31
Helper
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\testGetPreconditions
testGetPreconditions()
Definition:
ObjectiveWithPreconditionsTest.php:73
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest
Definition:
ObjectiveWithPreconditionsTest.php:12
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\$precondition
$precondition
Definition:
ObjectiveWithPreconditionsTest.php:24
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\testAchieve
testAchieve()
Definition:
ObjectiveWithPreconditionsTest.php:90
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\testGetHash
testGetHash()
Definition:
ObjectiveWithPreconditionsTest.php:42
ILIAS\Setup\Objective
Definition:
AdminConfirmedObjective.php:5
ILIAS\Setup
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
AdminInteraction.php:5
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\$with_precondition
$with_precondition
Definition:
ObjectiveWithPreconditionsTest.php:29
ILIAS\Tests\Setup\Objective
Definition:
AdminConfirmedObjectiveTest.php:5
ILIAS\Tests\Setup
Definition:
AgentCollectionTest.php:5
TestCase
ILIAS\Tests\Setup\Objective\ObjectiveWithPreconditionsTest\$objective
$objective
Definition:
ObjectiveWithPreconditionsTest.php:19
tests
Setup
Objective
ObjectiveWithPreconditionsTest.php
Generated on Sun Apr 13 2025 21:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)