Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports Laravel 11 #329

Merged
merged 19 commits into from
Feb 3, 2024
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@2.29.0
with:
php-version: '8.0'
php-version: 8.3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe phpstan should be tested on the latest stable version.


- name: Install composer dependencies
uses: ramsey/composer-install@v2
Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.2, 8.1, 8.0, 7.4]
laravel: [10.*, 9.*, 8.*, 7.*]
php: [8.3, 8.2, 8.1, 8.0, 7.4]
laravel: [11.*, 10.*, 9.*, 8.*, 7.*]
dependency-version: [prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
Expand All @@ -22,20 +24,28 @@ jobs:
- laravel: 7.*
testbench: 5.*
exclude:
- laravel: 7.*
php: 8.2
- laravel: 7.*
- laravel: 11.*
php: 8.1
- laravel: 9.*
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 7.4
- laravel: 9.*
php: 7.3
- laravel: 10.*
php: 8.0
- laravel: 10.*
php: 7.4
- laravel: 10.*
php: 7.3
- laravel: 9.*
php: 8.3
- laravel: 9.*
php: 7.4
- laravel: 8.*
php: 8.3
- laravel: 7.*
php: 8.3
- laravel: 7.*
php: 8.2
- laravel: 7.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

Expand All @@ -57,8 +67,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-core:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
composer update --${{ matrix.dependency-version }} --with=laravel/framework:${{ matrix.laravel }} --with=orchestra/testbench-core:${{ matrix.testbench }} --prefer-dist --no-interaction

- name: Execute tests
run: vendor/bin/pest
19 changes: 10 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"require": {
"ext-json": "*",
"php": "^7.4|^8.0",
"illuminate/contracts": "^7.20|^8.19|^9.0|^10.0",
"illuminate/database": "^7.20|^8.19|^9.0|^10.0",
"illuminate/queue": "^7.20|^8.19|^9.0|^10.0",
"illuminate/support": "^7.20|^8.19|^9.0|^10.0",
"illuminate/contracts": "^7.20|^8.19|^9.0|^10.0|^11.0",
"illuminate/database": "^7.20|^8.19|^9.0|^10.0|^11.0",
"illuminate/queue": "^7.20|^8.19|^9.0|^10.0|^11.0",
"illuminate/support": "^7.20|^8.19|^9.0|^10.0|^11.0",
"rector/rector": "^0.19.2",
"spatie/backtrace": "^1.0",
"spatie/ray": "^1.41.1",
Expand All @@ -30,12 +30,13 @@
},
"require-dev": {
"guzzlehttp/guzzle": "^7.3",
"laravel/framework": "^7.20|^8.19|^9.0|^10.0",
"orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0",
"pestphp/pest": "^1.22",
"laravel/framework": "^7.20|^8.19|^9.0|^10.0|^11.0",
"orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0|^9.0",
"pestphp/pest": "^1.22|^2.0",
"phpstan/phpstan": "^1.10.57",
"phpunit/phpunit": "^9.3",
"spatie/pest-plugin-snapshots": "^1.1"
"phpunit/phpunit": "^9.3|^10.1",
"spatie/pest-plugin-snapshots": "^1.1|^2.0",
"symfony/var-dumper": "^4.2|^5.1|^6.0|^7.0.3"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
</logging>
<php>
<env name="APP_DEBUG" value="true" />
<env name="CACHE_DRIVER" value="array" />
<env name="CACHE_STORE" value="array" />
</php>
</phpunit>
2 changes: 1 addition & 1 deletion tests/RayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
expect($payloads[0]['payloads'][0]['content']['values']['APP_ENV'])->toEqual('local');
expect($payloads[0]['payloads'][0]['content']['values']['DB_DATABASE'])->toEqual('ray_test');
expect($payloads[0]['payloads'][0]['content']['values']['SESSION_LIFETIME'])->toEqual('120');
expect(count($payloads[0]['payloads'][0]['content']['values']))->toBeGreaterThanOrEqual(17);
expect(count($payloads[0]['payloads'][0]['content']['values']))->toBeGreaterThanOrEqual(16);
});

it('sends a filtered environment payload', function () {
Expand Down
11 changes: 10 additions & 1 deletion tests/Unit/MarkdownTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<?php

use function Pest\version;

it('can render and send markdown', function () {
ray()->markdown('## Hello World!');

assertMatchesOsSafeSnapshot($this->client->sentRequests());
});
})->skip(version_compare(version(), '2.0.0', '>='));


it('can render and send markdown for Pest 2', function () {
ray()->markdown('## Hello World!');

assertMatchesOsSafeSnapshot($this->client->sentRequests());
})->skip(version_compare(version(), '2.0.0', '<'));
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"type": "table",
"content": {
"values": {
"Event": "<code>Hit<\/code>",
"Key": "cached-key",
"Value": "cached-value"
"Event": "<code>Missed<\/code>",
"Key": "cached-key"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctly handle the assertion as it was incorrectly showing Hit when it should have been Missed due to defaulting to file cache driver.

},
"label": "Cache"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"uuid": "fakeUuid",
"payloads": [
{
"type": "custom",
"content": {
"content": "<style>a { text-decoration:underline!important; }<\/style><div class=\"w-100 block\" style=\"font-size:1.8em!important;\">Hello World!<\/div>",
"label": "Markdown"
},
"origin": {
"file": "\/vendor\/pestphp\/pest\/src\/Factories\/TestCaseMethodFactory.php",
"line_number": 110,
"hostname": "fake-hostname"
}
}
],
"meta": []
}
]
Loading