-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[5.6] Integration test to avoid repetitive pagination PR with columns (…
…#23259) * Integration test to avoid repetitive pagination PR with columns * Rearrange import by length
- Loading branch information
1 parent
ba0fa73
commit 604f39e
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = []; | ||
} |