PhpSpreadsheet/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php

32 lines
806 B
PHP
Raw Normal View History

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