Skip to content

Commit

Permalink
chore: 🤖 Drop support for stale versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mpyw committed Mar 15, 2023
1 parent c37a0f3 commit 0f6fb91
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 44 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/test.yml
Expand Up @@ -8,26 +8,18 @@ jobs:

strategy:
matrix:
php: [7.3, 7.4, '8.0', 8.1]
php: ['8.0', 8.1, 8.2]
lib:
- { laravel: ^11.0 }
- { laravel: ^10.0 }
- { laravel: ^9.0 }
- { laravel: ^8.0 }
- { laravel: ^7.0 }
- { laravel: ^6.0 }
- { laravel: ^6.0, flags: --prefer-lowest }
exclude:
- { php: 8.1, lib: { laravel: ^7.0 } }
- { php: 8.1, lib: { laravel: ^6.0 } }
- { php: 8.1, lib: { laravel: ^6.0, flags: --prefer-lowest } }
- { php: 8.0, lib: { laravel: ^10.0 } }
- { php: 7.4, lib: { laravel: ^10.0 } }
- { php: 7.4, lib: { laravel: ^9.0 } }
- { php: 7.3, lib: { laravel: ^10.0 } }
- { php: 7.3, lib: { laravel: ^9.0 } }
- { php: 8.0, lib: { laravel: ^11.0 } }
- { php: 8.1, lib: { laravel: ^11.0 } }

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -37,7 +29,7 @@ jobs:

- name: Adjust package versions
run: |
composer require "laravel/framework:${{ matrix.lib.laravel }}" --dev ${{ matrix.lib.flags }}
composer require "laravel/framework:${{ matrix.lib.laravel }}" --dev
- run: mkdir -p build/logs
- run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,5 +1,6 @@
composer.lock
/.idea/
/vendor/
/build/logs/
.php_cs.cache
.phpunit.result.cache
/.phpunit.cache/
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -22,8 +22,8 @@ Rapid pagination without using OFFSET

## Requirements

- PHP: `^7.3 || ^8.0`
- Laravel: `^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0`
- PHP: `^8.0`
- Laravel: `^9.0 || ^10.0 || ^11.0`
- [lampager/lampager](https://github.com/lampager/lampager): `^0.4`

## Installing
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Expand Up @@ -21,16 +21,16 @@
}
},
"require": {
"php": "^7.3 || ^8.0",
"php": "^8.0",
"ext-json": "*",
"lampager/lampager": "^0.4",
"illuminate/contracts": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
"illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0"
"illuminate/contracts": "^9.0 || ^10.0 || ^11.0",
"illuminate/support": "^9.0 || ^10.0 || ^11.0",
"illuminate/database": "^9.0 || ^10.0 || ^11.0"
},
"require-dev": {
"orchestra/testbench": "*",
"orchestra/testbench-core": "^4.9 || ^5.9 || >=6.6",
"orchestra/testbench-core": ">=7.0",
"phpunit/phpunit": ">=9.5",
"nilportugues/sql-query-formatter": "^1.2.2"
},
Expand Down
21 changes: 6 additions & 15 deletions phpunit.xml
@@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
bootstrap="vendor/autoload.php"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<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">
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>
15 changes: 8 additions & 7 deletions tests/ResourceTest.php
Expand Up @@ -2,6 +2,7 @@

namespace Lampager\Laravel\Tests;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Support\Arr;

Expand Down Expand Up @@ -111,11 +112,11 @@ public function testStructuredArrayOutput()
$this->assertResultSame($expected, (new StructuredPostResourceCollection($standardPagination))->resolve());

$this->assertResultSame($expected, (new StructuredPostResourceCollection($records))
->toResponse(null)->getData()
->toResponse(Request::create('/'))->getData()
);
$this->assertResultSame($expected, (new PostResourceCollection($records))
->additional(['post_resource_collection' => true])
->toResponse(null)->getData()
->toResponse(Request::create('/'))->getData()
);
}

Expand Down Expand Up @@ -154,11 +155,11 @@ public function testLampagerPaginationOutput()
$pagination = $this->getLampagerPagination();

$this->assertResultSame($expected1, (new StructuredPostResourceCollection($pagination))
->toResponse(null)->getData()
->toResponse(Request::create('/'))->getData()
);
$this->assertResultSame($expected2, (new PostResourceCollection($pagination))
->additional(['post_resource_collection' => true])
->toResponse(null)->getData()
->toResponse(Request::create('/'))->getData()
);
}

Expand Down Expand Up @@ -206,11 +207,11 @@ public function testStandardPaginationOutput()
$pagination = $this->getStandardPagination();

$this->assertResultSame($expected1, (new StructuredPostResourceCollection($pagination))
->toResponse(null)->getData()
->toResponse(Request::create('/'))->getData()
);
$this->assertResultSame($expected2, (new PostResourceCollection($pagination))
->additional(['post_resource_collection' => true])
->toResponse(null)->getData()
->toResponse(Request::create('/'))->getData()
);
}

Expand Down Expand Up @@ -256,6 +257,6 @@ public function testAnonymousResourceCollection()
'has_next' => true,
'next_cursor' => ['updated_at' => '2017-01-01 11:00:00', 'id' => 4],
];
$this->assertResultSame($expected, $collection->toResponse(null)->getData());
$this->assertResultSame($expected, $collection->toResponse(Request::create('/'))->getData());
}
}

0 comments on commit 0f6fb91

Please sign in to comment.