Completed
Branch develop (b42baf)
by Adrien
11:23
created

NumberFormatDateTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 5
loc 5
rs 9.4285
1
<?php
2
3
namespace PhpSpreadsheetTests\Style;
4
5
use PhpSpreadsheet\Shared\StringHelper;
6
use PhpSpreadsheet\Style\NumberFormat;
7
8 View Code Duplication
class NumberFormatDateTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    public function setUp()
11
    {
12
        StringHelper::setDecimalSeparator('.');
13
        StringHelper::setThousandsSeparator(',');
14
    }
15
16
    /**
17
     * @dataProvider providerNumberFormat
18
     */
19
    public function testFormatValueWithMask()
20
    {
21
        $args = func_get_args();
22
        $expectedResult = array_pop($args);
23
        $result = call_user_func_array([NumberFormat::class, 'toFormattedString'], $args);
24
        $this->assertEquals($expectedResult, $result);
25
    }
26
27
    public function providerNumberFormat()
28
    {
29
        return require 'data/Style/NumberFormatDates.php';
30
    }
31
}
32