Sti3bas / laravel-scout-array-driver

Array driver for Laravel Scout
MIT License
89 stars 8 forks source link

Fixed Mockery expectations + faulty paginator #7

Closed arondeparon closed 3 years ago

arondeparon commented 3 years ago

What does this pull request fix?

Mockery expectations

There was no Mockery expectation defined for scout.softDelete which caused the tests to fail. I added these the the setUp() method.

Faulty paginator

The paginator had a bug that was undetected by the unit test. When using a page size larger than 1, the paginator would have an incorrect offset.

Instead of paginate($startOffset, $numberOfItems), paginate($pageNumber, $numberOfItems) was used. This caused paged results to appear on more than one page, and pages to contain more items than they should actually contain.

This pull request fixes that behavior and the corresponding test.

Sti3bas commented 3 years ago

@ArondeParon thank you!

Released in https://github.com/Sti3bas/laravel-scout-array-driver/releases/tag/v3.1