tomi0 / mailhog-api-testing
Mailhog testing api.
Installs: 8 847
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^7.3|^7.4|^8.0|^8.1|^8.2|^8.3
- ext-json: *
- guzzlehttp/guzzle: ^6.3.1|^7.0.1
Requires (Dev)
- phpmailer/phpmailer: ^6.5
- phpunit/phpunit: ^9
This package is not auto-updated.
Last update: 2025-01-02 13:11:25 UTC
README
Test that your emails are sent
Install
composer require tomi0/mailhog-api-testing
Usage
Use Mailhog testing trait in your test:
use Mailhog\MailhogTesting; class ClassName { use MailhogTesting; ... }
Set up environment:
$this->setUpMailhogEnviroment($host, $smtpPort, $webPort, $isHttps);
Available methods:
// Check if message exsits (return bool) $this->messageExistsByContent($content); $this->messageExists($content); // Get all messages (return EmailMessage[]) $this->getAllMessages(); // Clear inbox (return bool) $this->clearInbox(); $this->emptyInbox();