ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
EngineeringTest.php
Go to the documentation of this file.
1 <?php
2 
3 // Custom assertion class for handling precision of Complex numbers
4 require_once 'custom/complexAssert.php';
5 
6 // Data Provider handler
7 require_once 'testDataFileIterator.php';
8 
9 
11 {
12 
13  public function setUp()
14  {
15  if (!defined('PHPEXCEL_ROOT'))
16  {
17  define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
18  }
19  require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
20 
22  }
23 
27  public function testBESSELI()
28  {
29  $args = func_get_args();
30  $expectedResult = array_pop($args);
31  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELI'),$args);
32  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
33  }
34 
35  public function providerBESSELI()
36  {
37  return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data');
38  }
39 
43  public function testBESSELJ()
44  {
45  $args = func_get_args();
46  $expectedResult = array_pop($args);
47  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELJ'),$args);
48  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
49  }
50 
51  public function providerBESSELJ()
52  {
53  return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data');
54  }
55 
59  public function testBESSELK()
60  {
61  $args = func_get_args();
62  $expectedResult = array_pop($args);
63  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELK'),$args);
64  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
65  }
66 
67  public function providerBESSELK()
68  {
69  return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data');
70  }
71 
75  public function testBESSELY()
76  {
77  $args = func_get_args();
78  $expectedResult = array_pop($args);
79  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELY'),$args);
80  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
81  }
82 
83  public function providerBESSELY()
84  {
85  return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data');
86  }
87 
91  public function testCOMPLEX()
92  {
93  $args = func_get_args();
94  $expectedResult = array_pop($args);
95  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','COMPLEX'),$args);
96  $this->assertEquals($expectedResult, $result);
97  }
98 
99  public function providerCOMPLEX()
100  {
101  return new testDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data');
102  }
103 
107  public function testIMAGINARY()
108  {
109  $args = func_get_args();
110  $expectedResult = array_pop($args);
111  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMAGINARY'),$args);
112  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
113  }
114 
115  public function providerIMAGINARY()
116  {
117  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data');
118  }
119 
123  public function testIMREAL()
124  {
125  $args = func_get_args();
126  $expectedResult = array_pop($args);
127  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMREAL'),$args);
128  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
129  }
130 
131  public function providerIMREAL()
132  {
133  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data');
134  }
135 
139  public function testIMABS()
140  {
141  $args = func_get_args();
142  $expectedResult = array_pop($args);
143  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMABS'),$args);
144  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
145  }
146 
147  public function providerIMABS()
148  {
149  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data');
150  }
151 
155  public function testIMARGUMENT()
156  {
157  $args = func_get_args();
158  $expectedResult = array_pop($args);
159  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMARGUMENT'),$args);
160  $this->assertEquals($expectedResult, $result, NULL, 1E-8);
161  }
162 
163  public function providerIMARGUMENT()
164  {
165  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data');
166  }
167 
171  public function testIMCONJUGATE()
172  {
173  $args = func_get_args();
174  $expectedResult = array_pop($args);
175  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCONJUGATE'),$args);
176  $complexAssert = new complexAssert();
177  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
178  $complexAssert->getErrorMessage());
179  }
180 
181  public function providerIMCONJUGATE()
182  {
183  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data');
184  }
185 
189  public function testIMCOS()
190  {
191  $args = func_get_args();
192  $expectedResult = array_pop($args);
193  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCOS'),$args);
194  $complexAssert = new complexAssert();
195  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
196  $complexAssert->getErrorMessage());
197  }
198 
199  public function providerIMCOS()
200  {
201  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data');
202  }
203 
207  public function testIMDIV()
208  {
209  $args = func_get_args();
210  $expectedResult = array_pop($args);
211  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMDIV'),$args);
212  $complexAssert = new complexAssert();
213  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
214  $complexAssert->getErrorMessage());
215  }
216 
217  public function providerIMDIV()
218  {
219  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data');
220  }
221 
225  public function testIMEXP()
226  {
227  $args = func_get_args();
228  $expectedResult = array_pop($args);
229  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMEXP'),$args);
230  $complexAssert = new complexAssert();
231  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
232  $complexAssert->getErrorMessage());
233  }
234 
235  public function providerIMEXP()
236  {
237  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data');
238  }
239 
243  public function testIMLN()
244  {
245  $args = func_get_args();
246  $expectedResult = array_pop($args);
247  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLN'),$args);
248  $complexAssert = new complexAssert();
249  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
250  $complexAssert->getErrorMessage());
251  }
252 
253  public function providerIMLN()
254  {
255  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data');
256  }
257 
261  public function testIMLOG2()
262  {
263  $args = func_get_args();
264  $expectedResult = array_pop($args);
265  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG2'),$args);
266  $complexAssert = new complexAssert();
267  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
268  $complexAssert->getErrorMessage());
269  }
270 
271  public function providerIMLOG2()
272  {
273  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data');
274  }
275 
279  public function testIMLOG10()
280  {
281  $args = func_get_args();
282  $expectedResult = array_pop($args);
283  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG10'),$args);
284  $complexAssert = new complexAssert();
285  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
286  $complexAssert->getErrorMessage());
287  }
288 
289  public function providerIMLOG10()
290  {
291  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data');
292  }
293 
297  public function testIMPOWER()
298  {
299  $args = func_get_args();
300  $expectedResult = array_pop($args);
301  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPOWER'),$args);
302  $complexAssert = new complexAssert();
303  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
304  $complexAssert->getErrorMessage());
305  }
306 
307  public function providerIMPOWER()
308  {
309  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data');
310  }
311 
315  public function testIMPRODUCT()
316  {
317  $args = func_get_args();
318  $expectedResult = array_pop($args);
319  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPRODUCT'),$args);
320  $complexAssert = new complexAssert();
321  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
322  $complexAssert->getErrorMessage());
323  }
324 
325  public function providerIMPRODUCT()
326  {
327  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data');
328  }
329 
333  public function testIMSIN()
334  {
335  $args = func_get_args();
336  $expectedResult = array_pop($args);
337  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSIN'),$args);
338  $complexAssert = new complexAssert();
339  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
340  $complexAssert->getErrorMessage());
341  }
342 
343  public function providerIMSIN()
344  {
345  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data');
346  }
347 
351  public function testIMSQRT()
352  {
353  $args = func_get_args();
354  $expectedResult = array_pop($args);
355  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSQRT'),$args);
356  $complexAssert = new complexAssert();
357  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
358  $complexAssert->getErrorMessage());
359  }
360 
361  public function providerIMSQRT()
362  {
363  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data');
364  }
365 
369  public function testIMSUB()
370  {
371  $args = func_get_args();
372  $expectedResult = array_pop($args);
373  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUB'),$args);
374  $complexAssert = new complexAssert();
375  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
376  $complexAssert->getErrorMessage());
377  }
378 
379  public function providerIMSUB()
380  {
381  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data');
382  }
383 
387  public function testIMSUM()
388  {
389  $args = func_get_args();
390  $expectedResult = array_pop($args);
391  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUM'),$args);
392  $complexAssert = new complexAssert();
393  $this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
394  $complexAssert->getErrorMessage());
395  }
396 
397  public function providerIMSUM()
398  {
399  return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data');
400  }
401 
405  public function testERF()
406  {
407  $args = func_get_args();
408  $expectedResult = array_pop($args);
409  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERF'),$args);
410  $this->assertEquals($expectedResult, $result, NULL, 1E-12);
411  }
412 
413  public function providerERF()
414  {
415  return new testDataFileIterator('rawTestData/Calculation/Engineering/ERF.data');
416  }
417 
421  public function testERFC()
422  {
423  $args = func_get_args();
424  $expectedResult = array_pop($args);
425  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERFC'),$args);
426  $this->assertEquals($expectedResult, $result, NULL, 1E-12);
427  }
428 
429  public function providerERFC()
430  {
431  return new testDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data');
432  }
433 
437  public function testBIN2DEC()
438  {
439  $args = func_get_args();
440  $expectedResult = array_pop($args);
441  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTODEC'),$args);
442  $this->assertEquals($expectedResult, $result);
443  }
444 
445  public function providerBIN2DEC()
446  {
447  return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data');
448  }
449 
453  public function testBIN2HEX()
454  {
455  $args = func_get_args();
456  $expectedResult = array_pop($args);
457  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOHEX'),$args);
458  $this->assertEquals($expectedResult, $result);
459  }
460 
461  public function providerBIN2HEX()
462  {
463  return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data');
464  }
465 
469  public function testBIN2OCT()
470  {
471  $args = func_get_args();
472  $expectedResult = array_pop($args);
473  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOOCT'),$args);
474  $this->assertEquals($expectedResult, $result);
475  }
476 
477  public function providerBIN2OCT()
478  {
479  return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data');
480  }
481 
485  public function testDEC2BIN()
486  {
487  $args = func_get_args();
488  $expectedResult = array_pop($args);
489  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOBIN'),$args);
490  $this->assertEquals($expectedResult, $result, NULL);
491  }
492 
493  public function providerDEC2BIN()
494  {
495  return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data');
496  }
497 
501  public function testDEC2HEX()
502  {
503  $args = func_get_args();
504  $expectedResult = array_pop($args);
505  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOHEX'),$args);
506  $this->assertEquals($expectedResult, $result, NULL);
507  }
508 
509  public function providerDEC2HEX()
510  {
511  return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data');
512  }
513 
517  public function testDEC2OCT()
518  {
519  $args = func_get_args();
520  $expectedResult = array_pop($args);
521  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOOCT'),$args);
522  $this->assertEquals($expectedResult, $result, NULL);
523  }
524 
525  public function providerDEC2OCT()
526  {
527  return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data');
528  }
529 
533  public function testHEX2BIN()
534  {
535  $args = func_get_args();
536  $expectedResult = array_pop($args);
537  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOBIN'),$args);
538  $this->assertEquals($expectedResult, $result, NULL);
539  }
540 
541  public function providerHEX2BIN()
542  {
543  return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data');
544  }
545 
549  public function testHEX2DEC()
550  {
551  $args = func_get_args();
552  $expectedResult = array_pop($args);
553  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTODEC'),$args);
554  $this->assertEquals($expectedResult, $result, NULL);
555  }
556 
557  public function providerHEX2DEC()
558  {
559  return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data');
560  }
561 
565  public function testHEX2OCT()
566  {
567  $args = func_get_args();
568  $expectedResult = array_pop($args);
569  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOOCT'),$args);
570  $this->assertEquals($expectedResult, $result, NULL);
571  }
572 
573  public function providerHEX2OCT()
574  {
575  return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data');
576  }
577 
581  public function testOCT2BIN()
582  {
583  $args = func_get_args();
584  $expectedResult = array_pop($args);
585  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOBIN'),$args);
586  $this->assertEquals($expectedResult, $result, NULL);
587  }
588 
589  public function providerOCT2BIN()
590  {
591  return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data');
592  }
593 
597  public function testOCT2DEC()
598  {
599  $args = func_get_args();
600  $expectedResult = array_pop($args);
601  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTODEC'),$args);
602  $this->assertEquals($expectedResult, $result, NULL);
603  }
604 
605  public function providerOCT2DEC()
606  {
607  return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data');
608  }
609 
613  public function testOCT2HEX()
614  {
615  $args = func_get_args();
616  $expectedResult = array_pop($args);
617  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOHEX'),$args);
618  $this->assertEquals($expectedResult, $result, NULL);
619  }
620 
621  public function providerOCT2HEX()
622  {
623  return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data');
624  }
625 
629  public function testDELTA()
630  {
631  $args = func_get_args();
632  $expectedResult = array_pop($args);
633  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DELTA'),$args);
634  $this->assertEquals($expectedResult, $result, NULL);
635  }
636 
637  public function providerDELTA()
638  {
639  return new testDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data');
640  }
641 
645  public function testGESTEP()
646  {
647  $args = func_get_args();
648  $expectedResult = array_pop($args);
649  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','GESTEP'),$args);
650  $this->assertEquals($expectedResult, $result, NULL);
651  }
652 
653  public function providerGESTEP()
654  {
655  return new testDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data');
656  }
657 
658  public function testGetConversionGroups()
659  {
661  $this->assertInternalType('array', $result);
662  }
663 
664  public function testGetConversionGroupUnits()
665  {
667  $this->assertInternalType('array', $result);
668  }
669 
671  {
673  $this->assertInternalType('array', $result);
674  }
675 
677  {
679  $this->assertInternalType('array', $result);
680  }
681 
685  public function testCONVERTUOM()
686  {
687  $args = func_get_args();
688  $expectedResult = array_pop($args);
689  $result = call_user_func_array(array('PHPExcel_Calculation_Engineering','CONVERTUOM'),$args);
690  $this->assertEquals($expectedResult, $result, NULL);
691  }
692 
693  public function providerCONVERTUOM()
694  {
695  return new testDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data');
696  }
697 
698 }
testIMLN()
providerIMLN
testBIN2OCT()
providerBIN2OCT
$result
testBESSELI()
providerBESSELI
testBIN2HEX()
providerBIN2HEX
testOCT2HEX()
providerOCT2HEX
testDELTA()
providerDELTA
const COMPATIBILITY_EXCEL
constants
Definition: Functions.php:62
testIMARGUMENT()
providerIMARGUMENT
testIMSIN()
providerIMSIN
testIMABS()
providerIMABS
testIMLOG2()
providerIMLOG2
testIMSUB()
providerIMSUB
testIMAGINARY()
providerIMAGINARY
testOCT2DEC()
providerOCT2DEC
testDEC2OCT()
providerDEC2OCT
testIMDIV()
providerIMDIV
testBESSELK()
providerBESSELK
testBIN2DEC()
providerBIN2DEC
testCONVERTUOM()
providerCONVERTUOM
testIMSQRT()
providerIMSQRT
testGESTEP()
providerGESTEP
testHEX2BIN()
providerHEX2BIN
testIMSUM()
providerIMSUM
testBESSELY()
providerBESSELY
testDEC2HEX()
providerDEC2HEX
static getConversionMultipliers()
getConversionMultipliers Returns an array of the Multiplier prefixes that can be used with Units of M...
testERFC()
providerERFC
testIMPRODUCT()
providerIMPRODUCT
testIMREAL()
providerIMREAL
testHEX2DEC()
providerHEX2DEC
Create styles array
The data for the language used.
testDEC2BIN()
providerDEC2BIN
testIMPOWER()
providerIMPOWER
static getConversionGroupUnits($group=NULL)
getConversionGroupUnits Returns an array of units of measure, for a specified conversion group...
testCOMPLEX()
providerCOMPLEX
testERF()
providerERF
static getConversionGroupUnitDetails($group=NULL)
getConversionGroupUnitDetails
testOCT2BIN()
providerOCT2BIN
testIMEXP()
providerIMEXP
testIMLOG10()
providerIMLOG10
static getConversionGroups()
getConversionGroups Returns a list of the different conversion groups for UOM conversions ...
testIMCONJUGATE()
providerIMCONJUGATE
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
testIMCOS()
providerIMCOS
testHEX2OCT()
providerHEX2OCT
static setCompatibilityMode($compatibilityMode)
Definition: Functions.php:116
testBESSELJ()
providerBESSELJ