getUpdatedParameters example


    $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']);
  }

  /** * @covers ::findPage */
  public function testFindPage() {
    $request = Request::create('http://example.com', 'GET', ['page' => '0,10']);

    
Home | Imprint | This part of the site doesn't use cookies.