19 declare(strict_types=1);
21 require_once
'./vendor/composer/vendor/autoload.php';
22 require_once
'./components/ILIAS/UI/tests/Base.php';
39 return new Data\Factory();
45 $this->createMock(
ILIAS\Language\Language::class)
50 return new VC\Factory(
51 new I\SignalGenerator(),
57 return new FieldFactory(
58 $this->createMock(UploadLimitResolver::class),
59 new I\SignalGenerator(),
68 return new Control\Factory(
72 new I\SignalGenerator(),
80 $this->assertInstanceOf(
VC\ViewControl::class, $vc);
81 $this->assertInstanceOf(
I\Signal::class, $vc->getSubmissionSignal());
88 $c_factory->fieldSelection([]),
89 $c_factory->sortation([]),
90 $c_factory->pagination()
95 $this->assertSameSize($controls, $vc->getInputs());
98 fn($input) => $input->withNameFrom($name_source,
'view_control'),
102 $this->assertEquals($named, $vc->getInputs());
107 $request = $this->createMock(ServerRequestInterface::class);
109 ->expects($this->once())
110 ->method(
"getQueryParams")
112 'view_control/input_0' => [
'a1',
'a3'],
113 'view_control/input_1/input_2' =>
'a2',
114 'view_control/input_1/input_3' =>
'DESC' 119 $c_factory->fieldSelection([
'a1' =>
'A',
'a2' =>
'B',
'a3' =>
'C']),
120 $c_factory->sortation([
127 $vc2 = $vc->withRequest($request);
128 $this->assertNotSame($vc2, $vc);
130 $data = $vc2->getData();
131 $this->assertSameSize($controls,
$data);
137 $this->assertEquals($expected, array_values(
$data));
142 $this->expectException(\LogicException::class);
146 $c_factory->fieldSelection([
'a1' =>
'A',
'a2' =>
'B',
'a3' =>
'C'])
149 $this->getDefaultRenderer()->render($vc);
154 $transform = $this->
buildRefinery()->custom()->transformation(
155 fn($v) => [
'modified' =>
'transformed']
158 $request = $this->createMock(ServerRequestInterface::class);
159 $request->expects($this->once())
160 ->method(
"getQueryParams")
161 ->willReturn([
'some' =>
'data']);
167 ->withAdditionalTransformation($transform)
168 ->withRequest($request);
171 $expected = [
'modified' =>
'transformed'];
172 $this->assertEquals($expected, $vc->getData());
179 $c_factory->fieldSelection([
'a1' =>
'A',
'a2' =>
'B',
'a3' =>
'C'])
180 ->withValue([
'a1',
'a3']),
181 $c_factory->sortation([
184 ])->withValue([
'a2',
'DESC']),
188 $data = $vc->getComponentInternalValues();
192 'view_control/input_0' => [
'a1',
'a3'],
193 'view_control/input_1/input_2' =>
'a2',
194 'view_control/input_1/input_3' =>
'DESC'
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
Both the subject and the direction need to be specified when expressing an order. ...
testViewControlContainerTransforms()
testViewControlContainerConstruct()
testViewControlContainerWithRequest()
testViewControlContainerWithControls()
testViewControlContainerRenderWithoutRequest()
testExtractCurrentValues()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...