1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation; |
4
|
|
|
|
5
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Engineering; |
6
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Functions; |
7
|
|
|
use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert; |
8
|
|
|
use PHPUnit\Framework\TestCase; |
9
|
|
|
|
10
|
|
|
class EngineeringTest extends TestCase |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* @var ComplexAssert |
14
|
|
|
*/ |
15
|
|
|
protected $complexAssert; |
16
|
|
|
|
17
|
|
|
public function setUp() |
18
|
|
|
{ |
19
|
|
|
$this->complexAssert = new ComplexAssert(); |
20
|
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function tearDown() |
24
|
|
|
{ |
25
|
|
|
$this->complexAssert = null; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @dataProvider providerBESSELI |
30
|
|
|
* |
31
|
|
|
* @param mixed $expectedResult |
32
|
|
|
*/ |
33
|
|
|
public function testBESSELI($expectedResult, ...$args) |
34
|
|
|
{ |
35
|
|
|
$result = Engineering::BESSELI(...$args); |
36
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function providerBESSELI() |
40
|
|
|
{ |
41
|
|
|
return require 'data/Calculation/Engineering/BESSELI.php'; |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @dataProvider providerBESSELJ |
46
|
|
|
* |
47
|
|
|
* @param mixed $expectedResult |
48
|
|
|
*/ |
49
|
|
|
public function testBESSELJ($expectedResult, ...$args) |
50
|
|
|
{ |
51
|
|
|
$result = Engineering::BESSELJ(...$args); |
52
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function providerBESSELJ() |
56
|
|
|
{ |
57
|
|
|
return require 'data/Calculation/Engineering/BESSELJ.php'; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @dataProvider providerBESSELK |
62
|
|
|
* |
63
|
|
|
* @param mixed $expectedResult |
64
|
|
|
*/ |
65
|
|
|
public function testBESSELK($expectedResult, ...$args) |
66
|
|
|
{ |
67
|
|
|
$result = Engineering::BESSELK(...$args); |
68
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function providerBESSELK() |
72
|
|
|
{ |
73
|
|
|
return require 'data/Calculation/Engineering/BESSELK.php'; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @dataProvider providerBESSELY |
78
|
|
|
* |
79
|
|
|
* @param mixed $expectedResult |
80
|
|
|
*/ |
81
|
|
|
public function testBESSELY($expectedResult, ...$args) |
82
|
|
|
{ |
83
|
|
|
$result = Engineering::BESSELY(...$args); |
84
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
public function providerBESSELY() |
88
|
|
|
{ |
89
|
|
|
return require 'data/Calculation/Engineering/BESSELY.php'; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @dataProvider providerCOMPLEX |
94
|
|
|
* |
95
|
|
|
* @param mixed $expectedResult |
96
|
|
|
*/ |
97
|
|
|
public function testCOMPLEX($expectedResult, ...$args) |
98
|
|
|
{ |
99
|
|
|
$result = Engineering::COMPLEX(...$args); |
|
|
|
|
100
|
|
|
self::assertEquals($expectedResult, $result); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
public function providerCOMPLEX() |
104
|
|
|
{ |
105
|
|
|
return require 'data/Calculation/Engineering/COMPLEX.php'; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @dataProvider providerIMAGINARY |
110
|
|
|
* |
111
|
|
|
* @param mixed $expectedResult |
112
|
|
|
*/ |
113
|
|
|
public function testIMAGINARY($expectedResult, ...$args) |
114
|
|
|
{ |
115
|
|
|
$result = Engineering::IMAGINARY(...$args); |
|
|
|
|
116
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
117
|
|
|
} |
118
|
|
|
|
119
|
|
|
public function providerIMAGINARY() |
120
|
|
|
{ |
121
|
|
|
return require 'data/Calculation/Engineering/IMAGINARY.php'; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @dataProvider providerIMREAL |
126
|
|
|
* |
127
|
|
|
* @param mixed $expectedResult |
128
|
|
|
*/ |
129
|
|
|
public function testIMREAL($expectedResult, ...$args) |
130
|
|
|
{ |
131
|
|
|
$result = Engineering::IMREAL(...$args); |
|
|
|
|
132
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
133
|
|
|
} |
134
|
|
|
|
135
|
|
|
public function providerIMREAL() |
136
|
|
|
{ |
137
|
|
|
return require 'data/Calculation/Engineering/IMREAL.php'; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @dataProvider providerIMABS |
142
|
|
|
* |
143
|
|
|
* @param mixed $expectedResult |
144
|
|
|
*/ |
145
|
|
|
public function testIMABS($expectedResult, ...$args) |
146
|
|
|
{ |
147
|
|
|
$result = Engineering::IMABS(...$args); |
|
|
|
|
148
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
public function providerIMABS() |
152
|
|
|
{ |
153
|
|
|
return require 'data/Calculation/Engineering/IMABS.php'; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @dataProvider providerIMARGUMENT |
158
|
|
|
* |
159
|
|
|
* @param mixed $expectedResult |
160
|
|
|
*/ |
161
|
|
|
public function testIMARGUMENT($expectedResult, ...$args) |
162
|
|
|
{ |
163
|
|
|
$result = Engineering::IMARGUMENT(...$args); |
|
|
|
|
164
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-8); |
165
|
|
|
} |
166
|
|
|
|
167
|
|
|
public function providerIMARGUMENT() |
168
|
|
|
{ |
169
|
|
|
return require 'data/Calculation/Engineering/IMARGUMENT.php'; |
170
|
|
|
} |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @dataProvider providerIMCONJUGATE |
174
|
|
|
* |
175
|
|
|
* @param mixed $expectedResult |
176
|
|
|
*/ |
177
|
|
|
public function testIMCONJUGATE($expectedResult, ...$args) |
178
|
|
|
{ |
179
|
|
|
$result = Engineering::IMCONJUGATE(...$args); |
|
|
|
|
180
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
public function providerIMCONJUGATE() |
184
|
|
|
{ |
185
|
|
|
return require 'data/Calculation/Engineering/IMCONJUGATE.php'; |
186
|
|
|
} |
187
|
|
|
|
188
|
|
|
/** |
189
|
|
|
* @dataProvider providerIMCOS |
190
|
|
|
* |
191
|
|
|
* @param mixed $expectedResult |
192
|
|
|
*/ |
193
|
|
|
public function testIMCOS($expectedResult, ...$args) |
194
|
|
|
{ |
195
|
|
|
$result = Engineering::IMCOS(...$args); |
|
|
|
|
196
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
public function providerIMCOS() |
200
|
|
|
{ |
201
|
|
|
return require 'data/Calculation/Engineering/IMCOS.php'; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* @dataProvider providerIMDIV |
206
|
|
|
* |
207
|
|
|
* @param mixed $expectedResult |
208
|
|
|
*/ |
209
|
|
|
public function testIMDIV($expectedResult, ...$args) |
210
|
|
|
{ |
211
|
|
|
$this->markTestIncomplete('TODO: This test should be fixed'); |
212
|
|
|
|
213
|
|
|
$result = Engineering::IMDIV(...$args); |
214
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
public function providerIMDIV() |
218
|
|
|
{ |
219
|
|
|
return require 'data/Calculation/Engineering/IMDIV.php'; |
220
|
|
|
} |
221
|
|
|
|
222
|
|
|
/** |
223
|
|
|
* @dataProvider providerIMEXP |
224
|
|
|
* |
225
|
|
|
* @param mixed $expectedResult |
226
|
|
|
*/ |
227
|
|
|
public function testIMEXP($expectedResult, ...$args) |
228
|
|
|
{ |
229
|
|
|
$result = Engineering::IMEXP(...$args); |
|
|
|
|
230
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
public function providerIMEXP() |
234
|
|
|
{ |
235
|
|
|
return require 'data/Calculation/Engineering/IMEXP.php'; |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
/** |
239
|
|
|
* @dataProvider providerIMLN |
240
|
|
|
* |
241
|
|
|
* @param mixed $expectedResult |
242
|
|
|
*/ |
243
|
|
|
public function testIMLN($expectedResult, ...$args) |
244
|
|
|
{ |
245
|
|
|
$result = Engineering::IMLN(...$args); |
|
|
|
|
246
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
public function providerIMLN() |
250
|
|
|
{ |
251
|
|
|
return require 'data/Calculation/Engineering/IMLN.php'; |
252
|
|
|
} |
253
|
|
|
|
254
|
|
|
/** |
255
|
|
|
* @dataProvider providerIMLOG2 |
256
|
|
|
* |
257
|
|
|
* @param mixed $expectedResult |
258
|
|
|
*/ |
259
|
|
|
public function testIMLOG2($expectedResult, ...$args) |
260
|
|
|
{ |
261
|
|
|
$result = Engineering::IMLOG2(...$args); |
|
|
|
|
262
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
263
|
|
|
} |
264
|
|
|
|
265
|
|
|
public function providerIMLOG2() |
266
|
|
|
{ |
267
|
|
|
return require 'data/Calculation/Engineering/IMLOG2.php'; |
268
|
|
|
} |
269
|
|
|
|
270
|
|
|
/** |
271
|
|
|
* @dataProvider providerIMLOG10 |
272
|
|
|
* |
273
|
|
|
* @param mixed $expectedResult |
274
|
|
|
*/ |
275
|
|
|
public function testIMLOG10($expectedResult, ...$args) |
276
|
|
|
{ |
277
|
|
|
$result = Engineering::IMLOG10(...$args); |
|
|
|
|
278
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
279
|
|
|
} |
280
|
|
|
|
281
|
|
|
public function providerIMLOG10() |
282
|
|
|
{ |
283
|
|
|
return require 'data/Calculation/Engineering/IMLOG10.php'; |
284
|
|
|
} |
285
|
|
|
|
286
|
|
|
/** |
287
|
|
|
* @dataProvider providerIMPOWER |
288
|
|
|
* |
289
|
|
|
* @param mixed $expectedResult |
290
|
|
|
*/ |
291
|
|
|
public function testIMPOWER($expectedResult, ...$args) |
292
|
|
|
{ |
293
|
|
|
$this->markTestIncomplete('TODO: This test should be fixed'); |
294
|
|
|
|
295
|
|
|
$result = Engineering::IMPOWER(...$args); |
296
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
297
|
|
|
} |
298
|
|
|
|
299
|
|
|
public function providerIMPOWER() |
300
|
|
|
{ |
301
|
|
|
return require 'data/Calculation/Engineering/IMPOWER.php'; |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* @dataProvider providerIMPRODUCT |
306
|
|
|
* |
307
|
|
|
* @param mixed $expectedResult |
308
|
|
|
*/ |
309
|
|
|
public function testIMPRODUCT($expectedResult, ...$args) |
310
|
|
|
{ |
311
|
|
|
$result = Engineering::IMPRODUCT(...$args); |
312
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
313
|
|
|
} |
314
|
|
|
|
315
|
|
|
public function providerIMPRODUCT() |
316
|
|
|
{ |
317
|
|
|
return require 'data/Calculation/Engineering/IMPRODUCT.php'; |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* @dataProvider providerIMSIN |
322
|
|
|
* |
323
|
|
|
* @param mixed $expectedResult |
324
|
|
|
*/ |
325
|
|
|
public function testIMSIN($expectedResult, ...$args) |
326
|
|
|
{ |
327
|
|
|
$result = Engineering::IMSIN(...$args); |
|
|
|
|
328
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
public function providerIMSIN() |
332
|
|
|
{ |
333
|
|
|
return require 'data/Calculation/Engineering/IMSIN.php'; |
334
|
|
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* @dataProvider providerIMSQRT |
338
|
|
|
* |
339
|
|
|
* @param mixed $expectedResult |
340
|
|
|
*/ |
341
|
|
|
public function testIMSQRT($expectedResult, ...$args) |
342
|
|
|
{ |
343
|
|
|
$result = Engineering::IMSQRT(...$args); |
|
|
|
|
344
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
345
|
|
|
} |
346
|
|
|
|
347
|
|
|
public function providerIMSQRT() |
348
|
|
|
{ |
349
|
|
|
return require 'data/Calculation/Engineering/IMSQRT.php'; |
350
|
|
|
} |
351
|
|
|
|
352
|
|
|
/** |
353
|
|
|
* @dataProvider providerIMSUB |
354
|
|
|
* |
355
|
|
|
* @param mixed $expectedResult |
356
|
|
|
*/ |
357
|
|
|
public function testIMSUB($expectedResult, ...$args) |
358
|
|
|
{ |
359
|
|
|
$this->markTestIncomplete('TODO: This test should be fixed'); |
360
|
|
|
|
361
|
|
|
$result = Engineering::IMSUB(...$args); |
362
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
public function providerIMSUB() |
366
|
|
|
{ |
367
|
|
|
return require 'data/Calculation/Engineering/IMSUB.php'; |
368
|
|
|
} |
369
|
|
|
|
370
|
|
|
/** |
371
|
|
|
* @dataProvider providerIMSUM |
372
|
|
|
* |
373
|
|
|
* @param mixed $expectedResult |
374
|
|
|
*/ |
375
|
|
|
public function testIMSUM($expectedResult, ...$args) |
376
|
|
|
{ |
377
|
|
|
$result = Engineering::IMSUM(...$args); |
378
|
|
|
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage()); |
379
|
|
|
} |
380
|
|
|
|
381
|
|
|
public function providerIMSUM() |
382
|
|
|
{ |
383
|
|
|
return require 'data/Calculation/Engineering/IMSUM.php'; |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
|
|
* @dataProvider providerERF |
388
|
|
|
* |
389
|
|
|
* @param mixed $expectedResult |
390
|
|
|
*/ |
391
|
|
|
public function testERF($expectedResult, ...$args) |
392
|
|
|
{ |
393
|
|
|
$result = Engineering::ERF(...$args); |
|
|
|
|
394
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-12); |
395
|
|
|
} |
396
|
|
|
|
397
|
|
|
public function providerERF() |
398
|
|
|
{ |
399
|
|
|
return require 'data/Calculation/Engineering/ERF.php'; |
400
|
|
|
} |
401
|
|
|
|
402
|
|
|
/** |
403
|
|
|
* @dataProvider providerERFPRECISE |
404
|
|
|
* |
405
|
|
|
* @param mixed $expectedResult |
406
|
|
|
*/ |
407
|
|
|
public function testERFPRECISE($expectedResult, ...$args) |
408
|
|
|
{ |
409
|
|
|
$result = Engineering::ERFPRECISE(...$args); |
|
|
|
|
410
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-12); |
411
|
|
|
} |
412
|
|
|
|
413
|
|
|
public function providerERFPRECISE() |
414
|
|
|
{ |
415
|
|
|
return require 'data/Calculation/Engineering/ERFPRECISE.php'; |
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
/** |
419
|
|
|
* @dataProvider providerERFC |
420
|
|
|
* |
421
|
|
|
* @param mixed $expectedResult |
422
|
|
|
*/ |
423
|
|
|
public function testERFC($expectedResult, ...$args) |
424
|
|
|
{ |
425
|
|
|
$result = Engineering::ERFC(...$args); |
|
|
|
|
426
|
|
|
self::assertEquals($expectedResult, $result, null, 1E-12); |
427
|
|
|
} |
428
|
|
|
|
429
|
|
|
public function providerERFC() |
430
|
|
|
{ |
431
|
|
|
return require 'data/Calculation/Engineering/ERFC.php'; |
432
|
|
|
} |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* @dataProvider providerBIN2DEC |
436
|
|
|
* |
437
|
|
|
* @param mixed $expectedResult |
438
|
|
|
*/ |
439
|
|
|
public function testBIN2DEC($expectedResult, ...$args) |
440
|
|
|
{ |
441
|
|
|
$result = Engineering::BINTODEC(...$args); |
|
|
|
|
442
|
|
|
self::assertEquals($expectedResult, $result); |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
public function providerBIN2DEC() |
446
|
|
|
{ |
447
|
|
|
return require 'data/Calculation/Engineering/BIN2DEC.php'; |
448
|
|
|
} |
449
|
|
|
|
450
|
|
|
/** |
451
|
|
|
* @dataProvider providerBIN2HEX |
452
|
|
|
* |
453
|
|
|
* @param mixed $expectedResult |
454
|
|
|
*/ |
455
|
|
|
public function testBIN2HEX($expectedResult, ...$args) |
456
|
|
|
{ |
457
|
|
|
$result = Engineering::BINTOHEX(...$args); |
|
|
|
|
458
|
|
|
self::assertEquals($expectedResult, $result); |
459
|
|
|
} |
460
|
|
|
|
461
|
|
|
public function providerBIN2HEX() |
462
|
|
|
{ |
463
|
|
|
return require 'data/Calculation/Engineering/BIN2HEX.php'; |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
/** |
467
|
|
|
* @dataProvider providerBIN2OCT |
468
|
|
|
* |
469
|
|
|
* @param mixed $expectedResult |
470
|
|
|
*/ |
471
|
|
|
public function testBIN2OCT($expectedResult, ...$args) |
472
|
|
|
{ |
473
|
|
|
$result = Engineering::BINTOOCT(...$args); |
|
|
|
|
474
|
|
|
self::assertEquals($expectedResult, $result); |
475
|
|
|
} |
476
|
|
|
|
477
|
|
|
public function providerBIN2OCT() |
478
|
|
|
{ |
479
|
|
|
return require 'data/Calculation/Engineering/BIN2OCT.php'; |
480
|
|
|
} |
481
|
|
|
|
482
|
|
|
/** |
483
|
|
|
* @dataProvider providerDEC2BIN |
484
|
|
|
* |
485
|
|
|
* @param mixed $expectedResult |
486
|
|
|
*/ |
487
|
|
|
public function testDEC2BIN($expectedResult, ...$args) |
488
|
|
|
{ |
489
|
|
|
$result = Engineering::DECTOBIN(...$args); |
|
|
|
|
490
|
|
|
self::assertEquals($expectedResult, $result, null); |
491
|
|
|
} |
492
|
|
|
|
493
|
|
|
public function providerDEC2BIN() |
494
|
|
|
{ |
495
|
|
|
return require 'data/Calculation/Engineering/DEC2BIN.php'; |
496
|
|
|
} |
497
|
|
|
|
498
|
|
|
/** |
499
|
|
|
* @dataProvider providerDEC2HEX |
500
|
|
|
* |
501
|
|
|
* @param mixed $expectedResult |
502
|
|
|
*/ |
503
|
|
|
public function testDEC2HEX($expectedResult, ...$args) |
504
|
|
|
{ |
505
|
|
|
$result = Engineering::DECTOHEX(...$args); |
|
|
|
|
506
|
|
|
self::assertEquals($expectedResult, $result, null); |
507
|
|
|
} |
508
|
|
|
|
509
|
|
|
public function providerDEC2HEX() |
510
|
|
|
{ |
511
|
|
|
return require 'data/Calculation/Engineering/DEC2HEX.php'; |
512
|
|
|
} |
513
|
|
|
|
514
|
|
|
/** |
515
|
|
|
* @dataProvider providerDEC2OCT |
516
|
|
|
* |
517
|
|
|
* @param mixed $expectedResult |
518
|
|
|
*/ |
519
|
|
|
public function testDEC2OCT($expectedResult, ...$args) |
520
|
|
|
{ |
521
|
|
|
$result = Engineering::DECTOOCT(...$args); |
|
|
|
|
522
|
|
|
self::assertEquals($expectedResult, $result, null); |
523
|
|
|
} |
524
|
|
|
|
525
|
|
|
public function providerDEC2OCT() |
526
|
|
|
{ |
527
|
|
|
return require 'data/Calculation/Engineering/DEC2OCT.php'; |
528
|
|
|
} |
529
|
|
|
|
530
|
|
|
/** |
531
|
|
|
* @dataProvider providerHEX2BIN |
532
|
|
|
* |
533
|
|
|
* @param mixed $expectedResult |
534
|
|
|
*/ |
535
|
|
|
public function testHEX2BIN($expectedResult, ...$args) |
536
|
|
|
{ |
537
|
|
|
$result = Engineering::HEXTOBIN(...$args); |
|
|
|
|
538
|
|
|
self::assertEquals($expectedResult, $result, null); |
539
|
|
|
} |
540
|
|
|
|
541
|
|
|
public function providerHEX2BIN() |
542
|
|
|
{ |
543
|
|
|
return require 'data/Calculation/Engineering/HEX2BIN.php'; |
544
|
|
|
} |
545
|
|
|
|
546
|
|
|
/** |
547
|
|
|
* @dataProvider providerHEX2DEC |
548
|
|
|
* |
549
|
|
|
* @param mixed $expectedResult |
550
|
|
|
*/ |
551
|
|
|
public function testHEX2DEC($expectedResult, ...$args) |
552
|
|
|
{ |
553
|
|
|
$result = Engineering::HEXTODEC(...$args); |
|
|
|
|
554
|
|
|
self::assertEquals($expectedResult, $result, null); |
555
|
|
|
} |
556
|
|
|
|
557
|
|
|
public function providerHEX2DEC() |
558
|
|
|
{ |
559
|
|
|
return require 'data/Calculation/Engineering/HEX2DEC.php'; |
560
|
|
|
} |
561
|
|
|
|
562
|
|
|
/** |
563
|
|
|
* @dataProvider providerHEX2OCT |
564
|
|
|
* |
565
|
|
|
* @param mixed $expectedResult |
566
|
|
|
*/ |
567
|
|
|
public function testHEX2OCT($expectedResult, ...$args) |
568
|
|
|
{ |
569
|
|
|
$result = Engineering::HEXTOOCT(...$args); |
|
|
|
|
570
|
|
|
self::assertEquals($expectedResult, $result, null); |
571
|
|
|
} |
572
|
|
|
|
573
|
|
|
public function providerHEX2OCT() |
574
|
|
|
{ |
575
|
|
|
return require 'data/Calculation/Engineering/HEX2OCT.php'; |
576
|
|
|
} |
577
|
|
|
|
578
|
|
|
/** |
579
|
|
|
* @dataProvider providerOCT2BIN |
580
|
|
|
* |
581
|
|
|
* @param mixed $expectedResult |
582
|
|
|
*/ |
583
|
|
|
public function testOCT2BIN($expectedResult, ...$args) |
584
|
|
|
{ |
585
|
|
|
$result = Engineering::OCTTOBIN(...$args); |
|
|
|
|
586
|
|
|
self::assertEquals($expectedResult, $result, null); |
587
|
|
|
} |
588
|
|
|
|
589
|
|
|
public function providerOCT2BIN() |
590
|
|
|
{ |
591
|
|
|
return require 'data/Calculation/Engineering/OCT2BIN.php'; |
592
|
|
|
} |
593
|
|
|
|
594
|
|
|
/** |
595
|
|
|
* @dataProvider providerOCT2DEC |
596
|
|
|
* |
597
|
|
|
* @param mixed $expectedResult |
598
|
|
|
*/ |
599
|
|
|
public function testOCT2DEC($expectedResult, ...$args) |
600
|
|
|
{ |
601
|
|
|
$result = Engineering::OCTTODEC(...$args); |
|
|
|
|
602
|
|
|
self::assertEquals($expectedResult, $result, null); |
603
|
|
|
} |
604
|
|
|
|
605
|
|
|
public function providerOCT2DEC() |
606
|
|
|
{ |
607
|
|
|
return require 'data/Calculation/Engineering/OCT2DEC.php'; |
608
|
|
|
} |
609
|
|
|
|
610
|
|
|
/** |
611
|
|
|
* @dataProvider providerOCT2HEX |
612
|
|
|
* |
613
|
|
|
* @param mixed $expectedResult |
614
|
|
|
*/ |
615
|
|
|
public function testOCT2HEX($expectedResult, ...$args) |
616
|
|
|
{ |
617
|
|
|
$result = Engineering::OCTTOHEX(...$args); |
|
|
|
|
618
|
|
|
self::assertEquals($expectedResult, $result, null); |
619
|
|
|
} |
620
|
|
|
|
621
|
|
|
public function providerOCT2HEX() |
622
|
|
|
{ |
623
|
|
|
return require 'data/Calculation/Engineering/OCT2HEX.php'; |
624
|
|
|
} |
625
|
|
|
|
626
|
|
|
/** |
627
|
|
|
* @dataProvider providerBITAND |
628
|
|
|
* |
629
|
|
|
* @param mixed $expectedResult |
630
|
|
|
* @param mixed[] $args |
631
|
|
|
*/ |
632
|
|
|
public function testBITAND($expectedResult, array $args) |
633
|
|
|
{ |
634
|
|
|
$result = Engineering::BITAND(...$args); |
635
|
|
|
self::assertEquals($expectedResult, $result, null); |
636
|
|
|
} |
637
|
|
|
|
638
|
|
|
public function providerBITAND() |
639
|
|
|
{ |
640
|
|
|
return require 'data/Calculation/Engineering/BITAND.php'; |
641
|
|
|
} |
642
|
|
|
|
643
|
|
|
/** |
644
|
|
|
* @dataProvider providerBITOR |
645
|
|
|
* |
646
|
|
|
* @param mixed $expectedResult |
647
|
|
|
* @param mixed[] $args |
648
|
|
|
*/ |
649
|
|
|
public function testBITOR($expectedResult, array $args) |
650
|
|
|
{ |
651
|
|
|
$result = Engineering::BITOR(...$args); |
652
|
|
|
self::assertEquals($expectedResult, $result, null); |
653
|
|
|
} |
654
|
|
|
|
655
|
|
|
public function providerBITOR() |
656
|
|
|
{ |
657
|
|
|
return require 'data/Calculation/Engineering/BITOR.php'; |
658
|
|
|
} |
659
|
|
|
|
660
|
|
|
/** |
661
|
|
|
* @dataProvider providerBITXOR |
662
|
|
|
* |
663
|
|
|
* @param mixed $expectedResult |
664
|
|
|
* @param mixed[] $args |
665
|
|
|
*/ |
666
|
|
|
public function testBITXOR($expectedResult, array $args) |
667
|
|
|
{ |
668
|
|
|
$result = Engineering::BITXOR(...$args); |
669
|
|
|
self::assertEquals($expectedResult, $result, null); |
670
|
|
|
} |
671
|
|
|
|
672
|
|
|
public function providerBITXOR() |
673
|
|
|
{ |
674
|
|
|
return require 'data/Calculation/Engineering/BITXOR.php'; |
675
|
|
|
} |
676
|
|
|
|
677
|
|
|
/** |
678
|
|
|
* @dataProvider providerBITLSHIFT |
679
|
|
|
* |
680
|
|
|
* @param mixed $expectedResult |
681
|
|
|
* @param mixed[] $args |
682
|
|
|
*/ |
683
|
|
|
public function testBITLSHIFT($expectedResult, array $args) |
684
|
|
|
{ |
685
|
|
|
$result = Engineering::BITLSHIFT(...$args); |
686
|
|
|
self::assertEquals($expectedResult, $result, null); |
687
|
|
|
} |
688
|
|
|
|
689
|
|
|
public function providerBITLSHIFT() |
690
|
|
|
{ |
691
|
|
|
return require 'data/Calculation/Engineering/BITLSHIFT.php'; |
692
|
|
|
} |
693
|
|
|
|
694
|
|
|
/** |
695
|
|
|
* @dataProvider providerBITRSHIFT |
696
|
|
|
* |
697
|
|
|
* @param mixed $expectedResult |
698
|
|
|
* @param mixed[] $args |
699
|
|
|
*/ |
700
|
|
|
public function testBITRSHIFT($expectedResult, array $args) |
701
|
|
|
{ |
702
|
|
|
$result = Engineering::BITRSHIFT(...$args); |
703
|
|
|
self::assertEquals($expectedResult, $result, null); |
704
|
|
|
} |
705
|
|
|
|
706
|
|
|
public function providerBITRSHIFT() |
707
|
|
|
{ |
708
|
|
|
return require 'data/Calculation/Engineering/BITRSHIFT.php'; |
709
|
|
|
} |
710
|
|
|
|
711
|
|
|
/** |
712
|
|
|
* @dataProvider providerDELTA |
713
|
|
|
* |
714
|
|
|
* @param mixed $expectedResult |
715
|
|
|
*/ |
716
|
|
|
public function testDELTA($expectedResult, ...$args) |
717
|
|
|
{ |
718
|
|
|
$result = Engineering::DELTA(...$args); |
|
|
|
|
719
|
|
|
self::assertEquals($expectedResult, $result, null); |
720
|
|
|
} |
721
|
|
|
|
722
|
|
|
public function providerDELTA() |
723
|
|
|
{ |
724
|
|
|
return require 'data/Calculation/Engineering/DELTA.php'; |
725
|
|
|
} |
726
|
|
|
|
727
|
|
|
/** |
728
|
|
|
* @dataProvider providerGESTEP |
729
|
|
|
* |
730
|
|
|
* @param mixed $expectedResult |
731
|
|
|
*/ |
732
|
|
|
public function testGESTEP($expectedResult, ...$args) |
733
|
|
|
{ |
734
|
|
|
$result = Engineering::GESTEP(...$args); |
|
|
|
|
735
|
|
|
self::assertEquals($expectedResult, $result, null); |
736
|
|
|
} |
737
|
|
|
|
738
|
|
|
public function providerGESTEP() |
739
|
|
|
{ |
740
|
|
|
return require 'data/Calculation/Engineering/GESTEP.php'; |
741
|
|
|
} |
742
|
|
|
|
743
|
|
|
public function testGetConversionGroups() |
744
|
|
|
{ |
745
|
|
|
$result = Engineering::getConversionGroups(); |
746
|
|
|
self::assertInternalType('array', $result); |
747
|
|
|
} |
748
|
|
|
|
749
|
|
|
public function testGetConversionGroupUnits() |
750
|
|
|
{ |
751
|
|
|
$result = Engineering::getConversionGroupUnits(); |
752
|
|
|
self::assertInternalType('array', $result); |
753
|
|
|
} |
754
|
|
|
|
755
|
|
|
public function testGetConversionGroupUnitDetails() |
756
|
|
|
{ |
757
|
|
|
$result = Engineering::getConversionGroupUnitDetails(); |
758
|
|
|
self::assertInternalType('array', $result); |
759
|
|
|
} |
760
|
|
|
|
761
|
|
|
public function testGetConversionMultipliers() |
762
|
|
|
{ |
763
|
|
|
$result = Engineering::getConversionMultipliers(); |
764
|
|
|
self::assertInternalType('array', $result); |
765
|
|
|
} |
766
|
|
|
|
767
|
|
|
/** |
768
|
|
|
* @dataProvider providerCONVERTUOM |
769
|
|
|
* |
770
|
|
|
* @param mixed $expectedResult |
771
|
|
|
*/ |
772
|
|
|
public function testCONVERTUOM($expectedResult, ...$args) |
773
|
|
|
{ |
774
|
|
|
$result = Engineering::CONVERTUOM(...$args); |
775
|
|
|
self::assertEquals($expectedResult, $result, null); |
776
|
|
|
} |
777
|
|
|
|
778
|
|
|
public function providerCONVERTUOM() |
779
|
|
|
{ |
780
|
|
|
return require 'data/Calculation/Engineering/CONVERTUOM.php'; |
781
|
|
|
} |
782
|
|
|
} |
783
|
|
|
|