ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIASSettingStoreTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\LegalDocuments\test\ContainerMock;
24use ilSetting;
26use PHPUnit\Framework\TestCase;
27
28require_once __DIR__ . '/../../ContainerMock.php';
29
30class ILIASSettingStoreTest extends TestCase
31{
32 use ContainerMock;
33
34 public function testConstruct(): void
35 {
36 $this->assertInstanceOf(ILIASSettingStore::class, new ILIASSettingStore($this->mock(ilSetting::class)));
37 }
38
39 public function testValue(): void
40 {
41 $instance = new ILIASSettingStore($this->mockMethod(ilSetting::class, 'get', ['foo', ''], 'bar'));
42
43 $this->assertSame('bar', $instance->value('foo'));
44 }
45
46 public function testUpdate(): void
47 {
48 $settings = $this->mock(ilSetting::class);
49 $settings->expects(self::once())->method('set')->with('foo', 'bar');
50
51 $instance = new ILIASSettingStore($settings);
52
53 $instance->update('foo', 'bar');
54 }
55}
ILIAS Setting Class.