ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References environment().

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

◆ testConfigFor()

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

Definition at line 43 of file ArrayEnvironmentTest.php.

References environment().

44  {
45  $env = $this->environment->withConfigFor("foo", "BAR");
46  $this->assertEquals("BAR", $env->getConfigFor("foo"));
47  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testDuplicateConfigFor()

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

Definition at line 49 of file ArrayEnvironmentTest.php.

References environment().

50  {
51  $this->expectException(\RuntimeException::class);
52  $env = $this->environment
53  ->withConfigFor("foo", "BAR")
54  ->withConfigFor("foo", "BAZ");
55  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testGetResource()

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

Definition at line 19 of file ArrayEnvironmentTest.php.

References environment().

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  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testSetResourceRejectsDuplicates()

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

Definition at line 35 of file ArrayEnvironmentTest.php.

References environment().

36  {
37  $this->expectException(\RuntimeException::class);
38 
39  $env = $this->environment->withResource("baz", "BAZ");
40  $env->withResource("baz", "BAZ");
41  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testWithResource()

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

Definition at line 26 of file ArrayEnvironmentTest.php.

References environment().

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  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

◆ testWrongConfigId()

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

Definition at line 57 of file ArrayEnvironmentTest.php.

References environment().

58  {
59  $this->expectException(\RuntimeException::class);
60  $env = $this->environment
61  ->getConfigFor("foofoo");
62  }
environment()
Definition: environment.php:3
+ Here is the call graph for this function:

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