19declare(strict_types=1);
29require_once(
'ViewControlTestBase.php');
36 'A' =>
new Order(
'opt',
'ASC'),
37 'B' =>
new Order(
'opt',
'DESC')
40 $r = ILIAS\UI\Implementation\Component\Input\ViewControl\Renderer::class;
42 $this->assertInstanceOf(Signal::class, $vc->getInternalSignal());
43 $this->assertEquals(
$options, $vc->getOptions());
48 $this->expectException(\InvalidArgumentException::class);
50 'A' =>
new Order(
'opt',
'ASC'),
51 'B' =>
new Order(
'opt',
'DESC')
54 ->withValue(
'notokvalue:DESC');
60 'A' =>
new Order(
'opt',
'ASC'),
61 'B' =>
new Order(
'opt',
'DESC')
65 $input = $this->createMock(InputData::class);
66 $input->expects($this->exactly(2))
68 ->willReturnOnConsecutiveCalls($v[0], $v[1]);
76 $df->ok($df->order(
'opt',
'DESC')),
79 $this->assertEquals($v, $vc->getValue());
84 $r = $this->getDefaultRenderer();
86 'A' =>
new Order(
'opt',
'ASC'),
87 'B' =>
new Order(
'opt',
'DESC')
92 $expected = $this->brutallyTrimHTML(
'
93<div class="dropdown il-viewcontrol il-viewcontrol-sortation l-bar__element" id="id_3">
94 <button class="btn btn-ctrl dropdown-toggle" type="button" data-toggle="dropdown" aria-label="label_sortation" aria-haspopup="true" aria-expanded="false" aria-controls="id_3_ctrl"><span class="glyphicon-sort"></span></button>
95 <ul id="id_3_ctrl" class="dropdown-menu">
96 <li><button class="btn btn-link" id="id_1">A</button></li>
97 <li><button class="btn btn-link" id="id_2">B</button></li>
99 <div class="il-viewcontrol-value" role="none">
100 <input id="id_4" type="hidden" value="" />
101 <input id="id_5" type="hidden" value="" />
105 $html = $this->brutallyTrimHTML($r->render($vc));
106 $this->assertEquals($expected, $html);
112 $this->expectException(\LogicException::class);
119 $r = $this->getDefaultRenderer();
121 'A' =>
new Order(
'opt',
'ASC'),
122 'B' =>
new Order(
'opt',
'DESC')
127 $expected = $this->brutallyTrimHTML(
'
128<div class="dropdown il-viewcontrol il-viewcontrol-sortation l-bar__element" id="id_3">
129 <button class="btn btn-ctrl dropdown-toggle" type="button" data-toggle="dropdown" aria-label="label_sortation" aria-haspopup="true" aria-expanded="false" aria-controls="id_3_ctrl"><span class="glyphicon-sort"></span></button>
130 <ul id="id_3_ctrl" class="dropdown-menu">
131 <li><button class="btn btn-link" id="id_1">A</button></li>
132 <li><button class="btn btn-link" id="id_2">B</button></li>
134 <div class="il-viewcontrol-value" role="none">
135 <input id="id_4" type="hidden" value="" />
136 <input id="id_5" type="hidden" value="" />
140 $html = $this->brutallyTrimHTML($r->render($vc));
141 $this->assertEquals($expected, $html);
Both the subject and the direction need to be specified when expressing an order.
testViewControlFieldSortationRendering()
testViewControlFieldWithSignalsRendering()
testViewControlSortationWithWrongValue()
testViewControlSortationConstruct()
testViewControlSortationWithInput()
testViewControlSortationRenderingOutsideContainer()