3declare(strict_types=1);
25use PHPUnit\Framework\TestCase;
29 protected \PHPUnit\Framework\MockObject\MockObject
$o;
37 ->getMockBuilder(
Artifact\BuildArtifactObjective::class)
38 ->onlyMethods([
"build",
"buildIn",
"getArtifactPath"])
41 $this->artifact = $this->createMock(Setup\Artifact::class);
42 $this->env = $this->createMock(Setup\Environment::class);
48 ->getMockBuilder(
Artifact\BuildArtifactObjective::class)
49 ->onlyMethods([
"build",
"getArtifactPath"])
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 $path =
"path/to/artifact";
71 ->expects($this->once())
72 ->method(
"getArtifactPath")
76 $this->assertIsString($this->o->getHash());
81 $path =
"path/to/artifact";
84 ->expects($this->once())
85 ->method(
"getArtifactPath")
89 $this->assertEquals(
"Build $path", $this->o->getLabel());
94 $this->assertTrue($this->o->isNotable());
97 public const TEST_PATH =
"BuildArtifactObjectiveTest_testAchive";
103 ->expects($this->atLeastOnce())
104 ->method(
"getArtifactPath")
109 ->expects($this->once())
112 ->willReturn($this->artifact);
116 ->expects($this->once())
117 ->method(
"serialize")
121 $this->o->achieve($this->env);
128 if (file_exists(getcwd() .
"/" . self::TEST_PATH)) {
129 unlink(getcwd() .
"/" . self::TEST_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...
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...