Skip to content

Commit

Permalink
Laravel 10.x Compatibility (#8)
Browse files Browse the repository at this point in the history
* Bump dependencies for Laravel 10

* Update GitHub Actions for Laravel 10

* Update test matrix

* update matrix

* fix

* Revert "fix"

This reverts commit a81a1b5.

* Migrate PHPUnit config

* Fix

* WIP

---------

Co-authored-by: Jacob Bennett <jacob.j.bennett@gmail.com>
Co-authored-by: Luke Bouch <luke@lukebouch.com>
  • Loading branch information
3 people committed Apr 17, 2023
1 parent f7b2dcb commit 945c9e4
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 31 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ jobs:
matrix:
os: [ubuntu-latest]
php: [8.0, 8.1]
laravel: [9.*]
laravel: [9.*, 10.*]
stability: [prefer-stable]
exclude:
- laravel: 10.*
php: 8.0
include:
- laravel: 10.*
testbench: ^8.0
- laravel: 9.*
testbench: ^7.6

Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
],
"require": {
"php": "^7.4|^8.0|^8.1",
"illuminate/support": "^7.0|^8.0|^9.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0",
"laravel/legacy-factories": "^1.1"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"orchestra/testbench": "^6.0|^8.0",
"phpunit/phpunit": "^9.5"
},
"autoload": {
Expand All @@ -38,7 +38,6 @@
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"

},
"config": {
"sort-packages": true
Expand Down
39 changes: 14 additions & 25 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
<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>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
27 changes: 27 additions & 0 deletions phpunit.xml.dist.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
4 changes: 2 additions & 2 deletions tests/Feature/DispatchesNotifiableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function should_dispatch_notifiable_for_subscribed_user()
SalesOrderApprovedNotification::dispatch($payload = [1, 2, 3]);

//Assert
Notification::assertTimesSent(1, SalesOrderApprovedNotification::class);
Notification::assertSentTimes(SalesOrderApprovedNotification::class, 1);

Notification::assertSentTo($user, SalesOrderApprovedNotification::class, function ($notification) use ($payload) {
$this->assertEquals($payload, $notification->payload);
Expand Down Expand Up @@ -87,6 +87,6 @@ public function should_not_dispatch_notifiable_for_not_found_users()
SalesOrderApprovedNotification::dispatch();

//Assert
Notification::assertTimesSent(1, SalesOrderApprovedNotification::class);
Notification::assertSentTimes(SalesOrderApprovedNotification::class, 1);
}
}

0 comments on commit 945c9e4

Please sign in to comment.