@@ -19,6 +19,7 @@ class ArrayEngineTest extends TestCase
19
19
protected function setUp (): void
20
20
{
21
21
Config::shouldReceive ('get ' )->with ('scout.after_commit ' , Mockery::any ())->andReturn (false );
22
+ Config::shouldReceive ('get ' )->with ('scout.soft_delete ' , Mockery::any ())->andReturn (false );
22
23
}
23
24
24
25
protected function tearDown (): void
@@ -272,14 +273,20 @@ public function it_can_paginate_results()
272
273
$ engine ->update (Collection::make ([
273
274
new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 1 ]),
274
275
new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 2 ]),
275
- new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 3 ])
276
+ new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 3 ]),
277
+ new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 4 ]),
278
+ new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 5 ]),
279
+ new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 6 ]),
280
+ new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 7 ]),
281
+ new SearchableModel (['foo ' => 'bar ' , 'scoutKey ' => 8 ]),
276
282
]));
277
283
278
- $ results = $ engine ->paginate (new Builder (new SearchableModel (), 'bar ' ), 1 , 3 );
284
+ $ results = $ engine ->paginate (new Builder (new SearchableModel (), 'bar ' ), 2 , 3 );
279
285
280
- $ this ->assertCount (1 , $ results ['hits ' ]);
281
- $ this ->assertEquals (3 , $ results ['total ' ]);
282
- $ this ->assertEquals (1 , $ results ['hits ' ][0 ]['scoutKey ' ]);
286
+ $ this ->assertCount (2 , $ results ['hits ' ]);
287
+ $ this ->assertEquals (8 , $ results ['total ' ]);
288
+ $ this ->assertEquals (4 , $ results ['hits ' ][0 ]['scoutKey ' ]);
289
+ $ this ->assertEquals (3 , $ results ['hits ' ][1 ]['scoutKey ' ]);
283
290
}
284
291
285
292
/** @test */
0 commit comments