Skip to content

Commit

Permalink
Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSilber committed Mar 19, 2024
1 parent 64284cb commit 1e20afd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 37 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
vendor
composer.lock
.phpunit.result.cache
.phpunit.cache
23 changes: 15 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -45,5 +47,10 @@
"Silber\\PageCache\\LaravelServiceProvider"
]
}
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
22 changes: 6 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
12 changes: 10 additions & 2 deletions tests/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -135,6 +135,8 @@ public function testCanPullCachePathFromContainer()

public function testCachesRootToSpecialFilename()
{
$this->expectNotToPerformAssertions();

$this->files->shouldReceive('makeDirectory')->once()
->with('page-cache', 0775, true, true);

Expand All @@ -147,6 +149,8 @@ public function testCachesRootToSpecialFilename()

public function testCachesJsonResponsesWithJsonExtension()
{
$this->expectNotToPerformAssertions();

$content = ['this' => 'is', 'json' => [1, 2, 3]];

$this->files->shouldReceive('makeDirectory')->once()
Expand All @@ -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()
Expand All @@ -181,6 +187,8 @@ public function testCachesResponsesWithJsonHeaderWithJsonExtension()

public function testCachesResponsesWithXmlHeaderWithXmlExtension()
{
$this->expectNotToPerformAssertions();

$xml = 'This is XML. Prove me wrong.';

$this->files->shouldReceive('makeDirectory')->twice()
Expand Down

0 comments on commit 1e20afd

Please sign in to comment.