EmailTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
c 0
b 0
f 0
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A maskData() 0 8 1
A testMask() 0 3 1
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