function TableTest::testThemeTableFooter

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableFooter()
  2. 10 core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableFooter()
  3. 11.x core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php \Drupal\KernelTests\Core\Render\Element\TableTest::testThemeTableFooter()

Tests that the 'footer' option works correctly.

File

core/tests/Drupal/KernelTests/Core/Render/Element/TableTest.php, line 118

Class

TableTest
Tests built-in table theme functions.

Namespace

Drupal\KernelTests\Core\Render\Element

Code

public function testThemeTableFooter() {
    $footer = [
        [
            'data' => [
                1,
            ],
        ],
        [
            'Foo',
        ],
    ];
    $table = [
        '#type' => 'table',
        '#rows' => [],
        '#footer' => $footer,
    ];
    $this->render($table);
    $this->removeWhiteSpace();
    $this->assertRaw('<tfoot><tr><td>1</td></tr><tr><td>Foo</td></tr></tfoot>', 'Table footer found.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.