2015-07-31 23:39:10 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
require_once 'testDataFileIterator.php';
|
|
|
|
|
|
|
|
class NumberFormatDateTest extends PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
2016-03-22 14:19:00 +00:00
|
|
|
\PHPExcel\Shared\String::setDecimalSeparator('.');
|
|
|
|
\PHPExcel\Shared\String::setThousandsSeparator(',');
|
2015-07-31 23:39:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerNumberFormat
|
|
|
|
*/
|
|
|
|
public function testFormatValueWithMask()
|
|
|
|
{
|
|
|
|
$args = func_get_args();
|
|
|
|
$expectedResult = array_pop($args);
|
|
|
|
$result = call_user_func_array(array('PHPExcel_Style_NumberFormat','toFormattedString'), $args);
|
|
|
|
$this->assertEquals($expectedResult, $result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerNumberFormat()
|
|
|
|
{
|
|
|
|
return new testDataFileIterator('rawTestData/Style/NumberFormatDates.data');
|
|
|
|
}
|
|
|
|
}
|