19declare(strict_types=1);
23require_once(__DIR__ .
"/../Helper.php");
28use PHPUnit\Framework\TestCase;
41 $this->objective = $this->newObjective();
42 $this->precondition = $this->newObjective();
51 "tentatively " . $this->objective->getHash(),
52 $this->tentatively->getHash()
59 $this->tentatively->getHash(),
60 $this->double_tentatively->getHash()
66 $label =
"some_label";
69 ->expects($this->once())
74 "Tentatively: $label",
75 $this->tentatively->getLabel()
81 $label =
"some_label";
88 $this->tentatively->getLabel(),
89 $this->double_tentatively->getLabel()
98 ->willReturn($notable);
100 $this->assertEquals($notable, $this->tentatively->isNotable());
101 $this->assertEquals($notable, $this->double_tentatively->isNotable());
106 $other = $this->newObjective();
108 $env = $this->createMock(
Setup\Environment::class);
111 ->expects($this->once())
112 ->method(
"getPreconditions")
114 ->willReturn([$other]);
118 $this->tentatively->getPreconditions($env)
124 $env = $this->createMock(
Setup\Environment::class);
127 ->expects($this->once())
132 $res = $this->tentatively->achieve($env);
133 $this->assertSame($env,
$res);
138 $env = $this->createMock(
Setup\Environment::class);
141 ->expects($this->once())
146 $res = $this->tentatively->achieve($env);
147 $this->assertSame($env,
$res);
152 $env = $this->createMock(
Setup\Environment::class);
153 $is_applicable = random_int(0, 1) == 1;
156 ->expects($this->once())
157 ->method(
"isApplicable")
159 ->willReturn($is_applicable);
161 $this->assertEquals($is_applicable, $this->tentatively->isApplicable($env));
A wrapper around an objective that attempts to achieve the wrapped objective but won't stop the proce...
Signals that some goal won't be achievable by actions of the system ever.
testDoubleTentativelyGetLabel()
Setup Objective $precondition
Objective Tentatively $double_tentatively
testDoubleTentativelyGetHash()
Objective Tentatively $tentatively
Setup Objective $objective
An objective is a desired state of the system that is supposed to be created by the setup.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...