GeneralTest::data_valid_email()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ByTIC\Validator\Tests\Functions;
6
7
use ByTIC\Validator\Tests\AbstractTest;
8
9
/**
10
 * Class GeneralTest.
11
 */
12
class GeneralTest extends AbstractTest
13
{
14
    /**
15
     * @dataProvider data_valid_email
16
     *
17
     * @param string $email
18
     * @param bool   $valid
19
     */
20
    public function testValidEmail($email, $valid)
21
    {
22
        static::assertSame(valid_email($email), $valid);
23
    }
24
25
    /**
26
     * @return array[]
27
     */
28
    public function data_valid_email()
29
    {
30
        return [
31
            ['[email protected]', true],
32
            ['[email protected]', true],
33
            ['[email protected]', false],
34
        ];
35
    }
36
}
37