Completed
Push — master ( ecb243...bb1b22 )
by Pablo
03:58
created

EmailTest::invalidEmailProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PhpValueObjects\Tests\Identity;
6
7
use PhpValueObjects\Tests\BaseUnitTestCase;
8
9
final class EmailTest extends BaseUnitTestCase
10
{
11
    /**
12
     * @test
13
     */
14
    public function itShouldReturnEmail(): void
15
    {
16
        $email = $this->faker()->email;
17
18
        $emailVO = new Email($email);
19
20
        $this->assertSame($email, $emailVO->value());
21
    }
22
23
    public function invalidEmailProvider(): array
24
    {
25
        return [
26
            [$this->faker()->numberBetween()],
27
            [$this->faker()->address],
28
        ];
29
    }
30
31
    /**
32
     * @test
33
     *
34
     * @dataProvider invalidEmailProvider
35
     */
36
    public function itShouldThrowsException(string $data): void
37
    {
38
        $this->expectException(\Exception::class);
39
40
        new Email($data);
41
    }
42
}
43