ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
HasConfigReaderTest.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\Tests\Setup\CLI;
20
21use PHPUnit\Framework\TestCase;
22use Symfony\Component\Console\Input\InputInterface;
27
28class HasConfigReaderTest extends TestCase
29{
32
33 public function setUp(): void
34 {
35 $this->config_reader = $this->createMock(ConfigReader::class);
36 $this->has_config_reader = new class ($this->config_reader) {
38 public function __construct($cr)
39 {
40 $this->config_reader = $cr;
41 }
42
43 public function _readAgentConfig(Agent $agent, InputInterface $input, ?string $use_config_field = null): ?Config
44 {
45 return $this->readAgentConfig($agent, $input, $use_config_field);
46 }
47 };
48 }
49
51 {
52 $agent = $this->createMock(Agent::class);
53 $ii = $this->createMock(InputInterface::class);
54
55 $agent
56 ->method("hasConfig")
57 ->willReturn(false)
58 ;
59
60 $this->assertNull($this->has_config_reader->_readAgentConfig($agent, $ii));
61 }
62}
Read a json-formatted config from a file and overwrite some fields.
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
A agent is some component that performs part of the setup process.
Definition: Agent.php:30
A configuration for the setup.
Definition: Config.php:27
readAgentConfig(Agent $agent, InputInterface $input, ?string $use_config_field=null)
trait HasConfigReader
Add this to an Command that has an config reader.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...