Skip to content

Commit 5c73cb5

Browse files
authored
laravel 11 support (#3)
1 parent 4357b17 commit 5c73cb5

File tree

3 files changed

+49
-16
lines changed

3 files changed

+49
-16
lines changed

.github/workflows/laravel.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,53 @@ name: Laravel
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, main ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ master, main ]
88

99
jobs:
1010
laravel-tests:
11-
1211
runs-on: ubuntu-latest
1312

13+
strategy:
14+
matrix:
15+
php-version: ['8.2', '8.3']
16+
laravel-version: ['8.*', '9.*', '10.*', '11.*']
17+
include:
18+
- laravel-version: '8.*'
19+
testbench-version: '^6.0'
20+
- laravel-version: '9.*'
21+
testbench-version: '^7.0'
22+
- laravel-version: '10.*'
23+
testbench-version: '^8.0'
24+
- laravel-version: '11.*'
25+
testbench-version: '^9.0'
26+
27+
name: PHP ${{ matrix.php-version }} - Laravel ${{ matrix.laravel-version }}
28+
1429
steps:
15-
- uses: actions/checkout@v2
16-
- name: Copy .env
17-
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
18-
- name: Install Dependencies
19-
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
30+
- uses: actions/checkout@v4
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php-version }}
36+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
37+
coverage: none
38+
39+
- name: Cache Composer packages
40+
id: composer-cache
41+
uses: actions/cache@v3
42+
with:
43+
path: vendor
44+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-php-${{ matrix.php-version }}-
47+
48+
- name: Install dependencies
49+
run: |
50+
composer require "laravel/framework:${{ matrix.laravel-version }}" "orchestra/testbench:${{ matrix.testbench-version }}" --no-interaction --no-update
51+
composer update --prefer-dist --no-interaction --no-suggest
52+
2053
- name: Execute tests (Unit and Feature tests) via PHPUnit
2154
run: vendor/bin/phpunit

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
}
2020
],
2121
"require": {
22-
"php": "^8.0",
23-
"illuminate/support": "^8.0|^9.0|^10.0",
22+
"php": "^8.2",
23+
"illuminate/support": "^8.0|^9.0|^10.0|^11.0",
2424
"spatie/laravel-webhook-client": "^3.0",
25-
"twilio/sdk": "^6.37|^7.0"
25+
"twilio/sdk": "^6.37|^7.0|^8.0"
2626
},
2727
"require-dev": {
28-
"orchestra/testbench": "^6.0|^7.0|^8.0",
29-
"phpunit/phpunit": "^9.4|^10.0"
28+
"orchestra/testbench": "^6.0|^7.0|^8.0|^9.0",
29+
"phpunit/phpunit": "^9.4|^10.0|^11.0"
3030
},
3131
"autoload": {
3232
"psr-4": {

tests/TestCase.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Tests;
44

55
use BinaryCats\TwilioWebhooks\TwilioWebhooksServiceProvider;
6-
use Exception;
6+
use Throwable;
77
use Illuminate\Contracts\Debug\ExceptionHandler;
88
use Illuminate\Foundation\Exceptions\Handler;
99
use Orchestra\Testbench\TestCase as OrchestraTestCase;
@@ -68,8 +68,8 @@ protected function disableExceptionHandling()
6868
$this->app->instance(ExceptionHandler::class, new class extends Handler
6969
{
7070
public function __construct(){}
71-
public function report(Exception $e){}
72-
public function render($request, Exception $exception){throw $exception;}
71+
public function report(Throwable $e){}
72+
public function render($request, Throwable $exception){throw $exception;}
7373
});
7474
}
7575
}

0 commit comments

Comments
 (0)