2017 © Pedro Peláez
 

library codeception-mailcatcher

Allow to use Mailcatcher with Codeception

image

rezouce/codeception-mailcatcher

Allow to use Mailcatcher with Codeception

  • Thursday, July 7, 2016
  • by Rezouce
  • Repository
  • 1 Watchers
  • 1 Stars
  • 932 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

Codeception - module MailCatcher

This is a Codeception module to test the emails send by your application, using MailCatcher., (*1)

Installation

To add it to your project run composer require rezouce/codeception-mailcatcher, (*2)

You can then add MailCatcher to your Codeception configuration file in the modules enabled section:, (*3)

modules:
    enabled:
        - MailCatcher

By default the module will try to contact MailCatcher on http://127.0.0.1:1080, you can change it using the configuration:, (*4)

modules:
    enabled:
        - MailCatcher
    config:
        MailCatcher:
            url: 'http://127.0.0.1'
            port: '1080'

Usage

Assertions

<?php
// Check if there is at least an email
$this->hasEmails();

// Count the number of mails
$this->seeNumberEmails(5);

// Check if at least an email contains a string in its source
$this->seeInEmail('A string.');

Grabbing emails

<?php
$emails = $this->getEmailsBySubject('subject');
$emails = $this->getEmailsBySender('user@example.com');
$emails = $this->getEmailsByRecipients(['user1@example.com']);

By default each of these methods will retrieve emails when the property contains the search criteria. You can change to a strict check by giving a boolean as the second parameter with true as value., (*5)

It's also possible to assert on the emails you grab:, (*6)

<?php
$emails = $this->getEmailsBySubject('subject');
$this->hasEmails($emails);

License

This library is open-sourced software licensed under the MIT license, (*7)

The Versions

07/07 2016

dev-master

9999999-dev

Allow to use Mailcatcher with Codeception

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Rezouce

01/02 2016

1.1.0

1.1.0.0

Allow to use Mailcatcher with Codeception

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Rezouce

23/11 2015

1.0.3

1.0.3.0

Allow to use Mailcatcher with Codeception

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Rezouce

23/11 2015

1.0.2

1.0.2.0

Allow to use Mailcatcher with Codeception

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Rezouce

02/11 2015

1.0.1

1.0.1.0

Allow to use Mailcatcher with Codeception

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Rezouce

26/10 2015

1.0.0

1.0.0.0

Allow to use Mailcatcher with Codeception

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Rezouce