Bootstrap\Test\TestCase\View\Helper\BootstrapPanelHelperTest::testGroup PHP Метод

testGroup() публичный Метод

public testGroup ( )
    public function testGroup()
    {
        $panelHeading = 'This is a panel heading';
        $panelContent = 'A bit of HTML code inside!';
        $result = '';
        $result .= $this->Panel->startGroup();
        $result .= $this->Panel->create($panelHeading);
        $result .= $panelContent;
        $result .= $this->Panel->create($panelHeading);
        $result .= $panelContent;
        $result .= $this->Panel->create($panelHeading);
        $result .= $panelContent;
        $result .= $this->Panel->endGroup();
        $result .= $this->Panel->create($panelHeading);
        $result .= $panelContent;
        $result .= $this->Panel->end();
        $expected = [['div' => ['id' => 'panelGroup-1', 'role' => 'tablist', 'aria-multiselectable' => true, 'class' => 'panel-group']]];
        for ($i = 0; $i < 3; ++$i) {
            $expected = array_merge($expected, [['div' => ['class' => 'panel panel-default']], ['div' => ['role' => 'tab', 'id' => 'heading-' . $i, 'class' => 'panel-heading']], ['h4' => ['class' => 'panel-title']], ['a' => ['href' => '#collapse-' . $i, 'data-toggle' => 'collapse', 'data-parent' => '#panelGroup-1', 'aria-expanded' => $i == 0 ? 'true' : 'false', 'aria-controls' => '#collapse-' . $i]], $panelHeading, '/a', '/h4', '/div', ['div' => ['id' => 'collapse-' . $i, 'role' => 'tabpanel', 'aria-labelledby' => 'heading-' . $i, 'class' => 'panel-collapse collapse' . ($i ? '' : ' in')]], ['div' => ['class' => 'panel-body']], $panelContent, '/div', '/div', '/div']);
        }
        $expected = array_merge($expected, ['/div']);
        $expected = array_merge($expected, [['div' => ['class' => 'panel panel-default']], ['div' => ['class' => 'panel-heading']], ['h4' => ['class' => 'panel-title']], $panelHeading, '/h4', '/div', ['div' => ['class' => 'panel-body']], $panelContent, '/div', '/div']);
        $this->assertHtml($expected, $result);
    }