function DevelClientSideFilterTableTest::testGetInfo

Same name in other branches
  1. 5.x tests/src/Unit/DevelClientSideFilterTableTest.php \Drupal\Tests\devel\Unit\DevelClientSideFilterTableTest::testGetInfo()

@covers ::getInfo

File

tests/src/Unit/DevelClientSideFilterTableTest.php, line 19

Class

DevelClientSideFilterTableTest
Tests ClientSideFilterTable element.

Namespace

Drupal\Tests\devel\Unit

Code

public function testGetInfo() {
    $translation = $this->getStringTranslationStub();
    $expected_info = [
        '#filter_label' => $translation->translate('Search'),
        '#filter_placeholder' => $translation->translate('Search'),
        '#filter_description' => $translation->translate('Search'),
        '#header' => [],
        '#rows' => [],
        '#empty' => '',
        '#sticky' => FALSE,
        '#responsive' => TRUE,
        '#attributes' => [],
        '#pre_render' => [
            [
                ClientSideFilterTable::class,
                'preRenderTable',
            ],
        ],
    ];
    $table = new ClientSideFilterTable([], 'test', 'test');
    $table->setStringTranslation($translation);
    $this->assertEquals($expected_info, $table->getInfo());
}