Код: Выделить всё
1) ContactFormTest: Send email
Test tests\unit\models\ContactFormTest.php:testSendEmail
emails were sent
Failed asserting that an array is not empty.
#1 Codeception\Module\Yii2->seeEmailIsSent
#2 C:\OSPanel\domains\sphere\sphere\frontend\tests\_support\_generated\UnitTesterActions.php:240
#3 C:\OSPanel\domains\sphere\sphere\frontend\tests\unit\models\ContactFormTest.php:28
FAILURES!
Tests: 1, Assertions: 2, Failures: 1.
Код: Выделить всё
class ContactFormTest extends \Codeception\Test\Unit
{
/** @var UnitTester $tester */
protected $tester;
public function testSendEmail()
{
$model = new ContactForm();
$model->attributes = [
'name' => 'Tester',
'email' => '[email protected]',
'subject' => 'very important letter subject',
'body' => 'body of current message',
'verifyCode' => 'testme',
];
expect_that($model->sendEmail('[email protected]'));
// using Yii2 module actions to check email was sent
$this->tester->seeEmailIsSent();
}
}
Куда копать?