function PagerManagerTest::testGetMaxPagerElementId

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php \Drupal\KernelTests\Core\Pager\PagerManagerTest::testGetMaxPagerElementId()
  2. 11.x core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php \Drupal\KernelTests\Core\Pager\PagerManagerTest::testGetMaxPagerElementId()

@covers ::getMaxPagerElementId

@dataProvider providerTestGetMaxPagerElementId

File

core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php, line 67

Class

PagerManagerTest
@group Pager

Namespace

Drupal\KernelTests\Core\Pager

Code

public function testGetMaxPagerElementId(array $elements, int $expected_max_element_id) : void {
    
    /** @var \Drupal\Core\Pager\PagerManagerInterface $pager_manager */
    $pager_manager = $this->container
        ->get('pager.manager');
    foreach ($elements as $element) {
        $pager_manager->createPager(30, 10, $element);
    }
    $this->assertEquals($expected_max_element_id, $pager_manager->getMaxPagerElementId());
}

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