Skip to content

Commit

Permalink
Support Laravel 11 (#436)
Browse files Browse the repository at this point in the history
* Update composer.json

* Tweak testsuite

* Tweak testsuite

* Tweak testsuite

* Tweak testsuite
  • Loading branch information
barryvdh authored Mar 9, 2024
1 parent c32d507 commit 6bf5a8f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 83 deletions.
64 changes: 13 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,11 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
laravel: [ '6', '7', '8', '9', '10' ]
php: [ '8.1', '8.2', '8.3']
laravel: [ '9', '10', '11' ]
exclude:
- php: '7.2'
laravel: '8'
- php: '7.2'
laravel: '9'
- php: '7.3'
laravel: '9'
- php: '7.4'
laravel: '9'
- php: '8.1'
laravel: '6'
- php: '8.1'
laravel: '7'
- php: '8.2'
laravel: '6'
- php: '8.2'
laravel: '7'
- php: '7.2'
laravel: '10'
- php: '7.3'
laravel: '10'
- php: '7.4'
laravel: '10'
- php: '8.0'
laravel: '10'
- laravel: 11
php: 8.1

name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }}

Expand All @@ -55,30 +33,6 @@ jobs:
- name: Setup Problem Matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Select Laravel 6
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:6.*" "phpunit/phpunit:^8.5.8|^9.3.7" --no-update --no-interaction
if: "matrix.laravel == '6'"

- name: Select Laravel 7
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:7.*" "phpunit/phpunit:^8.5.8|^9.3.7" --no-update --no-interaction
if: "matrix.laravel == '7'"

- name: Select Laravel 8
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:8.*" "phpunit/phpunit:^9.3.7" --no-update --no-interaction
if: "matrix.laravel == '8'"

- name: Select Laravel 9
uses: nick-invision/retry@v1
with:
Expand All @@ -95,6 +49,14 @@ jobs:
command: composer require "laravel/framework:10.*" "phpunit/phpunit:^9.3.7" --no-update --no-interaction
if: "matrix.laravel == '10'"

- name: Select Laravel 11
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "laravel/framework:11.*" "phpunit/phpunit:^9.3.7" --no-update --no-interaction
if: "matrix.laravel == '11'"

- name: Install PHP Dependencies
uses: nick-invision/retry@v1
with:
Expand All @@ -106,7 +68,7 @@ jobs:
run: ./vendor/bin/phpunit --coverage-clover clover.xml

- name: Execute code style checks
run: ./vendor/bin/phpcs --standard=PSR2 -p --ignore=./tests/storage/* --report=full --report-checkstyle=build/logs/checkstyle.xml src/ tests/
run: ./vendor/bin/phpcs --standard=PSR2 -p --ignore=./tests/storage/* src/ tests/

- name: Check code coverage
if: ${{ matrix.php == '8.1' }}
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
}
],
"require": {
"php": "^7.2.5 || ^8.0",
"php": "^8.1",
"twig/twig": "~3.0",
"illuminate/support": "^6|^7|^8|^9|^10",
"illuminate/view": "^6|^7|^8|^9|^10"
"illuminate/support": "^9|^10|^11",
"illuminate/view": "^9|^10|^11"
},
"require-dev": {
"ext-json": "*",
"laravel/framework": "^6|^7|^8|^9|^10",
"laravel/framework": "^9|^10|^11",
"mockery/mockery": "^1.3.1",
"phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.7",
"phpunit/phpunit": "^8.5.8 || ^9.3.7",
"squizlabs/php_codesniffer": "^3.6"
},
"suggest": {
"twig/extensions": "~1.0",
"laravelcollective/html": "For bringing back html/form in Laravel 5.x"
"laravelcollective/html": "For bringing back html/form in Laravel"
},
"autoload": {
"psr-4": {
Expand Down
25 changes: 0 additions & 25 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,5 @@
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
<exclude>
<directory suffix=".php">./src/config</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html"
target="build/coverage"
title="TwigBridge"
charset="UTF-8"
yui="true"
highlight="true" />

<log type="coverage-text"
target="php://stdout"
title="TwigBridge"
charset="UTF-8"
lowUpperBound="50"
highLowerBound="90" />

<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion tests/Node/GetAttrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function getTests()
$tests[] = [
$node,
sprintf(
'%s%s, "bar", [0 => %s, 1 => "bar"], "method", false, false, false, 1)',
'%s%s, "bar", [%s, "bar"], "method", false, false, false, 1)',
$this->getAttributeGetter(),
$this->getVariableGetter('foo', 1),
$this->getVariableGetter('foo')
Expand Down

0 comments on commit 6bf5a8f

Please sign in to comment.