/** * @param integer $count * * @Given /^the grid should contain (\d+) elements?$/ */ public function theGridShouldContainElement($count) { $this->wait(); if ($count > 10) { $this->iChangePageSize(100); } assertEquals($count, $actualCount = $this->datagrid->getToolbarCount(), sprintf('Expecting to see %d record(s) in the datagrid toolbar, actually saw %d', $count, $actualCount)); assertEquals($count, $actualCount = $this->datagrid->countRows(), sprintf('Expecting to see %d row(s) in the datagrid, actually saw %d.', $count, $actualCount)); }
/** * @param int $count * * @return mixed * * @Given /^the grid should contain (\d+) elements?$/ */ public function theGridShouldContainElement($count) { $count = (int) $count; if (0 === $count) { $this->spin(function () { assertTrue($this->datagrid->isGridEmpty()); return true; }, 'Expecting grid to be empty'); return; } $this->theGridToolbarCountShouldBe($count); if ($count > 10) { $this->getCurrentPage()->getCurrentGrid()->setPageSize(100); } $this->spin(function () use($count) { assertEquals($count, $actualCount = $this->datagrid->countRows()); return true; }, sprintf('Expecting to see %d row(s) in the datagrid, actually saw %d.', $count, $this->datagrid->countRows())); }