PHPackages                             kibao/behat-mailcatcher-extension - 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. kibao/behat-mailcatcher-extension

ActiveBehat-extension[Testing &amp; Quality](/categories/testing)

kibao/behat-mailcatcher-extension
=================================

MailCatcher extension for Behat

760.0k[3 issues](https://github.com/kibao/behat-mailcatcher-extension/issues)PHP

Since May 9Pushed 12y ago2 watchersCompare

[ Source](https://github.com/kibao/behat-mailcatcher-extension)[ Packagist](https://packagist.org/packages/kibao/behat-mailcatcher-extension)[ RSS](/packages/kibao-behat-mailcatcher-extension/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

MailCatcher Extension
=====================

[](#mailcatcher-extension)

[![Build Status](https://camo.githubusercontent.com/00539532d6cb27249ebb058d9a9294e551578d7b2599da7637221bb12eee75f5/68747470733a2f2f7472617669732d63692e6f72672f6b6962616f2f62656861742d6d61696c636174636865722d657874656e73696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kibao/behat-mailcatcher-extension)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/77027d97d5fc185d8e4cdfe8b26a8cae07c3c6a5fbc2b9e372db10f2bc84f9a3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6962616f2f62656861742d6d61696c636174636865722d657874656e73696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f733d64353434643032646533383931386139363064643466363465313637616563393766386330396262)](https://scrutinizer-ci.com/g/kibao/behat-mailcatcher-extension/)

[MailCatcher](http://mailcatcher.me) is a super simple SMTP server which catches any message sent to it.

MailCatcherExtension provides:

- `Kibao\Behat\MailCatcherExtension\Context\MailCatcherAwareContext`, which provides MailCatcher `Client` instance for your context.
- `MailCatcherContext` context which provides base step definitions for your contexts.

Installation
------------

[](#installation)

This extension requires:

- Behat 3.0+

### Through Composer

[](#through-composer)

1. Add MailCatcherExtension to your composer.json:

    ```
    {
        "require-dev": {
            ...
            "kibao/mailcatcher": "*@dev",
            "kibao/behat-mailcatcher-extension": "0.2.*@dev"
        }
    }
    ```
2. Install or update vendors:

    ```
    $ composer update kibao/mailcatcher kibao/behat-mailcatcher-extension
    ```
3. Activate extension in your `behat.yml`:

    ```
    default:
       # ...
       extensions:
            Kibao\Behat\MailCatcherExtension\Extension: ~
    ```

Configuration
-------------

[](#configuration)

Default configuration:

```
default:
    # ...
    extensions:
        Kibao\Behat\MailCatcherExtension\Extension:
            client:
                url:    http://localhost    # MailCatcher http url
                port:   1080                # MailCatcher http port
            purge_before_scenario:      true
            mailcatcher_client:         kibao.mailcatcher.client.default    # client service
            mailcatcher_connection:     kibao.mailcatcher.connection.guzzle # connection service
```

Usage
-----

[](#usage)

First of all you need to have installed [MailCatcher](http://mailcatcher.me/).

There are few options:

1. Extending `RawMailCatcherContext` in your feature suite. It provides you preconfigured MailCatcher with basic methods. `RawMailCatcherContext` doesn't provide any step definitions, so you can extend it in many contexts.
2. Extending `MailCatcherContext` with one of your contexts. It provides you same things as `RawMailCatcherContext` and also predefined steps out of the box.
3. Adding `MailCatcherContext` as context in your suite.

    ```
    default:
      suites:
        my_suite:
          contexts:
            - FeatureContext
            - Kibao\Behat\MailCatcherExtension\Context\MailCatcherContext
    ```
4. Implementing `MailCatcherAwareContext` with your context. Target context must implement `setMailCatcher(ClientInterface $mailcatcher)`. This method would be automatically called immediately after each context creation before each scenario. `$mailcatcher` will be preconfigured client based on your settings.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1156678?v=4)[Przemysław Piechota](/maintainers/kibao)[@kibao](https://github.com/kibao)

---

Top Contributors

[![kibao](https://avatars.githubusercontent.com/u/1156678?v=4)](https://github.com/kibao "kibao (11 commits)")

### Embed Badge

![Health badge](/badges/kibao-behat-mailcatcher-extension/health.svg)

```
[![Health](https://phpackages.com/badges/kibao-behat-mailcatcher-extension/health.svg)](https://phpackages.com/packages/kibao-behat-mailcatcher-extension)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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