function ViewsPreprocessTest::testEmptyPaginationHeadingLevelSet

Same name in other branches
  1. 10 core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php \Drupal\Tests\views\Kernel\ViewsPreprocessTest::testEmptyPaginationHeadingLevelSet()

Tests template_preprocess_views_mini_pager() when an empty pagination_heading_level value is passed.

@covers ::template_preprocess_views_mini_pager

File

core/modules/views/tests/src/Kernel/ViewsPreprocessTest.php, line 67

Class

ViewsPreprocessTest
Tests the preprocessing functionality in views.theme.inc.

Namespace

Drupal\Tests\views\Kernel

Code

public function testEmptyPaginationHeadingLevelSet() : void {
    require_once $this->root . '/core/modules/views/views.theme.inc';
    $variables = [
        'tags' => [],
        'quantity' => 9,
        'element' => 0,
        'pagination_heading_level' => '',
        'parameters' => [],
    ];
    template_preprocess_views_mini_pager($variables);
    $this->assertEquals('h4', $variables['pagination_heading_level']);
}

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