diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 01ee503..7de39ef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,17 +14,10 @@ jobs: runs-on: ubuntu-latest strategy: - matrix: - laravel: [8.*, 9.*, 10.*] - php: [7.3, 8.0, 8.1, 8.2] - exclude: - - laravel: 9.* - php: 7.3 - - laravel: 10.* - php: 7.3 - - laravel: 10.* - php: 8.0 fail-fast: false + matrix: + laravel: [11.*] + php: [8.2, 8.3] name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }} @@ -44,4 +37,4 @@ jobs: composer update --prefer-stable --prefer-dist --no-interaction --no-suggest - name: Run tests - run: vendor/bin/phpunit + run: vendor/bin/pest diff --git a/.gitignore b/.gitignore index 7579f74..5c088bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ vendor composer.lock +.phpunit.result.cache +.phpunit.cache diff --git a/composer.json b/composer.json index 1f507f5..5ec9587 100644 --- a/composer.json +++ b/composer.json @@ -23,16 +23,18 @@ } }, "require": { - "php": ">=5.5.9", - "illuminate/contracts": "5.0 - 5.8|^6.0|^7.0|^8.0|^9.0|^10.0", - "illuminate/filesystem": "5.0 - 5.8|^6.0|^7.0|^8.0|^9.0|^10.0", - "symfony/http-foundation": "2.6 - 4|^5.0|^6.0" + "php": "^8.2", + "illuminate/contracts": "^11.0", + "illuminate/filesystem": "^11.0", + "symfony/http-foundation": "^7.0" }, "require-dev": { - "illuminate/container": "5.0 - 5.8|^6.0|^7.0|^8.0|^9.0|^10.0", - "mockery/mockery": "^0.9.5|^1.4.4", - "phpunit/phpunit": "^4.8|^9.5", - "symfony/var-dumper": "^4.4|^5.0|^6.0" + "illuminate/container": "^11.0", + "laravel/pint": "^1.14", + "mockery/mockery": "^1.6.9", + "pestphp/pest": "3.x-dev", + "phpunit/phpunit": "^11.0", + "symfony/var-dumper": "^7.0" }, "suggest": { "illuminate/console": "Allows clearing the cache via artisan" @@ -45,5 +47,10 @@ "Silber\\PageCache\\LaravelServiceProvider" ] } + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true + } } } diff --git a/phpunit.xml b/phpunit.xml index 3347b75..b698ad3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,18 +1,8 @@ - - - - ./tests/ - - + + + + ./tests/ + + diff --git a/tests/CacheTest.php b/tests/CacheTest.php index e4043a8..925ce0c 100644 --- a/tests/CacheTest.php +++ b/tests/CacheTest.php @@ -17,14 +17,14 @@ class CacheTest extends TestCase /** * The filesystem mock instance. * - * @var \Illuminate\Filesystem\Filesystem + * @var Filesystem */ protected $files; /** * The cache instance. * - * @var \Silber\PageCache\Cache + * @var Cache */ protected $cache; @@ -135,6 +135,8 @@ public function testCanPullCachePathFromContainer() public function testCachesRootToSpecialFilename() { + $this->expectNotToPerformAssertions(); + $this->files->shouldReceive('makeDirectory')->once() ->with('page-cache', 0775, true, true); @@ -147,6 +149,8 @@ public function testCachesRootToSpecialFilename() public function testCachesJsonResponsesWithJsonExtension() { + $this->expectNotToPerformAssertions(); + $content = ['this' => 'is', 'json' => [1, 2, 3]]; $this->files->shouldReceive('makeDirectory')->once() @@ -164,6 +168,8 @@ public function testCachesJsonResponsesWithJsonExtension() public function testCachesResponsesWithJsonHeaderWithJsonExtension() { + $this->expectNotToPerformAssertions(); + $json = json_encode(['this' => 'is', 'json' => [1, 2, 3]]); $this->files->shouldReceive('makeDirectory')->once() @@ -181,6 +187,8 @@ public function testCachesResponsesWithJsonHeaderWithJsonExtension() public function testCachesResponsesWithXmlHeaderWithXmlExtension() { + $this->expectNotToPerformAssertions(); + $xml = 'This is XML. Prove me wrong.'; $this->files->shouldReceive('makeDirectory')->twice()