Skip to content

Commit

Permalink
Version 6.0.0 (#28)
Browse files Browse the repository at this point in the history
* init automatic page reset to false

* change log

* fix tests
  • Loading branch information
sdsomma authored Jun 28, 2018
1 parent 0b99c4f commit e45c718
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog

### 6.0.0
- Automatic page reset is now off by default

### 5.6.2
- Fixing automatic page reset undoing unlimited for group by, term, and sort

Expand Down
2 changes: 1 addition & 1 deletion src/SearchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SearchRequest {
*
* @var bool
*/
protected $pageShouldAutomaticallyReset = true;
protected $pageShouldAutomaticallyReset = false;

/**
* @param mixed $json //null | string
Expand Down
8 changes: 4 additions & 4 deletions tests/Pagination/PaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function integerStrings()
/**
* @test
*/
public function resetsByDefault()
public function resetsWhenEnabled()
{
$request = new SearchRequest;
$request = SearchRequest::create()->enableAutomaticPageReset();

$request->page(5)->where('foo', true);
$this->assertEquals(1, $request->getPage());
Expand All @@ -70,9 +70,9 @@ public function resetsByDefault()
/**
* @test
*/
public function noResetsWhenDisabled()
public function noResetsByDefault()
{
$request = SearchRequest::create()->disableAutomaticPageReset();
$request = SearchRequest::create();

$request->page(5)->where('foo', true);
$this->assertEquals(5, $request->getPage());
Expand Down

0 comments on commit e45c718

Please sign in to comment.