Issues (9)

tests/Composer/EmailComposerTest.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FH\Bundle\MailerBundle\Tests\Composer;
6
7
use FH\Bundle\MailerBundle\Composer\EmailComposer;
8
use FH\Bundle\MailerBundle\Email\MessageOptions;
9
use FH\Bundle\MailerBundle\Email\Participants;
10
use PHPUnit\Framework\TestCase;
0 ignored issues
show
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Symfony\Component\Mime\Address;
12
use Symfony\Component\Mime\Email;
13
14
/**
15
 * @covers \FH\Bundle\MailerBundle\Composer\EmailComposer
16
 */
17
final class EmailComposerTest extends TestCase
18
{
19
    /** @var Address */
20
    private $sender;
21
22
    /** @var Address */
23
    private $to;
24
25
    /** @var MessageOptions */
26
    private $messageOptions;
27
28
    /** @var EmailComposer */
29
    private $emailComposer;
30
31
    protected function setUp(): void
32
    {
33
        $this->sender = new Address('[email protected]', 'Mr. Test');
34
        $this->to = new Address('[email protected]', 'Ms. Test');
35
36
        $this->messageOptions = new MessageOptions(
37
            'Test email',
38
            null,
39
            null,
40
            new Participants(
41
                $this->sender,
42
                [$this->sender],
43
                [$this->sender],
44
                [$this->to],
45
                [$this->to],
46
                [$this->to]
47
            )
48
        );
49
50
        $this->emailComposer = new EmailComposer($this->messageOptions);
51
    }
52
53
    public function testReturnedMessageType(): void
54
    {
55
        $email = $this->emailComposer->compose();
56
57
        $this->assertInstanceOf(Email::class, $email);
58
    }
59
}
60