3declare(strict_types=1);
26use PHPUnit\Framework\TestCase;
27use Symfony\Component\Console\Input\InputInterface;
33 $this->agent_finder = $this->createMock(AgentFinder::class);
34 $this->has_agent =
new class ($this->agent_finder) {
38 $this->agent_finder = $af;
41 public function _getRelevantAgent(
$i)
50 $ii = $this->createMock(InputInterface::class);
51 $ac = $this->createMock(AgentCollection::class);
58 ->expects($this->once())
63 $agent = $this->has_agent->_getRelevantAgent($ii);
65 $this->assertEquals($ac, $agent);
70 $ii = $this->createMock(InputInterface::class);
71 $ac = $this->createMock(AgentCollection::class);
79 ->will($this->returnValueMap([
85 ->expects($this->once())
86 ->method(
"getCoreAgents")
90 $agent = $this->has_agent->_getRelevantAgent($ii);
92 $this->assertEquals($ac, $agent);
97 $ii = $this->createMock(InputInterface::class);
98 $ac = $this->createMock(AgentCollection::class);
102 ->method(
"hasOption")
106 ->method(
"getOption")
107 ->will($this->returnValueMap([
108 [
"no-plugins",
null],
109 [
"plugin",
"foobar"],
114 ->expects($this->once())
115 ->method(
"getPluginAgent")
119 $agent = $this->has_agent->_getRelevantAgent($ii);
121 $this->assertEquals($ac, $agent);
An agent that is just a collection of some other agents.
testGetRelevantAgentWithNoPluginOption()
testGetRelevantAgentWithoutOption()
testGetRelevantAgentWithPluginNameOptions()
__construct()
Constructor setup ILIAS global object @access public.
trait HasAgent
Add this to an Command that has an agent.
getRelevantAgent(InputInterface $input)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...