Passed
Pull Request — master (#1)
by
unknown
02:07
created

EmailTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A filter() 0 4 1
A filterNotValid() 0 3 1
A filterNotString() 0 3 1
1
<?php
2
3
namespace TraderInteractive\Filter;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * @coversDefaultClass \TraderInteractive\Filter\Email
9
 */
10
final class EmailTest extends TestCase
11
{
12
    /**
13
     * @test
14
     * @covers ::filter
15
     */
16
    public function filter()
17
    {
18
        $email = '[email protected]';
19
        $this->assertSame($email, Email::filter($email));
20
    }
21
22
    /**
23
     * @test
24
     * @expectedException \TraderInteractive\Exceptions\FilterException
25
     * @expectedExceptionMessage Value '111222333444' is not a string
26
     * @covers ::filter
27
     */
28
    public function filterNotString()
29
    {
30
        Email::filter(111222333444);
31
    }
32
33
    /**
34
     * @test
35
     * @expectedException \TraderInteractive\Exceptions\FilterException
36
     * @expectedExceptionMessage Value '@email.com' is not a valid email
37
     * @covers ::filter
38
     */
39
    public function filterNotValid()
40
    {
41
        Email::filter('@email.com');
42
    }
43
}
44