Skip to content
Merged
17 changes: 14 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,9 +51,11 @@ jobs:
ini-values: "sendmail_path = /usr/bin/env catchmail -f [email protected]"
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
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"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": {
"Codeception\\": "src"
}
},
"require-dev": {
"codeception/module-asserts": "^1.1 || ^2",
"codeception/module-asserts": "^1.3.1 || ^2",
"phpmailer/phpmailer": "^6.1.6"
},
"suggest": {
Expand Down
8 changes: 4 additions & 4 deletions src/Module/MailCatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -331,7 +331,7 @@ public function grabAttachmentsFromLastEmail(): array
{
$email = $this->lastMessage();

$message = Message::from($email->getSource());
$message = Message::from($email->getSource(), false);

$attachments = [];

Expand All @@ -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) {
Expand Down Expand Up @@ -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());
}

Expand Down
Loading