8 define(
'PHPEXCEL_ROOT', APPLICATION_PATH .
'/');
10 require_once(PHPEXCEL_ROOT .
'PHPExcel/Autoloader.php');
15 if (!class_exists(
'PHPExcel_Style_NumberFormat')) {
23 array(
'$10.11', 10.11, $currencyUSD,
',',
'.',
'$'),
24 array(
'$1,010.12', 1010.12, $currencyUSD,
',',
'.',
'$'),
25 array(
'$20,20', 20.2, $currencyUSD,
'.',
',',
'$'),
26 array(
'$2.020,20', 2020.2, $currencyUSD,
'.',
',',
'$'),
27 array(
'€2.020,20', 2020.2, $currencyEURO,
'.',
',',
'€'),
28 array(
'€ 2.020,20', 2020.2, $currencyEURO,
'.',
',',
'€'),
29 array(
'€2,020.22', 2020.22, $currencyEURO,
',',
'.',
'€'),
36 public function testCurrency($value, $valueBinded, $format, $thousandsSeparator, $decimalSeparator, $currencyCode)
38 $sheet = $this->getMock(
40 array(
'getStyle',
'getNumberFormat',
'setFormatCode',
'getCellCacheController')
42 $cache = $this->getMockBuilder(
'PHPExcel_CachedObjectStorage_Memory')
43 ->disableOriginalConstructor()
45 $cache->expects($this->any())
47 ->will($this->returnValue($sheet));
49 $sheet->expects($this->once())
51 ->will($this->returnSelf());
52 $sheet->expects($this->once())
53 ->method(
'getNumberFormat')
54 ->will($this->returnSelf());
55 $sheet->expects($this->once())
56 ->method(
'setFormatCode')
58 ->will($this->returnSelf());
59 $sheet->expects($this->any())
60 ->method(
'getCellCacheController')
61 ->will($this->returnValue($cache));
70 $binder->bindValue($cell, $value);
71 $this->assertEquals($valueBinded, $cell->getValue());
static setCurrencyCode($pValue='$')
Set the currency code.
static setDecimalSeparator($pValue='.')
Set the decimal separator.
testCurrency($value, $valueBinded, $format, $thousandsSeparator, $decimalSeparator, $currencyCode)
provider
static setThousandsSeparator($pValue=',')
Set the thousands separator.
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'