kirschbaum-development / mail-intercept

A testing package for intercepting mail sent from Laravel
MIT License
105 stars 7 forks source link

AssertMailSubject, AssertMailBodyContainsString fail with latest release #9

Closed ronfuller closed 2 years ago

ronfuller commented 2 years ago

The functions for assertMailSentSubject, and assertMailBodyContainsStr need to have union types similar to assertMailSentTo

Works: public function assertMailSentTo(array|string $expected, AssertableMessage|Email $mail)

Fails: public function assertMailSubject(string $expected, Email $mail) Fails: public function assertMailBodyContainsString(string $needle, Email $mail)

Note: I think most of the assertions need the union type.

Thanks for looking into this.

Error message: Tests\TestCase::assertMailSubject(): Argument #2 ($mail) must be of type Symfony\Component\Mime\Email, KirschbaumDevelopment\MailIntercept\AssertableMessage given

brandonferens commented 2 years ago

Thanks for posting this @ronfuller. I can look into it, but if you are interested in submitting a PR, feel free.

brandonferens commented 2 years ago

@ronfuller this has been fixed and is released as v0.3.1.