PHPackages                             tijmen-wierenga/laravel-mail-tester - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. tijmen-wierenga/laravel-mail-tester

ActiveLibrary[Testing &amp; Quality](/categories/testing)

tijmen-wierenga/laravel-mail-tester
===================================

An extension to Laravel's TestCase which allows you to run unit tests on emails

v0.1.2(9y ago)01961MITPHP

Since Jul 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/TijmenWierenga/LaravelMailTester)[ Packagist](https://packagist.org/packages/tijmen-wierenga/laravel-mail-tester)[ RSS](/packages/tijmen-wierenga-laravel-mail-tester/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (4)Used By (0)

LaravelMailTester
=================

[](#laravelmailtester)

An extension to Laravel's TestCase which allows you to run unit tests on emails.

Installation
============

[](#installation)

```
composer require tijmen-wierenga/laravel-mail-tester
```

Next, add the trait to the `TestCase` class located at `tests/TestCase`:

```
use TijmenWierenga\LaravelMailTester\TestsEmail;

class TestCase extends Laravel\Lumen\Testing\TestCase
{

    use TestsEmail;

    ...

}
```

How it works
============

[](#how-it-works)

LaravelMailTester adds an event listener as a plugin when in a testing environment. It tracks when an email is sent, and stores all data in the test case. You can then perform assertions against it.

Usage
=====

[](#usage)

```
class AuthenticationTest extends TestCase
{
  /**
  * @test
  */
  public function it_sends_an_email() {
    // Send an email
    Mail::raw('Wow, awesome email testing!', function($mail) {
      $mail->to('tijmen@floown.com');
      $mail->from('no-reply@floown.com');
      $mail->subject('Read this awesome email');
    }

    $this->assertEmailWasSent()
      ->assertEmailWasSentTo('tijmen@floown.com')
      ->assertEmailWasSentFrom('no-reply@floown.com')
      ->assertEmailBodyContains('awesome email testing')
  }
}
```

More assertions to come.

License
=======

[](#license)

The MIT License (MIT).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3620d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8513032?v=4)[Tijmen Wierenga](/maintainers/TijmenWierenga)[@TijmenWierenga](https://github.com/TijmenWierenga)

---

Top Contributors

[![TijmenWierenga](https://avatars.githubusercontent.com/u/8513032?v=4)](https://github.com/TijmenWierenga "TijmenWierenga (10 commits)")

### Embed Badge

![Health badge](/badges/tijmen-wierenga-laravel-mail-tester/health.svg)

```
[![Health](https://phpackages.com/badges/tijmen-wierenga-laravel-mail-tester/health.svg)](https://phpackages.com/packages/tijmen-wierenga-laravel-mail-tester)
```

###  Alternatives

[dms/phpunit-arraysubset-asserts

This package provides ArraySubset and related asserts once deprecated in PHPUnit 8

14228.7M340](/packages/dms-phpunit-arraysubset-asserts)[orchestra/workbench

Workbench Companion for Laravel Packages Development

8219.1M69](/packages/orchestra-workbench)[phpbenchmark/phpbenchmark

Easy to use benchmark toolkit for your PHP-application. This library contains classes for comparing algorithms as well as benchmarking application responses

8011.5k2](/packages/phpbenchmark-phpbenchmark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
