ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ConfigCollectionTest.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5namespace ILIAS\Tests\Setup;
6
8
9class ConfigCollectionTest extends \PHPUnit\Framework\TestCase
10{
11 use Helper;
12
13 public function testConstruct()
14 {
15 $c1 = $this->newConfig();
16 $c2 = $this->newConfig();
17 $c3 = $this->newConfig();
18
19 $c = new Setup\ConfigCollection(["c1" => $c1, "c2" => $c2, "c3" => $c3]);
20
21 $this->assertInstanceOf(Setup\Config::class, $c);
22 }
23
24 public function testGetConfig()
25 {
26 $c1 = $this->newConfig();
27 $c2 = $this->newConfig();
28 $c3 = $this->newConfig();
29
30 $c = new Setup\ConfigCollection(["c1" => $c1, "c2" => $c2, "c3" => $c3]);
31
32 $this->assertEquals($c1, $c->getConfig("c1"));
33 $this->assertEquals($c2, $c->getConfig("c2"));
34 $this->assertEquals($c3, $c->getConfig("c3"));
35 }
36
37 public function testGetKeys()
38 {
39 $c1 = $this->newConfig();
40 $c2 = $this->newConfig();
41 $c3 = $this->newConfig();
42
43 $c = new Setup\ConfigCollection(["c1" => $c1, "c2" => $c2, "c3" => $c3]);
44
45 $this->assertEquals(["c1", "c2", "c3"], $c->getKeys());
46 }
47}
An exception for terminatinating execution or to throw for unit testing.
A collection of some configurations.