ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Tests\Setup\CLI\HasConfigReaderTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\CLI\HasConfigReaderTest:
+ Collaboration diagram for ILIAS\Tests\Setup\CLI\HasConfigReaderTest:

Public Member Functions

 setUp ()
 
 testReadAgentConfigWithoutConfig ()
 

Protected Attributes

ConfigReader $config_reader
 
 $has_config_reader
 

Detailed Description

Definition at line 28 of file HasConfigReaderTest.php.

Member Function Documentation

◆ setUp()

ILIAS\Tests\Setup\CLI\HasConfigReaderTest::setUp ( )

Definition at line 33 of file HasConfigReaderTest.php.

References ILIAS\Tests\Setup\CLI\HasConfigReaderTest\$config_reader, ILIAS\__construct(), ILIAS\Setup\CLI\HasConfigReader, null, and ILIAS\Setup\CLI\readAgentConfig().

33  : void
34  {
35  $this->config_reader = $this->createMock(ConfigReader::class);
36  $this->has_config_reader = new class ($this->config_reader) {
37  use HasConfigReader;
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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
readAgentConfig(Agent $agent, InputInterface $input, ?string $use_config_field=null)
trait HasConfigReader
Add this to an Command that has an config reader.
+ Here is the call graph for this function:

◆ testReadAgentConfigWithoutConfig()

ILIAS\Tests\Setup\CLI\HasConfigReaderTest::testReadAgentConfigWithoutConfig ( )

Definition at line 50 of file HasConfigReaderTest.php.

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  }

Field Documentation

◆ $config_reader

ConfigReader ILIAS\Tests\Setup\CLI\HasConfigReaderTest::$config_reader
protected

◆ $has_config_reader

ILIAS\Tests\Setup\CLI\HasConfigReaderTest::$has_config_reader
protected

Definition at line 31 of file HasConfigReaderTest.php.


The documentation for this class was generated from the following file: