| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require_once 'testDataFileIterator.php'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TextDataTest extends PHPUnit_Framework_TestCase | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function setUp() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         if (!defined('PHPEXCEL_ROOT')) { | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  |             define('PHPEXCEL_ROOT', APPLICATION_PATH . '/'); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php'); | 
					
						
							| 
									
										
										
										
											2015-01-23 23:44:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerCHAR | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testCHAR() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerCHAR() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerCODE | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testCODE() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerCODE() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerCONCATENATE | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testCONCATENATE() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerCONCATENATE() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerLEFT | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testLEFT() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerLEFT() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerMID | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testMID() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerMID() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerRIGHT | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testRIGHT() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerRIGHT() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerLOWER | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testLOWER() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerLOWER() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerUPPER | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testUPPER() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerUPPER() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerPROPER | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testPROPER() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerPROPER() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerLEN | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testLEN() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerLEN() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerSEARCH | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testSEARCH() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerSEARCH() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerFIND | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testFIND() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerFIND() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerREPLACE | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testREPLACE() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerREPLACE() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerSUBSTITUTE | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testSUBSTITUTE() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerSUBSTITUTE() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerTRIM | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testTRIM() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerTRIM() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerCLEAN | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testCLEAN() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerCLEAN() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerDOLLAR | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testDOLLAR() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerDOLLAR() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerFIXED | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testFIXED() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerFIXED() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerT | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testT() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 16:34:30 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerT() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/T.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerTEXT | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testTEXT() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         //    Enforce decimal and thousands separator values to UK/US, and currency code to USD
 | 
					
						
							| 
									
										
										
										
											2015-05-17 17:26:34 +00:00
										 |  |  |         call_user_func(array('PHPExcel_Shared_String', 'setDecimalSeparator'), '.'); | 
					
						
							|  |  |  |         call_user_func(array('PHPExcel_Shared_String', 'setThousandsSeparator'), ','); | 
					
						
							|  |  |  |         call_user_func(array('PHPExcel_Shared_String', 'setCurrencyCode'), '$'); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 17:26:34 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData', 'TEXTFORMAT'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerTEXT() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-29 23:12:31 +00:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * @dataProvider providerVALUE | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |     public function testVALUE() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 17:26:34 +00:00
										 |  |  |         call_user_func(array('PHPExcel_Shared_String', 'setDecimalSeparator'), '.'); | 
					
						
							|  |  |  |         call_user_func(array('PHPExcel_Shared_String', 'setThousandsSeparator'), ' '); | 
					
						
							|  |  |  |         call_user_func(array('PHPExcel_Shared_String', 'setCurrencyCode'), '$'); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         $args = func_get_args(); | 
					
						
							|  |  |  |         $expectedResult = array_pop($args); | 
					
						
							| 
									
										
										
										
											2015-05-17 17:26:34 +00:00
										 |  |  |         $result = call_user_func_array(array('PHPExcel_Calculation_TextData', 'VALUE'), $args); | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         $this->assertEquals($expectedResult, $result, null, 1E-8); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2014-08-29 23:12:31 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function providerVALUE() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2015-05-17 13:00:02 +00:00
										 |  |  |         return new testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data'); | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2012-07-31 20:56:11 +00:00
										 |  |  | } |