| Total Complexity | 1 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | final class ButtonGroupTest extends TestCase |
||
| 16 | { |
||
| 17 | public function testContainerOptions(): void |
||
| 18 | { |
||
| 19 | ButtonGroup::counter(0); |
||
| 20 | |||
| 21 | $html = ButtonGroup::widget() |
||
| 22 | ->buttons([ |
||
| 23 | ['label' => 'button-A'], |
||
| 24 | ['label' => 'button-B', 'visible' => true], |
||
| 25 | ['label' => 'button-C', 'visible' => false], |
||
| 26 | Button::widget() |
||
| 27 | ->label('button-D') |
||
| 28 | ->render() |
||
| 29 | ]) |
||
| 30 | ->render(); |
||
| 31 | |||
| 32 | $expected = <<<HTML |
||
| 33 | <div id="w1-button-group" class="btn-group" role="group"><button type="button" id="w2-button" class="btn">button-A</button> |
||
| 34 | <button type="button" id="w3-button" class="btn">button-B</button> |
||
| 35 | <button id="w0-button" class="btn">button-D</button></div> |
||
| 36 | HTML; |
||
| 37 | |||
| 38 | $this->assertEqualsWithoutLE($expected, $html); |
||
| 39 | } |
||
| 41 |