Completed
Push — master ( 59559b...bc4c4e )
by Gabriel
02:27
created

EmailTest::testMask()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Nip\Utility\Tests;
4
5
use Nip\Utility\Email;
6
7
/**
8
 * Class EmailTest
9
 * @package Nip\Utility\Tests
10
 */
11
class EmailTest extends AbstractTest
12
{
13
    /**
14
     * @param $email
15
     * @param $masked
16
     * @dataProvider maskData()
17
     */
18
    public function testMask($email, $masked)
19
    {
20
        self::assertSame($masked, Email::mask($email));
21
    }
22
23
    /**
24
     * @return array
25
     */
26
    public function maskData()
27
    {
28
        return [
29
            ['[email protected]', 'g***@g****.com'],
30
            ['[email protected]', 's******@g****.com'],
31
            ['[email protected]', 's******@g****.c*.uk'],
32
            ['solomon@gmail', 's******@gmail'],
33
            ['solomon', 's******'],
34
        ];
35
    }
36
}
37