19declare(strict_types=1);
25use PHPUnit\Framework\TestCase;
29 protected \PHPUnit\Framework\MockObject\MockObject
$o;
37 ->getMockBuilder(
Artifact\BuildArtifactObjective::class)
38 ->onlyMethods([
"build",
"buildIn",
"getArtifactName"])
41 $this->artifact = $this->createMock(
Setup\Artifact::class);
42 $this->env = $this->createMock(
Setup\Environment::class);
48 ->getMockBuilder(
Artifact\BuildArtifactObjective::class)
49 ->onlyMethods([
"build",
"getArtifactName"])
53 ->expects($this->once())
56 ->willReturn($this->artifact);
58 $this->assertSame($this->artifact, $this->o->buildIn($this->env));
63 $this->assertEquals([], $this->o->getPreconditions($this->env));
68 $this->assertIsString($this->o->getHash());
73 $name =
"my_artifact";
76 ->expects($this->once())
77 ->method(
"getArtifactName")
81 $this->assertEquals(
"Build $name Artifact", $this->o->getLabel());
86 $this->assertTrue($this->o->isNotable());
92 ->expects($this->once())
95 ->willReturn($this->artifact);
99 ->expects($this->once())
100 ->method(
"serialize")
104 $this->o->achieve($this->env);
106 $path = $this->o::PATH();
113 if (file_exists($this->o::PATH())) {
114 unlink($this->o::PATH());
PHPUnit Framework MockObject MockObject $o
testBuildInDefaultsToBuild()
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
An environment holds resources to be used in the setup process.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...