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

StrTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testMask() 0 4 1
A maskData() 0 9 1
1
<?php
2
3
namespace Nip\Utility\Tests;
4
5
use Nip\Utility\Str;
6
7
/**
8
 * Class StrTest
9
 * @package Nip\Utility\Tests
10
 */
11
class StrTest extends AbstractTest
12
{
13
    /**
14
     * @param $data
15
     * @param $start
16
     * @param $end
17
     * @param $masked
18
     * @dataProvider maskData()
19
     */
20
    public function testMask($data, $start, $end, $masked)
21
    {
22
        self::assertSame($masked, Str::mask($data, $start, $end));
23
    }
24
25
    /**
26
     * @return array
27
     */
28
    public function maskData()
29
    {
30
        return [
31
            ['test', 0, null, '****'],
32
            ['test', 1, null, 't***'],
33
            ['foe', 2, 1, '***'],
34
            ['lorem', 5, false, '*****'],
35
        ];
36
    }
37
}
38