/** * @param array $config * @param int $page * @param int $maxPerPage * @dataProvider visitDatasourceNoRestrictionsDataProvider */ public function testVisitDatasourceNoPagerRestrictions(array $config, $page, $maxPerPage) { $this->pager->expects($this->once())->method('setPage')->with($page); $this->pager->expects($this->once())->method('setMaxPerPage')->with($maxPerPage); /** @var DatasourceInterface $dataSource */ $dataSource = $this->getMock('Oro\\Bundle\\DataGridBundle\\Datasource\\DatasourceInterface'); $configObject = DatagridConfiguration::create($config); $this->extension->setParameters(new ParameterBag()); $this->extension->visitDatasource($configObject, $dataSource); }
/** * {@inheritDoc} */ public function visitResult(DatagridConfiguration $config, ResultsObject $result) { $result->offsetAddToArray('options', [self::TOTAL_PARAM => $this->pager->getNbResults()]); }
/** * {@inheritDoc} */ public function visitResult(DatagridConfiguration $config, ResultsObject $result) { $result->offsetSetByPath(PagerInterface::TOTAL_PATH_PARAM, $this->pager->getNbResults()); }