function PreprocessPagerTest::testQuantityNotSet

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php \Drupal\Tests\system\Unit\Pager\PreprocessPagerTest::testQuantityNotSet()
  2. 8.9.x core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php \Drupal\Tests\system\Unit\Pager\PreprocessPagerTest::testQuantityNotSet()
  3. 11.x core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php \Drupal\Tests\system\Unit\Pager\PreprocessPagerTest::testQuantityNotSet()

Tests template_preprocess_pager() when an empty #quantity is passed.

@covers ::template_preprocess_pager

File

core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php, line 55

Class

PreprocessPagerTest
Tests pager preprocessing.

Namespace

Drupal\Tests\system\Unit\Pager

Code

public function testQuantityNotSet() : void {
  require_once $this->root . '/core/includes/theme.inc';
  $variables = [
    'pager' => [
      '#element' => '',
      '#parameters' => [],
      '#quantity' => '',
      '#route_name' => '',
      '#tags' => '',
    ],
  ];
  template_preprocess_pager($variables);
  $this->assertEquals([
    'first',
    'previous',
  ], array_keys($variables['items']));
}

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