29 : void
30 {
31 $agent_finder = $this->createMock(Setup\AgentFinder::class);
32
33 $agent = $this->createMock(Setup\AgentCollection::class);
34 $agent_finder
35 ->expects($this->once())
36 ->method("getAgents")
37 ->with()
38 ->willReturn($agent);
39
40 $objective = $this->createMock(Setup\Objective::class);
41 $agent
42 ->expects($this->once())
43 ->method("getBuildObjective")
44 ->with()
45 ->willReturn($objective);
46
47 $objective
48 ->expects($this->once())
49 ->method("getPreconditions")
50 ->willReturn([]);
51
52 $objective
53 ->expects($this->once())
54 ->method("achieve")
55 ->will($this->returnCallback(
function (Setup\Environment
$e) {
57 }));
58
59 $objective
60 ->expects($this->once())
61 ->method("isApplicable")
62 ->willReturn(true);
63
64 $command = new Setup\CLI\BuildCommand($agent_finder);
65 $tester = new CommandTester($command);
66 $tester->execute([]);
67 }