Definition at line 34 of file SelectSettingTest.php.
◆ testConstruct()
ILIAS\LegalDocuments\test\ConsumerToolbox\SelectSettingTest::testConstruct |
( |
| ) |
|
Definition at line 38 of file SelectSettingTest.php.
40 $this->assertInstanceOf(SelectSetting::class,
new SelectSetting($this->mock(KeyValueStore::class), $this->mock(Marshal::class)));
◆ testTyped()
ILIAS\LegalDocuments\test\ConsumerToolbox\SelectSettingTest::testTyped |
( |
| ) |
|
Definition at line 43 of file SelectSettingTest.php.
References ILIAS\$setting.
45 $read_value =
'a value';
46 $write_value =
'some value';
50 $marshal = $this->mock(Marshal::class);
51 $convert = $this->mockTree(Convert::class, [
52 'fromString' => $this->mockMethod(Transformation::class,
'transform', [$read_value], $value),
53 'toString' => $this->mockMethod(Transformation::class,
'transform', [$set_value], $write_value),
56 $store = $this->mock(KeyValueStore::class);
57 $store->expects(self::once())->method(
'value')->with(
'foo')->willReturn($read_value);
58 $store->expects(self::once())->method(
'update')->with(
'foo', $write_value);
60 $instance =
new SelectSetting($store, $marshal);
61 $setting = $instance->typed(
'foo',
function (Marshal $m) use ($marshal, $convert): Convert {
62 $this->assertSame($marshal, $m);
66 $this->assertSame($value,
$setting->value());
The documentation for this class was generated from the following file: