| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 17:18:12 +00:00
										 |  |  | namespace PhpOffice\PhpSpreadsheetTests\Style; | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-31 17:18:12 +00:00
										 |  |  | use PhpOffice\PhpSpreadsheet\Shared\StringHelper; | 
					
						
							|  |  |  | use PhpOffice\PhpSpreadsheet\Style\NumberFormat; | 
					
						
							| 
									
										
										
										
											2016-08-14 04:08:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-22 14:35:50 +00:00
										 |  |  | class NumberFormatDateTest extends \PHPUnit_Framework_TestCase | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  | { | 
					
						
							|  |  |  |     public function setUp() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-08-14 04:08:43 +00:00
										 |  |  |         StringHelper::setDecimalSeparator('.'); | 
					
						
							|  |  |  |         StringHelper::setThousandsSeparator(','); | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerNumberFormat | 
					
						
							| 
									
										
										
										
											2017-01-23 05:49:10 +00:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @param mixed $expectedResult | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2017-01-23 05:49:10 +00:00
										 |  |  |     public function testFormatValueWithMask($expectedResult, ...$args) | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2017-01-23 05:49:10 +00:00
										 |  |  |         $result = NumberFormat::toFormattedString(...$args); | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function providerNumberFormat() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2016-08-16 12:00:19 +00:00
										 |  |  |         return require 'data/Style/NumberFormatDates.php'; | 
					
						
							| 
									
										
										
										
											2015-07-31 23:39:10 +00:00
										 |  |  |     } | 
					
						
							|  |  |  | } |