19declare(strict_types=1);
26use PHPUnit\Framework\TestCase;
27use Symfony\Component\Console\Input\InputInterface;
36 $this->agent_finder = $this->createMock(AgentFinder::class);
41 $this->agent_finder = $af;
44 public function _getRelevantAgent($i)
53 $ii = $this->createMock(InputInterface::class);
54 $ac = $this->createMock(AgentCollection::class);
61 ->expects($this->once())
66 $agent = $this->has_agent->_getRelevantAgent($ii);
68 $this->assertEquals($ac, $agent);
73 $ii = $this->createMock(InputInterface::class);
74 $ac = $this->createMock(AgentCollection::class);
82 ->will($this->returnValueMap([
83 [
"no-legacy-plugins",
true],
84 [
"skip-legacy-plugin",
null]
88 ->expects($this->once())
89 ->method(
"getComponentAgents")
93 $agent = $this->has_agent->_getRelevantAgent($ii);
95 $this->assertEquals($ac, $agent);
100 $ii = $this->createMock(InputInterface::class);
101 $ac = $this->createMock(AgentCollection::class);
105 ->method(
"hasOption")
109 ->method(
"getOption")
110 ->will($this->returnValueMap([
111 [
"no-legacy-plugins",
null],
112 [
"legacy-plugin",
"foobar"],
113 [
"skip-legacy-plugin",
null]
117 ->expects($this->once())
118 ->method(
"getPluginAgent")
122 $agent = $this->has_agent->_getRelevantAgent($ii);
124 $this->assertEquals($ac, $agent);
An agent that is just a collection of some other agents.
testGetRelevantAgentWithNoPluginOption()
testGetRelevantAgentWithoutOption()
AgentFinder $agent_finder
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...