19 declare(strict_types=1);
40 $this->assertEquals(
"FOO", $this->
environment->getResource(
"foo"));
41 $this->assertEquals(
"BAR", $this->
environment->getResource(
"bar"));
42 $this->assertNull($this->
environment->getResource(
"baz"));
47 $env = $this->
environment->withResource(
"baz",
"BAZ");
49 $this->assertEquals(
"FOO", $env->getResource(
"foo"));
50 $this->assertEquals(
"BAR", $env->getResource(
"bar"));
51 $this->assertEquals(
"BAZ", $env->getResource(
"baz"));
56 $this->expectException(\RuntimeException::class);
58 $env = $this->
environment->withResource(
"baz",
"BAZ");
59 $env->withResource(
"baz",
"BAZ");
64 $env = $this->
environment->withConfigFor(
"foo",
"BAR");
65 $this->assertEquals(
"BAR", $env->getConfigFor(
"foo"));
70 $this->expectException(\RuntimeException::class);
72 ->withConfigFor(
"foo",
"BAR")
73 ->withConfigFor(
"foo",
"BAZ")
79 $this->expectException(\RuntimeException::class);
85 $env = $this->
environment->withConfigFor(
"foo",
"BAR");
86 $this->assertTrue($env->hasConfigFor(
"foo"));
87 $this->assertFalse($env->hasConfigFor(
"bar"));
Setup ArrayEnvironment $environment
testSetResourceRejectsDuplicates()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...