Skip to content

Commit

Permalink
Merge pull request #17 from kirschbaum-development/attachments
Browse files Browse the repository at this point in the history
Attachments
  • Loading branch information
brandonferens authored Oct 21, 2024
2 parents 952ae68 + e756382 commit 0eb0a15
Show file tree
Hide file tree
Showing 62 changed files with 981 additions and 590 deletions.
16 changes: 0 additions & 16 deletions .editorconfig

This file was deleted.

7 changes: 0 additions & 7 deletions .envrc

This file was deleted.

44 changes: 22 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ on: push
name: CI

jobs:
phpunit-php80:
name: PHP 8.0
pest-php81:
name: PHP 8.1
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.0
image: kirschbaumdevelopment/laravel-test-runner:8.1

steps:
- uses: actions/checkout@v1
Expand All @@ -18,13 +18,13 @@ jobs:
composer install --prefer-dist --no-interaction --no-scripts
- name: Run Testsuite
run: vendor/bin/phpunit tests/
run: composer pest

phpunit-php81:
name: PHP 8.1
pest-php82:
name: PHP 8.2
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.1
image: kirschbaumdevelopment/laravel-test-runner:8.2

steps:
- uses: actions/checkout@v1
Expand All @@ -36,22 +36,22 @@ jobs:
composer install --prefer-dist --no-interaction --no-scripts
- name: Run Testsuite
run: vendor/bin/phpunit tests/
run: composer pest

phpunit-php82:
name: PHP 8.2
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.2
pest-php83:
name: PHP 8.3
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.3

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install composer dependencies
run: |
composer install --prefer-dist --no-interaction --no-scripts
- name: Install composer dependencies
run: |
composer install --prefer-dist --no-interaction --no-scripts
- name: Run Testsuite
run: vendor/bin/phpunit tests/
- name: Run Testsuite
run: composer pest
10 changes: 5 additions & 5 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ on: push
name: Code Style

jobs:
php-cs-fixer:
pint:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.0
image: kirschbaumdevelopment/laravel-test-runner:8.2

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Install PHP CS Fixer
- name: Install composer dependencies
run: |
composer global require friendsofphp/php-cs-fixer
composer install --prefer-dist --no-interaction --no-scripts
- name: Check Coding Standards
run: php-cs-fixer fix --dry-run
run: composer pint-check

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ composer.phar
composer.lock
phpunit.xml
.phpunit.result.cache
.phpunit.cache
.DS_Store
Thumbs.db
.php-cs-fixer.cache
160 changes: 0 additions & 160 deletions .php-cs-fixer.php

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to `mail-intercept` will be documented in this file

## 1.0.0 - 2024-10-21

- Bumped minimum requirement to Laravel 11 and PHP 8.2.
- New attachment and embedded image assertions.
- Pest architecture tests.
- Replace PHP CS Fixer with Laravel Pint.

## 0.5.0 - 2024-03-18

- Added Laravel 11 support.

## 0.4.0 - 2023-04-05

- Added Laravel 10 support. Thank you [@cstriuli](https://github.com/cstriuli).
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Mail isn't faked here. You get to inspect the actual mail ensuring you are sendi

| Laravel Version | Mail Intercept Version |
|:----------------|:-----------------------|
| 11.x | 0.5.x |
| 11.x | 0.6.x |
| 10.x | 0.4.x |
| 9.x | 0.3.x |
| 8.x and lower | 0.2.x |
Expand Down Expand Up @@ -151,6 +151,17 @@ This should be called after `Mail` has been sent, but before your assertions, ot
| `$intercepted->assertPriorityIsLowest();` | |
| `$intercepted->assertPriorityIsLowest();` | |

| Attachment Assertions | Parameters |
|:-------------------------------------------------------|:-------------------|
| `$intercepted->assertHasAttachment($filename);` | `$filename` string |
| `$intercepted->assertHasAttachments();` | |
| `$intercepted->assertMissingAttachment($filename);` | `$filename` string |
| `$intercepted->assertMissingAttachments();` | |
| `$intercepted->assertHasEmbeddedImage($filename);` | `$filename` string |
| `$intercepted->assertHasEmbeddedImages();` | |
| `$intercepted->assertMissingEmbeddedImage($filename);` | `$filename` string |
| `$intercepted->assertMissingEmbeddedImages();` | |

#### Assertion Methods

| Assertions | Parameters |
Expand Down Expand Up @@ -211,6 +222,17 @@ This should be called after `Mail` has been sent, but before your assertions, ot
| `$this->assertMailPriorityIsLowest($mail);` | `$mail` AssertableMessage, Email |
| `$this->assertMailPriorityIsLowest($mail);` | `$mail` AssertableMessage, Email |

| Attachment Assertions | Parameters |
|:---------------------------------------------------|:--------------------------------------------------------|
| `this->assertMailHasAttachment($filename);` | `$filename` string<br/>`$mail` AssertableMessage, Email |
| `this->assertMailHasAttachments();` | `$mail` AssertableMessage, Email |
| `this->assertMailMissingAttachment($filename);` | `$filename` string<br/>`$mail` AssertableMessage, Email |
| `this->assertMailMissingAttachments();` | `$mail` AssertableMessage, Email |
| `this->assertMailHasEmbeddedImage($filename);` | `$filename` string<br/>`$mail` AssertableMessage, Email |
| `this->assertMailHasEmbeddedImages();` | `$mail` AssertableMessage, Email |
| `this->assertMailMissingEmbeddedImage($filename);` | `$filename` string<br/>`$mail` AssertableMessage, Email |
| `this->assertMailMissingEmbeddedImages();` | `$mail` AssertableMessage, Email |

You should use each item of the `interceptedMail()` collection as the mail object for all assertions.

If you are injecting your own headers or need access to other headers in the email, use this assertion to verify they exist and are set properly. These assertions require the header name and the compiled email.
Expand Down
Loading

0 comments on commit 0eb0a15

Please sign in to comment.