【发布时间】:2016-08-10 15:21:37
【问题描述】:
我希望能够测试结果是电子邮件 (myMail@provider.com ..)
我已经尝试使用这个来测试它是否是字符串:
$this->assertInternalType('string', $myExpectedEmail);
但我认为它不是很准确......我试过这个:
$this->assertInternalType('email', $myExpectedEmail);
但我收到此错误:
Type specified for PHPUnit_Framework_Constraint_IsType <email> is not a valid type.
关于如何在 PHPunit 中测试电子邮件格式的任何想法/最佳实践?
【问题讨论】:
标签: php unit-testing email testing phpunit