Skip to content

Commit

Permalink
[5.6] Integration test to avoid repetitive pagination PR with columns (
Browse files Browse the repository at this point in the history
…#23259)

* Integration test to avoid repetitive pagination PR with columns

* Rearrange import by length
  • Loading branch information
deleugpn authored and taylorotwell committed Feb 23, 2018
1 parent ba0fa73 commit 604f39e
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/Integration/Database/EloquentPaginateTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace Illuminate\Tests\Integration\Database\EloquentPaginateTest;

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Tests\Integration\Database\DatabaseTestCase;

/**
* @group integration
*/
class EloquentPaginateTest extends DatabaseTestCase
{
public function setUp()
{
parent::setUp();

Schema::create('posts', function ($table) {
$table->increments('id');
$table->string('title')->nullable();
$table->timestamps();
});
}

public function test_pagination_on_top_of_columns()
{
for ($i = 1; $i <= 50; $i++) {
Post::create([
'title' => 'Title ' . $i,
]);
}

$this->assertCount(15, Post::paginate(15, ['id', 'title']));
}
}

class Post extends Model
{
protected $guarded = [];
}

0 comments on commit 604f39e

Please sign in to comment.