function PagerManagerTest::testGetUpdatedParameters
Same name in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php \Drupal\KernelTests\Core\Pager\PagerManagerTest::testGetUpdatedParameters()
- 10 core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php \Drupal\KernelTests\Core\Pager\PagerManagerTest::testGetUpdatedParameters()
- 11.x core/tests/Drupal/KernelTests/Core/Pager/PagerManagerTest.php \Drupal\KernelTests\Core\Pager\PagerManagerTest::testGetUpdatedParameters()
@covers ::getUpdatedParameters
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Pager/ PagerManagerTest.php, line 18
Class
- PagerManagerTest
- @group Pager
Namespace
Drupal\KernelTests\Core\PagerCode
public function testGetUpdatedParameters() {
$element = 2;
$index = 5;
$test_parameters = [
'other' => 'arbitrary',
];
$request = Request::create('http://example.com', 'GET', $test_parameters);
/** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */
$request_stack = $this->container
->get('request_stack');
$request_stack->push($request);
/** @var \Drupal\Core\Pager\PagerManagerInterface $pager_manager */
$pager_manager = $this->container
->get('pager.manager');
$pager_manager->createPager(30, 10, $element);
$query = $pager_manager->getUpdatedParameters($request->query
->all(), $element, $index);
$this->assertArrayHasKey('other', $query);
$this->assertEquals(",,{$index}", $query['page']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.