ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 
 testHasConfigFor ()
 

Protected Attributes

 $environment
 

Detailed Description

Definition at line 10 of file ArrayEnvironmentTest.php.

Member Function Documentation

◆ setUp()

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

Definition at line 17 of file ArrayEnvironmentTest.php.

References environment().

17  : void
18  {
19  $this->environment = new Setup\ArrayEnvironment([
20  "foo" => "FOO",
21  "bar" => "BAR"
22  ]);
23  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testConfigFor()

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

Definition at line 49 of file ArrayEnvironmentTest.php.

References environment().

49  : void
50  {
51  $env = $this->environment->withConfigFor("foo", "BAR");
52  $this->assertEquals("BAR", $env->getConfigFor("foo"));
53  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testDuplicateConfigFor()

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

Definition at line 55 of file ArrayEnvironmentTest.php.

References environment().

55  : void
56  {
57  $this->expectException(\RuntimeException::class);
58  $this->environment
59  ->withConfigFor("foo", "BAR")
60  ->withConfigFor("foo", "BAZ")
61  ;
62  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testGetResource()

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

Definition at line 25 of file ArrayEnvironmentTest.php.

References environment().

25  : void
26  {
27  $this->assertEquals("FOO", $this->environment->getResource("foo"));
28  $this->assertEquals("BAR", $this->environment->getResource("bar"));
29  $this->assertNull($this->environment->getResource("baz"));
30  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testHasConfigFor()

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

Definition at line 70 of file ArrayEnvironmentTest.php.

References environment().

70  : void
71  {
72  $env = $this->environment->withConfigFor("foo", "BAR");
73  $this->assertTrue($env->hasConfigFor("foo"));
74  $this->assertFalse($env->hasConfigFor("bar"));
75  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testSetResourceRejectsDuplicates()

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

Definition at line 41 of file ArrayEnvironmentTest.php.

References environment().

41  : void
42  {
43  $this->expectException(\RuntimeException::class);
44 
45  $env = $this->environment->withResource("baz", "BAZ");
46  $env->withResource("baz", "BAZ");
47  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testWithResource()

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

Definition at line 32 of file ArrayEnvironmentTest.php.

References environment().

32  : void
33  {
34  $env = $this->environment->withResource("baz", "BAZ");
35 
36  $this->assertEquals("FOO", $env->getResource("foo"));
37  $this->assertEquals("BAR", $env->getResource("bar"));
38  $this->assertEquals("BAZ", $env->getResource("baz"));
39  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testWrongConfigId()

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

Definition at line 64 of file ArrayEnvironmentTest.php.

References environment().

64  : void
65  {
66  $this->expectException(\RuntimeException::class);
67  $this->environment->getConfigFor("foofoo");
68  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

Field Documentation

◆ $environment

ILIAS\Tests\Setup\ArrayEnvironmentTest::$environment
protected

Definition at line 15 of file ArrayEnvironmentTest.php.


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