Failed Conditions
Push — master ( ff7329...d32c3b )
by Sylvain
02:29
created

FormatTest::testRemoveAccents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix;
6
7
use Ecodev\Felix\Format;
8
9
final class FormatTest extends \PHPUnit\Framework\TestCase
10
{
11
    public function truncateProvider(): array
12
    {
13
        return [
14
            [['abcdef', 100], 'abcdef'],
15
            [['abcdef', 6], 'abcdef'],
16
            [['abcdef', 3], 'ab…'],
17
            [['abcdef', 3, ''], 'abc'],
18
            [['abcdefghi', 5, 'foo'], 'abfoo'],
19
        ];
20
    }
21
22
    /**
23
     * @dataProvider truncateProvider
24
     */
25
    public function testTruncate(array $args, string $expected): void
26
    {
27
        $actual = Format::truncate(...$args);
28
        self::assertSame($expected, $actual);
29
    }
30
}
31