diff --git a/changelog.md b/changelog.md index dece7e5..1e49659 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/src/SearchRequest.php b/src/SearchRequest.php index a87f4b1..a39b0a4 100644 --- a/src/SearchRequest.php +++ b/src/SearchRequest.php @@ -73,7 +73,7 @@ class SearchRequest { * * @var bool */ - protected $pageShouldAutomaticallyReset = true; + protected $pageShouldAutomaticallyReset = false; /** * @param mixed $json //null | string diff --git a/tests/Pagination/PaginationTest.php b/tests/Pagination/PaginationTest.php index 16d040c..9d79b18 100644 --- a/tests/Pagination/PaginationTest.php +++ b/tests/Pagination/PaginationTest.php @@ -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()); @@ -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());