PhpSpreadsheet/tests/PhpSpreadsheetTests/Style/NumberFormatTest.php

33 lines
798 B
PHP
Raw Normal View History

<?php
namespace PhpOffice\PhpSpreadsheetTests\Style;
use PhpOffice\PhpSpreadsheet\Shared\StringHelper;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use PHPUnit_Framework_TestCase;
2016-08-14 04:55:34 +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
*
* @param mixed $expectedResult
*/
public function testFormatValueWithMask($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = NumberFormat::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
}
}