我正在为 Codeception 使用 captbariton mailcatcher 模块(https://github.com/captbaritone/codeception-mailcatcher-module)。该系统在本地 XAMPP 安装上运行。我已经在 accepance.suite.xml 中安装并配置了 Mailcatcher 模块,如下所示:
class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser:
url: http://localhost/development/rd_dev/webroot/
- \Helper\Acceptance
- MailCatcher
config:
MailCatcher:
url: 'http://127.0.0.1'
port: '1080'
在一项测试中,我正在从系统发送一封电子邮件。我打印了我在屏幕上发送的电子邮件中的文本,并首先检查它是否正确。我可以手动看到电子邮件出现在地址和端口上的网络浏览器中:http: //127.0.0.1 :1080 / 并且还可以使用一种方法来删除 mailcatcher smtp-server 上的所有消息,$我->重置电子邮件()。
但是,当我使用方法从测试中访问电子邮件的内容时,例如 $I->seeInLastEmail('foo') 或 $text = $I->grabFromLastEmail("bar"),然后我收到显示的错误消息以下:
There was 1 error:
---------
1) ACT1050-SendEmailReportReminderWhenTryingOutServiceCept: Send email with report reminder for one report for the test company to an email address specified by the user (act1050)
Test tests/acceptance/ACT1050- SendEmailReportReminderWhenTryingOutServiceCept.php
[GuzzleHttp\Exception\ServerException] Server error: `GET http://127.0.0.1:1080/messages/3.json` resulted in a `500 Internal Server Error` response: Internal server error
Scenario Steps:
36. $I->seeInLastEmail("report") at tests/acceptance/ACT1050-SendEmailReportReminderWhenTryingOutServiceCept.php:31
35. $I->see("sent 2017-07-29") at tests/acceptance/ACT1050-SendEmailReportReminderWhenTryingOutServiceCept.php:30
34. $I->see("report") at tests/acceptance/ACT1050-SendEmailReportReminderWhenTryingOutServiceCept.php:29
33. $I->see("To: carl@example.com") at tests/acceptance/ACT1050-SendEmailReportReminderWhenTryingOutServiceCept.php:28
32. $I->see("This email has been sent") at tests/acceptance/ACT1050-SendEmailReportReminderWhenTryingOutServiceCept.php:27
31. $I->click("Send email") at tests/acceptance/ACT1050-SendEmailReportReminderWhenTryingOutServiceCept.php:26
#1 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/guzzle/src/Middleware.php:65
#2 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:203
#3 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:156
#4 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/TaskQueue.php:61
#5 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:246
#6 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:223
#7 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:266
#8 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:225
#9 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/promises/src/Promise.php:62
#10 /cygdrive/c/xampp/htdocs/bin/vendor/guzzlehttp/guzzle/src/Client.php:129
我试图摆弄 httpd.conf 文件中访问目录的设置(并在恢复正常后),但我没有成功。
有人可以帮我解决这个问题吗?