File size: 764 Bytes
d2897cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

declare(strict_types=1);

use Mautic\IntegrationsBundle\DTO\Note;
use PHPUnit\Framework\TestCase;

final class NoteTest extends TestCase
{
    public function testGetterFunctions(): void
    {
        $note = 'This is note';
        $type = Note::TYPE_WARNING;

        $noteObject = new Note($note, $type);

        $this->assertSame($note, $noteObject->getNote());
        $this->assertSame($type, $noteObject->getType());
    }

    public function testGetterFunctionsThrowsException(): void
    {
        $this->expectException(InvalidArgumentException::class);
        $this->expectExceptionMessage(sprintf('Type value can be either "%s" or "%s".', Note::TYPE_INFO, Note::TYPE_WARNING));

        $noteObject = new Note('Notes', 'randomType');
    }
}