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

StrTest::maskData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
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