Skip to content

Commit 651f19b

Browse files
authored
Merge pull request #142 from beyondcode/l13-compatibility
Laravel 13 compatibility
2 parents c3dee1c + 36aa7c7 commit 651f19b

9 files changed

Lines changed: 74 additions & 81 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,39 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest]
16-
php: [8.0, 8.1, 8.2]
17-
laravel: ['8.*', '9.*', '10.*', '11.*', '12.*']
16+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
17+
laravel: ['10.*', '11.*', '12.*', '13.*']
1818
stability: [prefer-stable]
1919
exclude:
20-
- php: 8.0
21-
laravel: 10.*
22-
- php: 8.2
23-
laravel: 8.*
24-
- laravel: 11.*
25-
php: 8.0
26-
- laravel: 11.*
27-
php: 8.1
28-
- laravel: 12.*
29-
php: 8.0
30-
- laravel: 12.*
31-
php: 8.1
20+
- laravel: '10.*'
21+
php: '8.4'
22+
- laravel: '10.*'
23+
php: '8.5'
24+
- laravel: '11.*'
25+
php: '8.1'
26+
- laravel: '11.*'
27+
php: '8.5'
28+
- laravel: '12.*'
29+
php: '8.1'
30+
- laravel: '13.*'
31+
php: '8.1'
32+
- laravel: '13.*'
33+
php: '8.2'
3234
include:
33-
- laravel: 10.*
34-
testbench: 8.*
35-
- laravel: 9.*
36-
testbench: 7.*
37-
- laravel: 8.*
38-
testbench: 6.23
39-
- laravel: 11.*
40-
testbench: 9.*
41-
- laravel: 12.*
42-
testbench: 10.*
35+
- laravel: '10.*'
36+
testbench: '8.*'
37+
- laravel: '11.*'
38+
testbench: '9.*'
39+
- laravel: '12.*'
40+
testbench: '10.*'
41+
- laravel: '13.*'
42+
testbench: '11.*'
4343

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

4646
steps:
4747
- name: Checkout code
48-
uses: actions/checkout@v2
48+
uses: actions/checkout@v4
4949

5050
- name: Setup PHP
5151
uses: shivammathur/setup-php@v2

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.0",
20-
"illuminate/container": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
21-
"illuminate/database": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
22-
"illuminate/log": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
23-
"illuminate/routing": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
24-
"illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0",
19+
"php": "^8.1",
20+
"illuminate/container": "^10.0|^11.0|^12.0|^13.0",
21+
"illuminate/database": "^10.0|^11.0|^12.0|^13.0",
22+
"illuminate/log": "^10.0|^11.0|^12.0|^13.0",
23+
"illuminate/routing": "^10.0|^11.0|^12.0|^13.0",
24+
"illuminate/support": "^10.0|^11.0|^12.0|^13.0",
2525
"willdurand/email-reply-parser": "^2.8",
26-
"zbateson/mail-mime-parser": "^1.1|^2.4|^3.0"
26+
"zbateson/mail-mime-parser": "^2.4|^3.0|^4.0"
2727
},
2828
"require-dev": {
2929
"laminas/laminas-mail": "^2.13",
3030
"mockery/mockery": "^1.2",
31-
"orchestra/testbench": "^4.0|^5.0|^7.0|^8.0|^9.0|^10.0",
32-
"phpunit/phpunit": "^7.0|^8.0|^9.3|^10.5|^11.5.3"
31+
"orchestra/testbench": "^8.0|^9.0|^10.0|^11.0",
32+
"phpunit/phpunit": "^10.5|^11.0|^12.0"
3333
},
3434
"autoload": {
3535
"psr-4": {

tests/Console/CleanEmailsTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Carbon\Carbon;
99
use Illuminate\Support\Collection;
1010
use Illuminate\Support\Str;
11+
use PHPUnit\Framework\Attributes\Test;
1112

1213
class CleanEmailsTest extends TestCase
1314
{
@@ -20,7 +21,7 @@ public function setUp(): void
2021
$this->app['config']->set('mailbox.store_incoming_emails_for_days', 31);
2122
}
2223

23-
/** @test */
24+
#[Test]
2425
public function it_can_clean_the_statistics()
2526
{
2627
Collection::times(200)->each(function (int $index) {
@@ -41,7 +42,7 @@ public function it_can_clean_the_statistics()
4142
$this->assertCount(0, InboundEmail::where('created_at', '<', $cutOffDate)->get());
4243
}
4344

44-
/** @test */
45+
#[Test]
4546
public function it_errors_if_max_age_inf()
4647
{
4748
$this->app['config']->set('mailbox.store_incoming_emails_for_days', INF);

tests/Controllers/MailgunTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace BeyondCode\Mailbox\Tests\Controllers;
44

55
use BeyondCode\Mailbox\Tests\TestCase;
6+
use PHPUnit\Framework\Attributes\Test;
67

78
class MailgunTest extends TestCase
89
{
@@ -13,7 +14,7 @@ protected function getEnvironmentSetUp($app)
1314
$app['config']['mailbox.driver'] = 'mailgun';
1415
}
1516

16-
/** @test */
17+
#[Test]
1718
public function it_verifies_mailgun_signatures()
1819
{
1920
$this->post('/laravel-mailbox/mailgun/mime', [
@@ -38,7 +39,7 @@ public function it_verifies_mailgun_signatures()
3839
])->assertStatus(200);
3940
}
4041

41-
/** @test */
42+
#[Test]
4243
public function it_verifies_fresh_timestamps()
4344
{
4445
$timestamp = now()->subMinutes(5)->timestamp;

tests/Controllers/PostmarkTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace BeyondCode\Mailbox\Tests\Controllers;
44

55
use BeyondCode\Mailbox\Tests\TestCase;
6+
use PHPUnit\Framework\Attributes\Test;
67

78
class PostmarkTest extends TestCase
89
{
@@ -13,7 +14,7 @@ protected function getEnvironmentSetUp($app)
1314
$app['config']['mailbox.driver'] = 'postmark';
1415
}
1516

16-
/** @test */
17+
#[Test]
1718
public function it_expects_to_receive_raw_email_field()
1819
{
1920
$this->withoutMiddleware();

tests/Drivers/LogTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use BeyondCode\Mailbox\Tests\TestCase;
88
use Illuminate\Mail\Mailable;
99
use Illuminate\Support\Facades\Mail;
10+
use PHPUnit\Framework\Attributes\Test;
1011

1112
class LogTest extends TestCase
1213
{
@@ -18,7 +19,7 @@ protected function getEnvironmentSetUp($app)
1819
$app['config']['mailbox.driver'] = 'log';
1920
}
2021

21-
/** @test */
22+
#[Test]
2223
public function it_catches_logged_mails()
2324
{
2425
Mailbox::from('{name}@beyondco.de', function (InboundEmail $email, $name) {

tests/InboundEmailTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use BeyondCode\Mailbox\InboundEmail;
77
use Illuminate\Mail\Mailable;
88
use Illuminate\Support\Facades\Mail;
9+
use PHPUnit\Framework\Attributes\Test;
910

1011
class InboundEmailTest extends TestCase
1112
{
@@ -17,7 +18,7 @@ protected function getEnvironmentSetUp($app)
1718
$app['config']['mailbox.driver'] = 'log';
1819
}
1920

20-
/** @test */
21+
#[Test]
2122
public function it_stores_inbound_emails()
2223
{
2324
Mailbox::to('someone@beyondco.de', function ($email) {
@@ -29,7 +30,7 @@ public function it_stores_inbound_emails()
2930
$this->assertSame(1, InboundEmail::query()->count());
3031
}
3132

32-
/** @test */
33+
#[Test]
3334
public function it_stores_all_inbound_emails()
3435
{
3536
$this->app['config']['mailbox.only_store_matching_emails'] = false;
@@ -43,7 +44,7 @@ public function it_stores_all_inbound_emails()
4344
$this->assertSame(2, InboundEmail::query()->count());
4445
}
4546

46-
/** @test */
47+
#[Test]
4748
public function it_can_use_fallbacks()
4849
{
4950
Mailbox::fallback(function (InboundEmail $email) {
@@ -57,7 +58,7 @@ public function it_can_use_fallbacks()
5758
Mail::assertSent(ReplyMail::class);
5859
}
5960

60-
/** @test */
61+
#[Test]
6162
public function it_can_use_catchall()
6263
{
6364
Mailbox::to('someone@beyondco.de', function ($email) {
@@ -74,7 +75,7 @@ public function it_can_use_catchall()
7475
Mail::assertSent(ReplyMail::class);
7576
}
7677

77-
/** @test */
78+
#[Test]
7879
public function it_stores_inbound_emails_with_catchall()
7980
{
8081
Mailbox::catchAll(function ($email) {
@@ -86,7 +87,7 @@ public function it_stores_inbound_emails_with_catchall()
8687
$this->assertSame(2, InboundEmail::query()->count());
8788
}
8889

89-
/** @test */
90+
#[Test]
9091
public function it_stores_inbound_emails_with_fallback()
9192
{
9293
Mailbox::fallback(function ($email) {
@@ -98,7 +99,7 @@ public function it_stores_inbound_emails_with_fallback()
9899
$this->assertSame(2, InboundEmail::query()->count());
99100
}
100101

101-
/** @test */
102+
#[Test]
102103
public function it_stores_inbound_emails_with_fallback_and_catchall_only_once()
103104
{
104105
Mailbox::fallback(function ($email) {
@@ -113,7 +114,7 @@ public function it_stores_inbound_emails_with_fallback_and_catchall_only_once()
113114
$this->assertSame(2, InboundEmail::query()->count());
114115
}
115116

116-
/** @test */
117+
#[Test]
117118
public function it_does_not_store_inbound_emails_if_configured()
118119
{
119120
$this->app['config']['mailbox.store_incoming_emails_for_days'] = 0;
@@ -127,7 +128,7 @@ public function it_does_not_store_inbound_emails_if_configured()
127128
$this->assertSame(0, InboundEmail::query()->count());
128129
}
129130

130-
/** @test */
131+
#[Test]
131132
public function it_can_reply_to_mails()
132133
{
133134
Mailbox::from('example@beyondco.de', function (InboundEmail $email) {
@@ -141,7 +142,7 @@ public function it_can_reply_to_mails()
141142
Mail::assertSent(ReplyMail::class);
142143
}
143144

144-
/** @test */
145+
#[Test]
145146
public function it_uses_the_configured_model()
146147
{
147148
$this->app['config']['mailbox.model'] = ExtendedInboundEmail::class;

tests/MailboxRouteCollectionTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
use BeyondCode\Mailbox\Routing\Route;
77
use BeyondCode\Mailbox\Routing\RouteCollection;
88
use Laminas\Mail\Message as TestMail;
9+
use PHPUnit\Framework\Attributes\Test;
910

1011
class MailboxRouteCollectionTest extends TestCase
1112
{
12-
/** @test */
13+
#[Test]
1314
public function it_returns_all_matching_mailbox_routes()
1415
{
1516
$collection = new RouteCollection();

0 commit comments

Comments
 (0)