ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
TextDataTest.php
Go to the documentation of this file.
1 <?php
2 
3 
4 require_once 'testDataFileIterator.php';
5 
7 {
8 
9  public function setUp()
10  {
11  if (!defined('PHPEXCEL_ROOT'))
12  {
13  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
14  }
15  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
16 
18  }
19 
23  public function testCHAR()
24  {
25  $args = func_get_args();
26  $expectedResult = array_pop($args);
27  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
28  $this->assertEquals($expectedResult, $result);
29  }
30 
31  public function providerCHAR()
32  {
33  return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
34  }
35 
39  public function testCODE()
40  {
41  $args = func_get_args();
42  $expectedResult = array_pop($args);
43  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
44  $this->assertEquals($expectedResult, $result);
45  }
46 
47  public function providerCODE()
48  {
49  return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
50  }
51 
55  public function testCONCATENATE()
56  {
57  $args = func_get_args();
58  $expectedResult = array_pop($args);
59  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
60  $this->assertEquals($expectedResult, $result);
61  }
62 
63  public function providerCONCATENATE()
64  {
65  return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
66  }
67 
71  public function testLEFT()
72  {
73  $args = func_get_args();
74  $expectedResult = array_pop($args);
75  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
76  $this->assertEquals($expectedResult, $result);
77  }
78 
79  public function providerLEFT()
80  {
81  return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
82  }
83 
87  public function testMID()
88  {
89  $args = func_get_args();
90  $expectedResult = array_pop($args);
91  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
92  $this->assertEquals($expectedResult, $result);
93  }
94 
95  public function providerMID()
96  {
97  return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
98  }
99 
103  public function testRIGHT()
104  {
105  $args = func_get_args();
106  $expectedResult = array_pop($args);
107  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
108  $this->assertEquals($expectedResult, $result);
109  }
110 
111  public function providerRIGHT()
112  {
113  return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
114  }
115 
119  public function testLOWER()
120  {
121  $args = func_get_args();
122  $expectedResult = array_pop($args);
123  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
124  $this->assertEquals($expectedResult, $result);
125  }
126 
127  public function providerLOWER()
128  {
129  return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
130  }
131 
135  public function testUPPER()
136  {
137  $args = func_get_args();
138  $expectedResult = array_pop($args);
139  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
140  $this->assertEquals($expectedResult, $result);
141  }
142 
143  public function providerUPPER()
144  {
145  return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
146  }
147 
151  public function testPROPER()
152  {
153  $args = func_get_args();
154  $expectedResult = array_pop($args);
155  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
156  $this->assertEquals($expectedResult, $result);
157  }
158 
159  public function providerPROPER()
160  {
161  return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
162  }
163 
167  public function testLEN()
168  {
169  $args = func_get_args();
170  $expectedResult = array_pop($args);
171  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
172  $this->assertEquals($expectedResult, $result);
173  }
174 
175  public function providerLEN()
176  {
177  return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
178  }
179 
183  public function testSEARCH()
184  {
185  $args = func_get_args();
186  $expectedResult = array_pop($args);
187  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
188  $this->assertEquals($expectedResult, $result);
189  }
190 
191  public function providerSEARCH()
192  {
193  return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
194  }
195 
199  public function testFIND()
200  {
201  $args = func_get_args();
202  $expectedResult = array_pop($args);
203  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
204  $this->assertEquals($expectedResult, $result);
205  }
206 
207  public function providerFIND()
208  {
209  return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
210  }
211 
215  public function testREPLACE()
216  {
217  $args = func_get_args();
218  $expectedResult = array_pop($args);
219  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
220  $this->assertEquals($expectedResult, $result);
221  }
222 
223  public function providerREPLACE()
224  {
225  return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
226  }
227 
231  public function testSUBSTITUTE()
232  {
233  $args = func_get_args();
234  $expectedResult = array_pop($args);
235  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
236  $this->assertEquals($expectedResult, $result);
237  }
238 
239  public function providerSUBSTITUTE()
240  {
241  return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
242  }
243 
247  public function testTRIM()
248  {
249  $args = func_get_args();
250  $expectedResult = array_pop($args);
251  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
252  $this->assertEquals($expectedResult, $result);
253  }
254 
255  public function providerTRIM()
256  {
257  return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
258  }
259 
263  public function testCLEAN()
264  {
265  $args = func_get_args();
266  $expectedResult = array_pop($args);
267  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
268  $this->assertEquals($expectedResult, $result);
269  }
270 
271  public function providerCLEAN()
272  {
273  return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
274  }
275 
279  public function testDOLLAR()
280  {
281  $args = func_get_args();
282  $expectedResult = array_pop($args);
283  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
284  $this->assertEquals($expectedResult, $result);
285  }
286 
287  public function providerDOLLAR()
288  {
289  return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
290  }
291 
295  public function testFIXED()
296  {
297  $args = func_get_args();
298  $expectedResult = array_pop($args);
299  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
300  $this->assertEquals($expectedResult, $result);
301  }
302 
303  public function providerFIXED()
304  {
305  return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
306  }
307 
311  public function testT()
312  {
313  $args = func_get_args();
314  $expectedResult = array_pop($args);
315  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
316  $this->assertEquals($expectedResult, $result);
317  }
318 
319  public function providerT()
320  {
321  return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
322  }
323 
327  public function testTEXT()
328  {
329  // Enforce decimal and thousands separator values to UK/US, and currency code to USD
330  call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
331  call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
332  call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
333 
334  $args = func_get_args();
335  $expectedResult = array_pop($args);
336  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
337  $this->assertEquals($expectedResult, $result);
338  }
339 
340  public function providerTEXT()
341  {
342  return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
343  }
344 
348  public function testVALUE()
349  {
350  call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
351  call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),' ');
352  call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
353 
354  $args = func_get_args();
355  $expectedResult = array_pop($args);
356  $result = call_user_func_array(array('PHPExcel_Calculation_TextData','VALUE'),$args);
357  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
358  }
359 
360  public function providerVALUE()
361  {
362  return new testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data');
363  }
364 
365 }
testFIND()
providerFIND
testLOWER()
providerLOWER
testRIGHT()
providerRIGHT
testT()
providerT
$result
testPROPER()
providerPROPER
testDOLLAR()
providerDOLLAR
const COMPATIBILITY_EXCEL
constants
Definition: Functions.php:62
testSEARCH()
providerSEARCH
testCHAR()
providerCHAR
testSUBSTITUTE()
providerSUBSTITUTE
testTEXT()
providerTEXT
testLEFT()
providerLEFT
testREPLACE()
providerREPLACE
testCODE()
providerCODE
testVALUE()
providerVALUE
Create styles array
The data for the language used.
testMID()
providerMID
testCLEAN()
providerCLEAN
testTRIM()
providerTRIM
testUPPER()
providerUPPER
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
testCONCATENATE()
providerCONCATENATE
testLEN()
providerLEN
testFIXED()
providerFIXED
static setCompatibilityMode($compatibilityMode)
Definition: Functions.php:116