diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68b3820..bbd2a06 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,12 +17,21 @@ 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'] + deps: ['lowest', 'latest'] exclude: # 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 @@ -42,9 +51,11 @@ 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: highest - composer-options: "--with=codeception/codeception:${{ matrix.codeception }}" + 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 --with=phpunit/phpunit:>=9.6') }}" - run: php vendor/bin/codecept build - name: Acceptance tests run: php vendor/bin/codecept run acceptance -d diff --git a/composer.json b/composer.json index 1fb3d08..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", + "guzzlehttp/guzzle": "^6.3 || ^7.0 || ^8.0", "codeception/codeception": "^4.0 || ^5.0", - "zbateson/mail-mime-parser": "^1.2" + "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": { 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()); }