function RequestPagerTest::testFindPage

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php \Drupal\KernelTests\Core\Pager\RequestPagerTest::testFindPage()
  2. 10 core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php \Drupal\KernelTests\Core\Pager\RequestPagerTest::testFindPage()
  3. 11.x core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php \Drupal\KernelTests\Core\Pager\RequestPagerTest::testFindPage()

@covers ::findPage

File

core/tests/Drupal/KernelTests/Core/Pager/RequestPagerTest.php, line 18

Class

RequestPagerTest
@group Pager

Namespace

Drupal\KernelTests\Core\Pager

Code

public function testFindPage() {
    $request = Request::create('http://example.com', 'GET', [
        'page' => '0,10',
    ]);
    
    /* @var $request_stack \Symfony\Component\HttpFoundation\RequestStack */
    $request_stack = $this->container
        ->get('request_stack');
    $request_stack->push($request);
    $pager_params = $this->container
        ->get('pager.parameters');
    $this->assertEquals(10, $pager_params->findPage(1));
}

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