kibao/behat-mailcatcher-extension
Composer 安装命令:
composer require kibao/behat-mailcatcher-extension
包简介
MailCatcher extension for Behat
README 文档
README
MailCatcher is a super simple SMTP server which catches any message sent to it.
MailCatcherExtension provides:
Kibao\Behat\MailCatcherExtension\Context\MailCatcherAwareContext, which provides MailCatcherClientinstance for your context.MailCatcherContextcontext which provides base step definitions for your contexts.
Installation
This extension requires:
- Behat 3.0+
Through Composer
-
Add MailCatcherExtension to your composer.json:
{ "require-dev": { ... "kibao/mailcatcher": "*@dev", "kibao/behat-mailcatcher-extension": "0.2.*@dev" } }
-
Install or update vendors:
$ composer update kibao/mailcatcher kibao/behat-mailcatcher-extension
-
Activate extension in your
behat.yml:default: # ... extensions: Kibao\Behat\MailCatcherExtension\Extension: ~
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
First of all you need to have installed MailCatcher.
There are few options:
-
Extending
RawMailCatcherContextin your feature suite. It provides you preconfigured MailCatcher with basic methods.RawMailCatcherContextdoesn't provide any step definitions, so you can extend it in many contexts. -
Extending
MailCatcherContextwith one of your contexts. It provides you same things asRawMailCatcherContextand also predefined steps out of the box. -
Adding
MailCatcherContextas context in your suite.default: suites: my_suite: contexts: - FeatureContext - Kibao\Behat\MailCatcherExtension\Context\MailCatcherContext
-
Implementing
MailCatcherAwareContextwith your context. Target context must implementsetMailCatcher(ClientInterface $mailcatcher). This method would be automatically called immediately after each context creation before each scenario.$mailcatcherwill be preconfigured client based on your settings.
统计信息
- 总下载量: 60.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-05-08