ValidAuthorTest::testEmailWithExtension()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Maestriam\Samurai\Tests\Unit\Foundation\SyntaxValidator;
4
5
/**
6
 * Testes de funcionalidades básicas apresentadas no README.md
7
 */
8
class ValidAuthorTest extends SyntaxValidatorTestCase
9
{
10
    /**
11
     * Undocumented function
12
     *
13
     * @return void
14
     */
15
    public function testHappyPath()
16
    {
17
        $author = "Giu <[email protected]>";
18
19
        $this->assertValidAuthor($author);
20
    }
21
22
    /**
23
     * Undocumented function
24
     *
25
     * @return void
26
     */
27
    public function testSurname()
28
    {
29
        $author = "Giu <[email protected]>";
30
31
        $this->assertValidAuthor($author);
32
    }
33
34
    /**
35
     * Undocumented function
36
     *
37
     * @return void
38
     */
39
    public function testInvalidEmail()
40
    {
41
        $author = "Giu <[email protected]>";
42
43
        $this->assertInvalidAuthor($author);
44
    }
45
46
    public function testInvalidAuthorNames()
47
    {
48
        $authors = [
49
            'MYXOMc <[email protected]>'
50
        ];
51
52
        foreach ($authors as $author) {
53
            $this->assertInvalidAuthor($author);
54
        }
55
    }
56
57
    /**
58
     * Undocumented function
59
     *
60
     * @return void
61
     */
62
    public function testNameWithAccentures()
63
    {
64
        $author = "João Mädchen <[email protected]>";
65
66
        $this->assertInvalidAuthor($author);
67
    }
68
69
    /**
70
     * Undocumented function
71
     *
72
     * @return void
73
     */
74
    public function testSpacesBetweenInfos()
75
    {
76
        $author = "Giu           <[email protected]>";
77
78
        $this->assertValidAuthor($author);
79
    }
80
81
    /**
82
     * Undocumented function
83
     *
84
     * @return void
85
     */
86
    public function testEmailWithExtension()
87
    {
88
        $author = "Giu <[email protected]>";
89
90
        $this->assertValidAuthor($author);
91
    }
92
93
    /**
94
     * Undocumented function
95
     *
96
     * @return void
97
     */
98
    public function testEmailStartsWithNumber()
99
    {
100
        $author = "Giu <[email protected]>";
101
102
        $this->assertValidAuthor($author);
103
    }
104
}
105