From 158064f5f38e47218e0e8aa9cad3494d9078cbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Nabia=C5=82ek?= Date: Fri, 22 Jul 2016 21:35:55 +0200 Subject: [PATCH] Add additional test for pagination when no perPage given --- tests/Database/DatabaseEloquentIntegrationTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/Database/DatabaseEloquentIntegrationTest.php b/tests/Database/DatabaseEloquentIntegrationTest.php index 062090e80ee2..07a4c8ff767d 100644 --- a/tests/Database/DatabaseEloquentIntegrationTest.php +++ b/tests/Database/DatabaseEloquentIntegrationTest.php @@ -203,6 +203,14 @@ public function testPaginatedModelCollectionRetrievalWhenNoElements() $this->assertEquals(0, $models->count()); } + public function testPaginatedModelCollectionRetrievalWhenNoElementsAndDefaultPerPage() + { + $models = EloquentTestUser::oldest('id')->paginate(); + + $this->assertEquals(0, $models->count()); + $this->assertInstanceOf('Illuminate\Pagination\LengthAwarePaginator', $models); + } + public function testCountForPaginationWithGrouping() { EloquentTestUser::create(['id' => 1, 'email' => 'taylorotwell@gmail.com']);