Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function testEmailIsSentOnContact(): void |
||
15 | { |
||
16 | $model = new ContactForm(); |
||
17 | |||
18 | $model->attributes = [ |
||
19 | 'name' => 'Tester', |
||
20 | 'email' => '[email protected]', |
||
21 | 'subject' => 'very important letter subject', |
||
22 | 'body' => 'body of current message', |
||
23 | 'verifyCode' => 'testme', |
||
24 | ]; |
||
25 | |||
26 | verify($model->contact('[email protected]'))->notEmpty(); |
||
27 | |||
28 | // using Yii2 module actions to check email was sent |
||
29 | $this->tester->seeEmailIsSent(); |
||
30 | |||
31 | /** @var MessageInterface $emailMessage */ |
||
32 | $emailMessage = $this->tester->grabLastSentEmail(); |
||
33 | verify($emailMessage)->instanceOf('yii\mail\MessageInterface'); |
||
34 | verify($emailMessage->getTo())->arrayHasKey('[email protected]'); |
||
35 | verify($emailMessage->getFrom())->arrayHasKey('[email protected]'); |
||
36 | verify($emailMessage->getReplyTo())->arrayHasKey('[email protected]'); |
||
37 | verify($emailMessage->getSubject())->equals('very important letter subject'); |
||
38 | verify($emailMessage->toString())->stringContainsString('body of current message'); |
||
39 | } |
||
41 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths