[增添]添加了datasource的setting数据库以及默认值
This commit is contained in:
29
vendor/anourvalar/eloquent-serialize/tests/LimitTest.php
vendored
Normal file
29
vendor/anourvalar/eloquent-serialize/tests/LimitTest.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace AnourValar\EloquentSerialize\Tests;
|
||||
|
||||
use AnourValar\EloquentSerialize\Tests\Models\User;
|
||||
|
||||
class LimitTest extends AbstractSuite
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testSimple()
|
||||
{
|
||||
// Limit
|
||||
$this->compare(User::limit(10));
|
||||
|
||||
// Limit with offset
|
||||
$this->compare(User::offset(20)->limit(10));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testNested()
|
||||
{
|
||||
$this->compare(User::with(['userPhones' => fn ($query) => $query->limit(1)]));
|
||||
$this->compare(User::with(['userPhones' => fn ($query) => $query->limit(2)]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user