10use PHPUnit\Framework\TestCase;
33 $this->objective = $this->newObjective();
34 $this->precondition = $this->newObjective();
44 $hash = $this->with_precondition->getHash();
45 $this->assertNotEquals($this->objective->getHash(), $hash);
46 $this->assertNotEquals($this->precondition->getHash(), $hash);
51 $label =
"some_label";
54 ->expects($this->once())
58 $this->assertEquals($label, $this->with_precondition->getLabel());
66 ->expects($this->once())
68 ->willReturn($notable);
70 $this->assertEquals($notable, $this->with_precondition->isNotable());
75 $another = $this->newObjective();
77 $env = $this->createMock(Setup\Environment::class);
80 ->expects($this->once())
81 ->method(
"getPreconditions")
83 ->willReturn([$another]);
85 $pre = $this->with_precondition->getPreconditions($env);
86 $this->assertEquals([$this->precondition, $another], $pre);
92 $env = $this->createMock(Setup\Environment::class);
95 ->expects($this->once())
100 $res = $this->with_precondition->achieve($env);
101 $this->assertSame($env,
$res);
An exception for terminatinating execution or to throw for unit testing.
A wrapper around an objective that adds some preconditions.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
foreach($_POST as $key=> $value) $res