Skip to content

[Mailer] Add a MailerAssertionsTrait in KernelTestCase #35510

Closed
@adrienfr

Description

@adrienfr

Description
Since 4.4, we have new PHPUnit constraints for the mailer component, but these are only available with WebTestCase and not KernelTestCase. I think this would be useful to access these constraints from both TestCase. If the email is queued, we could use the assertQueuedEmailCount() function.

Example
For instance, I have a service which sends an email with an attached document, I would like to test that the email is correctly sent and that there is an attached document with it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions