10use PHPUnit\Framework\TestCase;
11use Symfony\Component\Console\Input\InputInterface;
17 $this->agent_finder = $this->createMock(AgentFinder::class);
18 $this->has_agent =
new class($this->agent_finder) {
22 $this->agent_finder = $af;
25 public function _getRelevantAgent(
$i)
34 $ii = $this->createMock(InputInterface::class);
35 $ac = $this->createMock(AgentCollection::class);
42 ->expects($this->once())
47 $agent = $this->has_agent->_getRelevantAgent($ii);
49 $this->assertEquals($ac, $agent);
54 $ii = $this->createMock(InputInterface::class);
55 $ac = $this->createMock(AgentCollection::class);
63 ->will($this->returnValueMap([
69 ->expects($this->once())
70 ->method(
"getCoreAgents")
74 $agent = $this->has_agent->_getRelevantAgent($ii);
76 $this->assertEquals($ac, $agent);
81 $ii = $this->createMock(InputInterface::class);
82 $ac = $this->createMock(AgentCollection::class);
91 ->will($this->returnValueMap([
98 ->expects($this->once())
99 ->method(
"getPluginAgent")
103 $agent = $this->has_agent->_getRelevantAgent($ii);
105 $this->assertEquals($ac, $agent);
An exception for terminatinating execution or to throw for unit testing.
An agent that is just a collection of some other agents.
testGetRelevantAgentWithNoPluginOption()
testGetRelevantAgentWithoutOption()
testGetRelevantAgentWithPluginNameOptions()
__construct($a_client_id=0)
Constructor setup ILIAS global object @access public.
trait HasAgent
Add this to an Command that has an agent.
getRelevantAgent(InputInterface $input)