Skip to content

Add support for Laravel 10 #46

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

Merged
merged 4 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 18 additions & 29 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,22 @@ jobs:

strategy:
matrix:
php: [8.1, 8.0, 7.4, 7.3, 7.2]
laravel: [9.*, 8.*, 7.*, 6.*]
os: [ubuntu-latest]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*
- laravel: 6.*
testbench: 4.*
exclude:
- laravel: 9.*
php: 7.2
- laravel: 9.*
php: 7.3
- laravel: 9.*
php: 7.4
- laravel: 8.*
php: 7.2
- laravel: 6.*
php: 8.1
- laravel: 7.*
php: 8.1
payload:
- { laravel: '10.*', php: '8.2', 'testbench': '8.*'}
- { laravel: '10.*', php: '8.1', 'testbench': '8.*'}
- { laravel: '9.*', php: '8.2', 'testbench': '7.*'}
- { laravel: '9.*', php: '8.1', 'testbench': '7.*'}
- { laravel: '9.*', php: '8.0', 'testbench': '7.*'}
- { laravel: '8.*', php: '8.1', 'testbench': '6.*'}
- { laravel: '8.*', php: '8.0', 'testbench': '6.*'}
- { laravel: '8.*', php: '7.4', 'testbench': '6.*'}
- { laravel: '7.*', php: '8.0', 'testbench': '5.*' }
- { laravel: '7.*', php: '7.4', 'testbench': '5.*' }
- { laravel: '6.*', php: '8.0', 'testbench': '4.*' }
- { laravel: '6.*', php: '7.4', 'testbench': '4.*' }

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
name: PHP ${{ matrix.payload.php }} - Laravel ${{ matrix.payload.laravel }}

services:
mysql:
Expand All @@ -54,19 +43,19 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: ${{ matrix.payload.php }}
extensions: mbstring, dom, fileinfo, mysql
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction --no-suggest
composer require "laravel/framework:${{ matrix.payload.laravel }}" "orchestra/testbench:${{ matrix.payload.testbench }}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction
- name: Execute tests
env:
CI_DB_DRIVER: mysql
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 6.1.0 - 2023-02-08

**Changed**

- Added support for Laravel 10

## 6.0.0 - 2022-02-10

**Added**
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ We feel the package is currently feature complete, but feel free to send a pull

This package requires Laravel 6.0 or higher.

Please check the table below for supported Laravel and PHP versions:

|Laravel Version| PHP Version |
|---|---|
| 6.x | 7.2 or 7.3 or 7.4 or 8.0
| 7.x | 7.2 or 7.3 or 7.4 or 8.0
| 8.x | 7.3 or 7.4 or 8.0 or 8.1
| 9.x | 8.0 or 8.1
Please check the [Laravel support policy](https://laravel.com/docs/master/releases#support-policy) table for supported Laravel and PHP versions.

# Installation

Expand Down
26 changes: 25 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,30 @@
},
"require-dev": {
"mockery/mockery": "^1.2",
"orchestra/testbench": "^3.5 || ^3.6 || ^3.7 || ^3.8 || ^4.0 || ^5.0"
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"l10": [
"composer require laravel/framework:10.* orchestra/testbench:8.* --no-interaction --no-update",
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
],
"l9": [
"composer require laravel/framework:9.* orchestra/testbench:7.* --no-interaction --no-update",
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
],
"l8": [
"composer require laravel/framework:8.* orchestra/testbench:6.* --no-interaction --no-update",
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
],
"l7": [
"composer require laravel/framework:8.* orchestra/testbench:6.* --no-interaction --no-update",
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
],
"l6": [
"composer require laravel/framework:8.* orchestra/testbench:6.* --no-interaction --no-update",
"composer update --prefer-stable --prefer-dist --no-interaction --no-suggest"
]
}
}
50 changes: 20 additions & 30 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
<?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">

<testsuites>
<testsuite name="Orchestra\Testbench Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="log"/>
<env name="DB_CONNECTION" value="testbench"/>
</php>

<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage includeUncoveredFiles="false">
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Orchestra\Testbench Test Suite">
<directory suffix="Test.php">./tests/</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="log"/>
<env name="DB_CONNECTION" value="testbench"/>
</php>
</phpunit>
4 changes: 0 additions & 4 deletions src/MailableReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ private function readSubject(EmailComposer $composer): void
*/
private function readBody(EmailComposer $composer): void
{
if (app()->version() < '5.5') {
throw new Exception('Mailables cannot be read by Laravel 5.4 and below. Sorry.');
}

$composer->setData('view', '');

$mailable = $composer->getData('mailable');
Expand Down