Skip to content

Commit

Permalink
Upgrade for Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
mbardelmeijer committed Mar 22, 2024
1 parent 152014c commit 1b06063
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 52 deletions.
85 changes: 43 additions & 42 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
name: run-tests

on: [ push, pull_request ]
on:
push:
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.1 ]
laravel: [ 9.*, 10.* ]
dependency-version: [ prefer-lowest, prefer-stable ]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*

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

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [ 8.3, 8.2 ]
laravel: [ '10.*', '11.*' ]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
- laravel: 10.*
testbench: 8.*

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

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":[],"times":{"NotificationChannels\\Cmsms\\Test\\CmsmsChannelTest::it_can_be_instantiated":0.001,"NotificationChannels\\Cmsms\\Test\\CmsmsChannelTest::it_shares_message":0.002,"NotificationChannels\\Cmsms\\Test\\CmsmsClientTest::it_can_be_instantiated":0.009,"NotificationChannels\\Cmsms\\Test\\CmsmsClientTest::it_can_send_message":0.002,"NotificationChannels\\Cmsms\\Test\\CmsmsClientTest::it_sets_a_default_originator_if_none_is_set":0.002,"NotificationChannels\\Cmsms\\Test\\CmsmsClientTest::it_throws_exception_on_error_response":0,"NotificationChannels\\Cmsms\\Test\\CmsmsClientTest::it_includes_tariff_in_xml":0.001,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_be_instantiated":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_accept_body_content_when_created":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_supports_create_method":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_set_body":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_set_originator":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_cannot_set_an_empty_originator":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_cannot_set_an_originator_thats_too_long":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_set_reference":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_cannot_set_an_empty_reference":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_cannot_set_a_reference_thats_too_long":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_cannot_set_a_reference_that_contains_non_alpha_numeric_values":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_set_tariff":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_can_set_an_empty_tariff":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_cannot_have_a_higher_minimum_than_maximum_for_multipart":0,"NotificationChannels\\Cmsms\\Test\\CmsmsMessageTest::it_xml_contains_only_filled_parameters":0}}
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-simplexml": "*",
"guzzlehttp/guzzle": "^7.1",
"illuminate/notifications": "9.0 || ^10.0",
"illuminate/support": "^9.0 || ^10.0"
"illuminate/support": "^10.0|^11.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.6",
"mockery/mockery": "^1.5",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^9.6"
"orchestra/testbench": "^8.0|^9.0",
"phpunit/phpunit": "^10.5|^11.0"
},
"config": {
"sort-packages": true
Expand Down
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="CmsmsChannel Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>

0 comments on commit 1b06063

Please sign in to comment.