From e236a85b4c6593dfb5851fd401f182cac193813f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Nabia=C5=82ek?= Date: Sun, 24 Jul 2016 16:01:24 +0200 Subject: [PATCH] Add additional test for pagination when no perPage given (#14431) --- 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']);