Issues (31)

tests/src/MessageBuilder/MessageProxyTest.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Nip\Mail\Tests\MessageBuilder;
4
5
use Nip\Mail\MessageBuilder;
6
use Nip\Mail\Tests\AbstractTest;
7
8
class MessageProxyTest extends AbstractTest
9
{
10
    public function testProxyFrom()
11
    {
12
        $builder = new MessageBuilder();
13
        $builder->from('[email protected]');
0 ignored issues
show
The method from() does not exist on Nip\Mail\MessageBuilder. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $builder->/** @scrutinizer ignore-call */ 
14
                  from('[email protected]');
Loading history...
14
15
        $message = $builder->getMessage();
16
        self::assertSame('[email protected]', $message->getFrom()[0]->toString());
17
    }
18
19
    public function testProxyAddTo()
20
    {
21
        $builder = new MessageBuilder();
22
        $builder->addTo('[email protected]', 'Solomon');
23
24
        $message = $builder->getMessage();
25
        self::assertSame('"Solomon" <[email protected]>', $message->getTo()[0]->toString());
26
    }
27
}
28