PhpSpreadsheet/tests/PhpSpreadsheetTests/Style/NumberFormatDateTest.php

32 lines
815 B
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Style;
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
2016-03-22 14:35:50 +00:00
class NumberFormatDateTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
StringHelper::setDecimalSeparator('.');
StringHelper::setThousandsSeparator(',');
}
/**
* @dataProvider providerNumberFormat
*/
public function testFormatValueWithMask()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array([NumberFormat::class, 'toFormattedString'], $args);
$this->assertEquals($expectedResult, $result);
}
public function providerNumberFormat()
{
return require 'data/Style/NumberFormatDates.php';
}
}