NumberFormatTest.php 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. require_once 'testDataFileIterator.php';
  3. class NumberFormatTest extends PHPUnit_Framework_TestCase
  4. {
  5. public function setUp()
  6. {
  7. if (!defined('PHPEXCEL_ROOT')) {
  8. define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
  9. }
  10. require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
  11. PHPExcel_Shared_String::setDecimalSeparator('.');
  12. PHPExcel_Shared_String::setThousandsSeparator(',');
  13. }
  14. /**
  15. * @dataProvider providerNumberFormat
  16. */
  17. public function testFormatValueWithMask()
  18. {
  19. $args = func_get_args();
  20. $expectedResult = array_pop($args);
  21. $result = call_user_func_array(array('PHPExcel_Style_NumberFormat','toFormattedString'),$args);
  22. $this->assertEquals($expectedResult, $result);
  23. }
  24. public function providerNumberFormat()
  25. {
  26. return new testDataFileIterator('rawTestData/Style/NumberFormat.data');
  27. }
  28. }