You are here

public function PreprocessPagerTest::testQuantityNotSet in Drupal 8

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()

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 50

Class

PreprocessPagerTest
Tests pager preprocessing.

Namespace

Drupal\Tests\system\Unit\Pager

Code

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