ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\Tests\Setup\ArrayEnvironmentTest Class Reference
+ Inheritance diagram for ILIAS\Tests\Setup\ArrayEnvironmentTest:
+ Collaboration diagram for ILIAS\Tests\Setup\ArrayEnvironmentTest:

Public Member Functions

 setUp ()
 
 testGetResource ()
 
 testWithResource ()
 
 testSetResourceRejectsDuplicates ()
 
 testConfigFor ()
 
 testDuplicateConfigFor ()
 
 testWrongConfigId ()
 

Detailed Description

Definition at line 9 of file ArrayEnvironmentTest.php.

Member Function Documentation

◆ setUp()

ILIAS\Tests\Setup\ArrayEnvironmentTest::setUp ( )

Definition at line 11 of file ArrayEnvironmentTest.php.

11 : void
12 {
13 $this->environment = new Setup\ArrayEnvironment([
14 "foo" => "FOO",
15 "bar" => "BAR"
16 ]);
17 }
environment()
Definition: environment.php:3

References environment().

+ Here is the call graph for this function:

◆ testConfigFor()

ILIAS\Tests\Setup\ArrayEnvironmentTest::testConfigFor ( )

Definition at line 43 of file ArrayEnvironmentTest.php.

44 {
45 $env = $this->environment->withConfigFor("foo", "BAR");
46 $this->assertEquals("BAR", $env->getConfigFor("foo"));
47 }

References environment().

+ Here is the call graph for this function:

◆ testDuplicateConfigFor()

ILIAS\Tests\Setup\ArrayEnvironmentTest::testDuplicateConfigFor ( )

Definition at line 49 of file ArrayEnvironmentTest.php.

50 {
51 $this->expectException(\RuntimeException::class);
52 $env = $this->environment
53 ->withConfigFor("foo", "BAR")
54 ->withConfigFor("foo", "BAZ");
55 }

References environment().

+ Here is the call graph for this function:

◆ testGetResource()

ILIAS\Tests\Setup\ArrayEnvironmentTest::testGetResource ( )

Definition at line 19 of file ArrayEnvironmentTest.php.

20 {
21 $this->assertEquals("FOO", $this->environment->getResource("foo"));
22 $this->assertEquals("BAR", $this->environment->getResource("bar"));
23 $this->assertNull($this->environment->getResource("baz"));
24 }

References environment().

+ Here is the call graph for this function:

◆ testSetResourceRejectsDuplicates()

ILIAS\Tests\Setup\ArrayEnvironmentTest::testSetResourceRejectsDuplicates ( )

Definition at line 35 of file ArrayEnvironmentTest.php.

36 {
37 $this->expectException(\RuntimeException::class);
38
39 $env = $this->environment->withResource("baz", "BAZ");
40 $env->withResource("baz", "BAZ");
41 }

References environment().

+ Here is the call graph for this function:

◆ testWithResource()

ILIAS\Tests\Setup\ArrayEnvironmentTest::testWithResource ( )

Definition at line 26 of file ArrayEnvironmentTest.php.

27 {
28 $env = $this->environment->withResource("baz", "BAZ");
29
30 $this->assertEquals("FOO", $env->getResource("foo"));
31 $this->assertEquals("BAR", $env->getResource("bar"));
32 $this->assertEquals("BAZ", $env->getResource("baz"));
33 }

References environment().

+ Here is the call graph for this function:

◆ testWrongConfigId()

ILIAS\Tests\Setup\ArrayEnvironmentTest::testWrongConfigId ( )

Definition at line 57 of file ArrayEnvironmentTest.php.

58 {
59 $this->expectException(\RuntimeException::class);
60 $env = $this->environment
61 ->getConfigFor("foofoo");
62 }

References environment().

+ Here is the call graph for this function:

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