From baa9ea0dbb38049112ed0809bbe90fe0f6a7acd7 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 12:26:55 +0100 Subject: [PATCH 01/10] Widen supported range of mail parser package --- composer.json | 2 +- src/Module/MailCatcher.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 1fb3d08..e43a988 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "ext-json": "*", "guzzlehttp/guzzle": "^6.0 || ^7.0", "codeception/codeception": "^4.0 || ^5.0", - "zbateson/mail-mime-parser": "^1.2" + "zbateson/mail-mime-parser": "^1.2 || ^2.0 || ^3.0 || ^4.0" }, "autoload": { "psr-4": { diff --git a/src/Module/MailCatcher.php b/src/Module/MailCatcher.php index f8fa4d5..05b0b1c 100644 --- a/src/Module/MailCatcher.php +++ b/src/Module/MailCatcher.php @@ -308,7 +308,7 @@ public function grabUrlsFromLastEmail(): array $regex = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#'; $email = $this->lastMessage(); - $message = Message::from($email->getSource()); + $message = Message::from($email->getSource(), false); $text = $message->getTextContent(); preg_match_all($regex, $text, $text_matches); @@ -331,7 +331,7 @@ public function grabAttachmentsFromLastEmail(): array { $email = $this->lastMessage(); - $message = Message::from($email->getSource()); + $message = Message::from($email->getSource(), false); $attachments = []; @@ -354,7 +354,7 @@ public function grabAttachmentsFromLastEmail(): array public function seeAttachmentInLastEmail(string $expectedFilename): void { $email = $this->lastMessage(); - $message = Message::from($email->getSource()); + $message = Message::from($email->getSource(), false); foreach ($message->getAllAttachmentParts() as $attachmentPart) { if ($attachmentPart->getFilename() === $expectedFilename) { @@ -384,7 +384,7 @@ public function seeEmailCount(int $expected): void public function seeEmailAttachmentCount(int $expectedCount): void { $email = $this->lastMessage(); - $message = Message::from($email->getSource()); + $message = Message::from($email->getSource(), false); $this->assertEquals($expectedCount, $message->getAttachmentCount()); } From 3899fa90433af438180fef1ed343aa58fa61c2f2 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 12:31:41 +0100 Subject: [PATCH 02/10] Allow use of Guzzle 8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index e43a988..c397782 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require": { "php": "^7.4 || ^8.0", "ext-json": "*", - "guzzlehttp/guzzle": "^6.0 || ^7.0", + "guzzlehttp/guzzle": "^6.0 || ^7.0 || ^8.0", "codeception/codeception": "^4.0 || ^5.0", "zbateson/mail-mime-parser": "^1.2 || ^2.0 || ^3.0 || ^4.0" }, From d3a30f98f25ed925d2e40181136455ec13ed6540 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 12:33:24 +0100 Subject: [PATCH 03/10] Expand tested PHP range --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68b3820..064b886 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3'] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] codeception: ['^4.0', '^5.0'] exclude: # Codeception 5 requires PHP ≥ 8 From 6d0845a8de6feefaaaa537922a8023a56d72bc75 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 12:34:13 +0100 Subject: [PATCH 04/10] Run tests against lowest and highest permited dependencies --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 064b886..39c4861 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,6 +19,7 @@ jobs: matrix: php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] codeception: ['^4.0', '^5.0'] + deps: ['lowest', 'latest'] exclude: # Codeception 5 requires PHP ≥ 8 - php: '7.4' From 68f6ec408d3ede684157483ea0671833bba1183b Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 12:58:56 +0100 Subject: [PATCH 05/10] Restrict Gherkin library when testing on Codeception 4.x https://github.com/Behat/Gherkin/pull/288 breaks the Codeception Gherkin loader. --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 39c4861..6476840 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,8 +44,8 @@ jobs: php-version: ${{ matrix.php }} - uses: ramsey/composer-install@v3 with: - dependency-versions: highest - composer-options: "--with=codeception/codeception:${{ matrix.codeception }}" + dependency-versions: ${{ matrix.deps }} + composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }}" - run: php vendor/bin/codecept build - name: Acceptance tests run: php vendor/bin/codecept run acceptance -d From bb1ca2cdc1d43ecb4c4dffb1236a196cec14ecf0 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 13:05:07 +0100 Subject: [PATCH 06/10] Test matrix should ignore advisories when resolving versions This retains malware protection whilst preventing advisories being published in packages breaking the test workflow. --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6476840..43990e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,6 +43,8 @@ jobs: ini-values: "sendmail_path = /usr/bin/env catchmail -f some@from.address" php-version: ${{ matrix.php }} - uses: ramsey/composer-install@v3 + env: + COMPOSER_POLICY_ADVISORIES_BLOCK: 0 with: dependency-versions: ${{ matrix.deps }} composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }}" From 37bae74b36b75a74c88e4144dd49d1fe338f66c9 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 13:18:13 +0100 Subject: [PATCH 07/10] Raise minimum supported library versions in line with what passes CI --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c397782..0cf57c8 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,9 @@ "require": { "php": "^7.4 || ^8.0", "ext-json": "*", - "guzzlehttp/guzzle": "^6.0 || ^7.0 || ^8.0", + "guzzlehttp/guzzle": "^6.3 || ^7.0 || ^8.0", "codeception/codeception": "^4.0 || ^5.0", - "zbateson/mail-mime-parser": "^1.2 || ^2.0 || ^3.0 || ^4.0" + "zbateson/mail-mime-parser": "^1.3.1 || ^2.0 || ^3.0 || ^4.0" }, "autoload": { "psr-4": { @@ -25,7 +25,7 @@ } }, "require-dev": { - "codeception/module-asserts": "^1.1 || ^2", + "codeception/module-asserts": "^1.3.1 || ^2", "phpmailer/phpmailer": "^6.1.6" }, "suggest": { From 14426658b8301c14948b172aa6153bba08c1273e Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 13:29:06 +0100 Subject: [PATCH 08/10] symfony/yaml < 2.8 does not work on PHP >= 8 Emits fatal error: Array and string offset access syntax with curly braces is no longer supported... --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 43990e8..23fba53 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,7 +47,7 @@ jobs: COMPOSER_POLICY_ADVISORIES_BLOCK: 0 with: dependency-versions: ${{ matrix.deps }} - composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }}" + composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }} ${{ case(matrix.php == '7.4', '', '--with=symfony/yaml:>=2.8.0') }}" - run: php vendor/bin/codecept build - name: Acceptance tests run: php vendor/bin/codecept run acceptance -d From 50456915a4bdd6fa15b8f6e708fbf2d8d6a2c94e Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 13:34:58 +0100 Subject: [PATCH 09/10] Handle PHP 8.5 removing INI option `register_argc_argv` https://github.com/Codeception/Codeception/commit/72ea677d5cab0cb7b6d4d4af02fe9cfeac405caf --- .github/workflows/tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 23fba53..a1d8c75 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,6 +24,14 @@ jobs: # Codeception 5 requires PHP ≥ 8 - php: '7.4' codeception: '^5.0' + # PHP >= 8.5 will not run Codeception 4 + - php: '8.5' + codeception: '^4.0' + deps: 'lowest' + # PHP >= 8.5 will not run Codeception 4 + - php: '8.5' + codeception: '^4.0' + deps: 'latest' steps: - uses: actions/checkout@v4 @@ -47,7 +55,7 @@ jobs: COMPOSER_POLICY_ADVISORIES_BLOCK: 0 with: dependency-versions: ${{ matrix.deps }} - composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }} ${{ case(matrix.php == '7.4', '', '--with=symfony/yaml:>=2.8.0') }}" + composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.php == '8.5', '--with codeception/codeception:>=5.3.4', '') }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }} ${{ case(matrix.php == '7.4', '', '--with=symfony/yaml:>=2.8.0') }}" - run: php vendor/bin/codecept build - name: Acceptance tests run: php vendor/bin/codecept run acceptance -d From 9c0972c4ce6bb5cc9465e820aacfc7895cb5aeac Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 29 Sep 2026 13:53:35 +0100 Subject: [PATCH 10/10] Require at least PHPUnit 9.6 on PHP 8 Resolves a lot of odd failures due to incompatibilities between Codeception and PHPUnit which are not expressed in package constraints. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a1d8c75..bbd2a06 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -55,7 +55,7 @@ jobs: COMPOSER_POLICY_ADVISORIES_BLOCK: 0 with: dependency-versions: ${{ matrix.deps }} - composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.php == '8.5', '--with codeception/codeception:>=5.3.4', '') }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }} ${{ case(matrix.php == '7.4', '', '--with=symfony/yaml:>=2.8.0') }}" + composer-options: "--with=codeception/codeception:${{ matrix.codeception }} ${{ case(matrix.php == '8.5', '--with codeception/codeception:>=5.3.4', '') }} ${{ case(matrix.codeception == '^4.0', '--with=behat/gherkin:<4.13', '') }} ${{ case(matrix.php == '7.4', '', '--with=symfony/yaml:>=2.8.0 --with=phpunit/phpunit:>=9.6') }}" - run: php vendor/bin/codecept build - name: Acceptance tests run: php vendor/bin/codecept run acceptance -d