承接 rezouce/codeception-mailcatcher 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rezouce/codeception-mailcatcher

最新稳定版本:1.1.0

Composer 安装命令:

composer require rezouce/codeception-mailcatcher

包简介

Allow to use Mailcatcher with Codeception

README 文档

README

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

Installation

To add it to your project run composer require rezouce/codeception-mailcatcher

You can then add MailCatcher to your Codeception configuration file in the modules enabled section:

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:

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.

It's also possible to assert on the emails you grab:

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

License

This library is open-sourced software licensed under the MIT license

统计信息

  • 总下载量: 1.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-20