ILIAS  release_8 Revision v8.24
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{
31
32 public function setUp(): void
33 {
34 $this->config_reader = $this->createMock(ConfigReader::class);
35 $this->has_config_reader = new class ($this->config_reader) {
37 public function __construct($cr)
38 {
39 $this->config_reader = $cr;
40 }
41
42 public function _readAgentConfig(Agent $agent, InputInterface $input, string $use_config_field = null): ?Config
43 {
44 return $this->readAgentConfig($agent, $input, $use_config_field);
45 }
46 };
47 }
48
50 {
51 $agent = $this->createMock(Agent::class);
52 $ii = $this->createMock(InputInterface::class);
53
54 $agent
55 ->method("hasConfig")
56 ->willReturn(false)
57 ;
58
59 $this->assertNull($this->has_config_reader->_readAgentConfig($agent, $ii));
60 }
61}
Read a json-formatted config from a file and overwrite some fields.
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:62
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
trait HasConfigReader
Add this to an Command that has an config reader.
readAgentConfig(Agent $agent, InputInterface $input, string $use_config_field=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...