ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ ilDoc Overview
SettingTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\LegalDocuments\test\ConsumerToolbox
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\LegalDocuments\ConsumerToolbox\Setting
;
25
use
stdClass
;
26
27
class
SettingTest
extends
TestCase
28
{
29
public
function
testConstruct
(): void
30
{
31
$this->assertInstanceOf(Setting::class,
new
Setting
($this->fail(...), $this->fail(...)));
32
}
33
34
public
function
testValue
(): void
35
{
36
$value =
new
stdClass
();
37
$instance =
new
Setting
(fn() => $value, $this->fail(...));
38
$this->assertSame($value, $instance->value());
39
}
40
41
public
function
testUpdate
(): void
42
{
43
$value =
new
stdClass
();
44
45
$instance =
new
Setting
($this->fail(...),
function
($x) use (&$called, $value):
void
{
46
$called =
true
;
47
$this->assertSame($value, $x);
48
});
49
50
$instance->
update
($value);
51
$this->assertTrue($called);
52
}
53
}
ILIAS\LegalDocuments\test\ConsumerToolbox\SettingTest
Definition:
SettingTest.php:27
stdClass
ILIAS\LegalDocuments\test\ConsumerToolbox
Definition:
BlocksTest.php:21
ILIAS\LegalDocuments\ConsumerToolbox\Setting\update
update($value)
Definition:
Setting.php:51
Setting
ILIAS\LegalDocuments\test\ConsumerToolbox\SettingTest\testUpdate
testUpdate()
Definition:
SettingTest.php:41
ILIAS\LegalDocuments\ConsumerToolbox\Setting
A
Definition:
Setting.php:28
ILIAS\LegalDocuments\test\ConsumerToolbox\SettingTest\testValue
testValue()
Definition:
SettingTest.php:34
ILIAS\LegalDocuments\test\ConsumerToolbox\SettingTest\testConstruct
testConstruct()
Definition:
SettingTest.php:29
TestCase
components
ILIAS
LegalDocuments
tests
ConsumerToolbox
SettingTest.php
Generated on Mon Sep 1 2025 23:03:24 for ILIAS by
1.8.13 (using
Doxyfile
)