File tree Expand file tree Collapse file tree 14 files changed +176
-308
lines changed Expand file tree Collapse file tree 14 files changed +176
-308
lines changed Original file line number Diff line number Diff line change 1- name : Test
1+ name : CI
22
33on : [push, pull_request]
44
88
99 strategy :
1010 matrix :
11- php : ['8.0' , 8.1 , 8.2 ]
11+ php : [8.2 , 8.3 , 8.4 ]
1212 lib :
13- - { laravel: ^11.0 }
14- - { laravel: ^10.0 }
15- - { laravel: ^9.0 }
13+ - laravel : ^13.0.x-dev
14+ - laravel : ^12.0
15+ - laravel : ^11.0
1616 exclude :
17- - { php: 8.0, lib: { laravel: ^10.0 } }
18- - { php: 8.0, lib: { laravel: ^11.0 } }
19- - { php: 8.1, lib: { laravel: ^11.0 } }
17+ - php : 8.2
18+ lib :
19+ laravel : ^13.0.x-dev
2020
2121 steps :
2222 - uses : actions/checkout@v3
2727 php-version : ${{ matrix.php }}
2828 coverage : xdebug
2929
30- - name : Adjust package versions
31- run : |
32- composer require "laravel/framework:${{ matrix.lib.laravel }}" --dev
33-
30+ - run : composer require "laravel/framework:${{ matrix.lib.laravel }}" --dev
3431 - run : mkdir -p build/logs
3532 - run : vendor/bin/phpunit --coverage-clover build/logs/clover.xml
3633
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44<p align =" center " >
55<a href =" https://github.com/lampager/lampager-laravel/actions " ><img src =" https://github.com/lampager/lampager-laravel/actions/workflows/test.yml/badge.svg?branch=master " alt =" Build Status " ></a >
66<a href =" https://coveralls.io/github/lampager/lampager-laravel?branch=master " ><img src =" https://coveralls.io/repos/github/lampager/lampager-laravel/badge.svg?branch=master " alt =" Coverage Status " ></a >
7- <a href =" https://scrutinizer-ci.com/g/lampager/lampager-laravel/?branch=master " ><img src =" https://scrutinizer-ci.com/g/lampager/lampager-laravel/badges/quality-score.png?b=master " alt =" Scrutinizer Code Quality " ></a >
8- </p >
97
108# Lampager for Laravel
119
1210Rapid pagination without using OFFSET
1311
14- <!--
15- [Better Query Planning · Issue #38 · lampager/lampager](https://github.com/lampager/lampager/issues/38)
16-
17- **UPDATE: 2021-06-08**
18- **Now Laravel officialy supports Cursor Pagination as of v8.41. Please don't use if you installs such versions unless you choose `SQLServer` as RDBMS.**
19- - **[Highly Performant Cursor Pagination in Laravel 8.41 | Laravel News](https://laravel-news.com/cursor-pagination)**
20- - **[SQL Feature Comparison](https://www.sql-workbench.eu/dbms_comparison.html)** (See "Tuple Comparison" section)
21- -->
12+ > [ !CAUTION]
13+ > ** Now Laravel officialy supports Cursor Pagination as of v8.41. Please don't use if you install such versions unless you choose ` SQLServer ` as RDBMS.**
14+ > - ** [ Highly Performant Cursor Pagination in Laravel 8.41 | Laravel News] ( https://laravel-news.com/cursor-pagination ) **
15+ > - ** [ SQL Feature Comparison] ( https://www.sql-workbench.eu/dbms_comparison.html ) ** (See "Tuple Comparison" section)
2216
2317## Requirements
2418
25- - PHP: ` ^8.0 `
26- - Laravel: ` ^9.0 || ^10.0 || ^11.0 `
27- - [ lampager/lampager] ( https://github.com/lampager/lampager ) : ` ^0.4 `
19+ > [ !NOTE]
20+ > Older versions have outdated dependency requirements. If you cannot prepare the latest environment, please refer to past releases.
21+
22+ - PHP: ` ^8.2 `
23+ - Laravel: ` ^11.0 || ^12.0 `
24+ - [ lampager/lampager] ( https://github.com/lampager/lampager ) : ` ^0.5 `
2825
2926## Installing
3027
Original file line number Diff line number Diff line change 2121 }
2222 },
2323 "require" : {
24- "php" : " ^8.0 " ,
24+ "php" : " ^8.2 " ,
2525 "ext-json" : " *" ,
26- "lampager/lampager" : " ^0.4 " ,
27- "illuminate/contracts" : " ^9 .0 || ^10 .0 || ^11 .0" ,
28- "illuminate/support" : " ^9 .0 || ^10 .0 || ^11 .0" ,
29- "illuminate/database" : " ^9 .0 || ^10 .0 || ^11 .0"
26+ "lampager/lampager" : " ^0.5 " ,
27+ "illuminate/contracts" : " ^11 .0 || ^12 .0 || ^13 .0" ,
28+ "illuminate/support" : " ^11 .0 || ^12 .0 || ^13 .0" ,
29+ "illuminate/database" : " ^11 .0 || ^12 .0 || ^13 .0"
3030 },
3131 "require-dev" : {
3232 "orchestra/testbench" : " *" ,
33- "orchestra/testbench-core" : " >=7 .0" ,
34- "phpunit/phpunit" : " >=9.5 " ,
33+ "orchestra/testbench-core" : " >=9 .0" ,
34+ "phpunit/phpunit" : " >=11.0 " ,
3535 "nilportugues/sql-query-formatter" : " ^1.2.2"
3636 },
3737 "minimum-stability" : " dev" ,
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" backupGlobals =" false" bootstrap =" vendor/autoload.php" colors =" true" processIsolation =" false" stopOnFailure =" false" xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory =" .phpunit.cache" backupStaticProperties =" false" >
3- <coverage >
2+ <phpunit backupGlobals =" false"
3+ bootstrap =" vendor/autoload.php"
4+ colors =" true"
5+ processIsolation =" false"
6+ stopOnFailure =" false"
7+ cacheDirectory =" .phpunit.cache"
8+ backupStaticProperties =" false" >
9+
10+ <source >
411 <include >
5- <directory suffix = " .php " > src</directory >
12+ <directory >./ src</directory >
613 </include >
7- </coverage >
14+ </source >
15+
16+ <coverage />
17+
818 <testsuites >
919 <testsuite name =" Package Test Suite" >
10- <directory suffix =" Test.php" >./tests/ </directory >
20+ <directory suffix =" Test.php" >./tests</directory >
1121 </testsuite >
1222 </testsuites >
1323</phpunit >
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class PaginationResult extends BasePaginationResult implements \JsonSerializable
2828 * @param array $parameters
2929 * @return mixed
3030 */
31- public function __call ($ method , array $ parameters )
31+ public function __call ($ method , $ parameters )
3232 {
3333 if (static ::hasMacro ($ method )) {
3434 return $ this ->macroCall ($ method , $ parameters );
Original file line number Diff line number Diff line change 33namespace Lampager \Laravel \Tests ;
44
55use Carbon \Carbon ;
6- use Illuminate \Support \Facades \App ;
76
87class EloquentDate
98{
109 public static function format (string $ date ): string
1110 {
12- return version_compare (App::version (), '7 ' , '> ' )
13- ? Carbon::parse ($ date )->toJSON ()
14- : (string )Carbon::parse ($ date );
11+ return Carbon::parse ($ date )->toJSON ();
1512 }
1613}
Original file line number Diff line number Diff line change 55use Illuminate \Support \Collection ;
66use Lampager \Laravel \Processor ;
77use Lampager \Query ;
8+ use PHPUnit \Framework \Attributes \Test ;
89
910class FormatterTest extends TestCase
1011{
11- /**
12- * @test
13- */
14- public function testStaticCustomFormatter ()
12+ #[Test]
13+ public function testStaticCustomFormatter (): void
1514 {
1615 try {
1716 Processor::setDefaultFormatter (function ($ rows , $ meta , Query $ query ) {
@@ -30,10 +29,8 @@ public function testStaticCustomFormatter()
3029 }
3130 }
3231
33- /**
34- * @test
35- */
36- public function testInstanceCustomFormatter ()
32+ #[Test]
33+ public function testInstanceCustomFormatter (): void
3734 {
3835 $ pager = Post::lampager ();
3936 try {
@@ -52,19 +49,15 @@ public function testInstanceCustomFormatter()
5249 }
5350 }
5451
55- /**
56- * @test
57- */
58- public function testInvalidFormatter ()
52+ #[Test]
53+ public function testInvalidFormatter (): void
5954 {
6055 $ this ->expectException (\InvalidArgumentException::class);
6156 Post::lampager ()->useProcessor (function () {});
6257 }
6358
64- /**
65- * @test
66- */
67- public function testInvalidProcessor ()
59+ #[Test]
60+ public function testInvalidProcessor (): void
6861 {
6962 $ this ->expectException (\InvalidArgumentException::class);
7063 Post::lampager ()->useFormatter (__CLASS__ );
Original file line number Diff line number Diff line change 44
55use Illuminate \Http \Resources \Json \JsonResource as BaseJsonResource ;
66
7- if (class_exists (BaseJsonResource::class)) {
8- /**
9- * To support testing Laravel version 7 and up.
10- */
11- class JsonResource extends BaseJsonResource
12- {
13- }
14- } else {
15- /**
16- * To support testing until Laravel version 7.
17- */
18- class JsonResource extends \Illuminate \Http \Resources \Json \Resource
19- {
20- }
7+ class JsonResource extends BaseJsonResource
8+ {
219}
Original file line number Diff line number Diff line change 22
33namespace Lampager \Laravel \Tests ;
44
5+ use PHPUnit \Framework \Attributes \Test ;
6+
57class MacroTest extends TestCase
68{
7- /**
8- * @test
9- */
10- public function registerAllIlluminateMacros ()
9+ #[Test]
10+ public function registerAllIlluminateMacros (): void
1111 {
1212 (new Post ())->belongsTo (Post::class)->lampager ()->orderBy ('id ' )->build ()->toSql ();
1313 $ x = (new Post ())->lampager ()->orderBy ('id ' )->build ()->toSql ();
You can’t perform that action at this time.
0 commit comments