3 declare(strict_types=1);
39 $this->objective = $this->newObjective();
40 $this->precondition = $this->newObjective();
42 $this->tentatively =
new Objective\Tentatively($this->objective);
43 $this->double_tentatively =
new Objective\Tentatively($this->tentatively);
49 "tentatively " . $this->objective->getHash(),
50 $this->tentatively->getHash()
57 $this->tentatively->getHash(),
58 $this->double_tentatively->getHash()
64 $label =
"some_label";
67 ->expects($this->once())
72 "Tentatively: $label",
73 $this->tentatively->getLabel()
79 $label =
"some_label";
86 $this->tentatively->getLabel(),
87 $this->double_tentatively->getLabel()
96 ->willReturn($notable);
98 $this->assertEquals($notable, $this->tentatively->isNotable());
99 $this->assertEquals($notable, $this->double_tentatively->isNotable());
104 $other = $this->newObjective();
106 $env = $this->createMock(Setup\Environment::class);
109 ->expects($this->once())
110 ->method(
"getPreconditions")
112 ->willReturn([$other]);
116 $this->tentatively->getPreconditions($env)
122 $env = $this->createMock(Setup\Environment::class);
125 ->expects($this->once())
130 $res = $this->tentatively->achieve($env);
131 $this->assertSame($env,
$res);
136 $env = $this->createMock(Setup\Environment::class);
139 ->expects($this->once())
144 $res = $this->tentatively->achieve($env);
145 $this->assertSame($env,
$res);
150 $env = $this->createMock(Setup\Environment::class);
151 $is_applicable = random_int(0, 1) == 1;
154 ->expects($this->once())
155 ->method(
"isApplicable")
157 ->willReturn($is_applicable);
159 $this->assertEquals($is_applicable, $this->tentatively->isApplicable($env));
An objective is a desired state of the system that is supposed to be created by the setup...
Objective Tentatively $double_tentatively
Setup Objective $precondition
Signals that some goal won't be achievable by actions of the system ever.
testDoubleTentativelyGetHash()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A wrapper around an objective that attempts to achieve the wrapped objective but won't stop the proce...
Setup Objective $objective
testDoubleTentativelyGetLabel()
Objective Tentatively $tentatively
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...