Skip to content

Commit

Permalink
Merge 78da978 into 82a4d6e
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Andreyev committed Jun 22, 2018
2 parents 82a4d6e + 78da978 commit ddbcf3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Datagrid/SimplePager.php
Expand Up @@ -119,7 +119,7 @@ public function init()
$this->initializeIterator();

$t = (int) ceil($this->thresholdCount / $this->getMaxPerPage()) + $this->getPage() - 1;
$this->setLastPage($t);
$this->setLastPage(\max(1, $t));
}
}

Expand Down
3 changes: 2 additions & 1 deletion tests/Datagrid/SimplePagerTest.php
Expand Up @@ -112,7 +112,8 @@ public function testNoPagesForNoResults()

$this->pager->setQuery($this->proxyQuery);
$this->pager->init();
$this->AssertEquals(0, $this->pager->getLastPage());
$this->assertEquals(1, $this->pager->getLastPage());
$this->assertEquals(0, $this->pager->getNbResults());
}

public function testInitNoQuery()
Expand Down

0 comments on commit ddbcf3f

Please sign in to comment.