2012-07-31 20:56:11 +00:00
|
|
|
<?php
|
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2016-08-31 17:18:12 +00:00
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
|
|
|
|
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
2017-05-17 22:02:17 +00:00
|
|
|
use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert;
|
2017-11-08 15:48:01 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2016-08-14 04:08:43 +00:00
|
|
|
|
2017-11-08 15:48:01 +00:00
|
|
|
class EngineeringTest extends TestCase
|
2012-07-31 20:56:11 +00:00
|
|
|
{
|
2016-05-18 11:37:00 +00:00
|
|
|
/**
|
2017-05-17 22:02:17 +00:00
|
|
|
* @var ComplexAssert
|
2016-05-18 11:37:00 +00:00
|
|
|
*/
|
|
|
|
protected $complexAssert;
|
|
|
|
|
2018-07-25 13:38:44 +00:00
|
|
|
const BESSEL_PRECISION = 1E-8;
|
|
|
|
const COMPLEX_PRECISION = 1E-8;
|
|
|
|
const ERF_PRECISION = 1E-12;
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
2017-05-17 22:02:17 +00:00
|
|
|
$this->complexAssert = new ComplexAssert();
|
2016-08-14 04:08:43 +00:00
|
|
|
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2016-05-18 11:37:00 +00:00
|
|
|
public function tearDown()
|
|
|
|
{
|
|
|
|
$this->complexAssert = null;
|
|
|
|
}
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerBESSELI
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBESSELI($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BESSELI(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBESSELI()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BESSELI.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBESSELJ
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBESSELJ($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BESSELJ(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBESSELJ()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BESSELJ.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBESSELK
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBESSELK($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BESSELK(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBESSELK()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BESSELK.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBESSELY
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBESSELY($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BESSELY(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::BESSEL_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBESSELY()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BESSELY.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2018-07-25 13:38:44 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerCOMPLEX
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
*/
|
|
|
|
public function testParseComplex()
|
|
|
|
{
|
|
|
|
list($real, $imaginary, $suffix) = [1.23e-4, 5.67e+8, 'j'];
|
|
|
|
|
|
|
|
$result = Engineering::parseComplex('1.23e-4+5.67e+8j');
|
|
|
|
$this->assertArrayHasKey('real', $result);
|
|
|
|
$this->assertEquals($real, $result['real']);
|
|
|
|
$this->assertArrayHasKey('imaginary', $result);
|
|
|
|
$this->assertEquals($imaginary, $result['imaginary']);
|
|
|
|
$this->assertArrayHasKey('suffix', $result);
|
|
|
|
$this->assertEquals($suffix, $result['suffix']);
|
|
|
|
}
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerCOMPLEX
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testCOMPLEX($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::COMPLEX(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerCOMPLEX()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/COMPLEX.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMAGINARY
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMAGINARY($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMAGINARY($value);
|
|
|
|
self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMAGINARY()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMAGINARY.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMREAL
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMREAL($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMREAL($value);
|
|
|
|
self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMREAL()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMREAL.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMABS
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMABS($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMABS($value);
|
|
|
|
self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMABS()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMABS.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMARGUMENT
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMARGUMENT($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMARGUMENT($value);
|
|
|
|
self::assertEquals($expectedResult, $result, null, self::COMPLEX_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMARGUMENT()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMARGUMENT.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMCONJUGATE
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMCONJUGATE($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMCONJUGATE($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMCONJUGATE()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMCONJUGATE.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMCOS
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMCOS($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMCOS($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMCOS()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMCOS.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2018-07-25 13:38:44 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerIMCOSH
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMCOSH($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMCOSH($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMCOSH()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMCOSH.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMCOT
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMCOT($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMCOT($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMCOT()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMCOT.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMCSC
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMCSC($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMCSC($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMCSC()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMCSC.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMCSCH
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMCSCH($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMCSCH($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMCSCH()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMCSCH.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSEC
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMSEC($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMSEC($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMSEC()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMSEC.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSECH
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMSECH($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMSECH($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMSECH()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMSECH.php';
|
|
|
|
}
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerIMDIV
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testIMDIV($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::IMDIV(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMDIV()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMDIV.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMEXP
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMEXP($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMEXP($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMEXP()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMEXP.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMLN
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMLN($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMLN($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMLN()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMLN.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMLOG2
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMLOG2($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMLOG2($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMLOG2()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMLOG2.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMLOG10
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMLOG10($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMLOG10($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMLOG10()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMLOG10.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMPOWER
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testIMPOWER($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::IMPOWER(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMPOWER()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMPOWER.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMPRODUCT
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testIMPRODUCT($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::IMPRODUCT(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMPRODUCT()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMPRODUCT.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSIN
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMSIN($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMSIN($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMSIN()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMSIN.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2018-07-25 13:38:44 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSINH
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMSINH($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMSINH($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMSINH()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMSINH.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMTAN
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function testIMTAN($expectedResult, $value)
|
|
|
|
{
|
|
|
|
$result = Engineering::IMTAN($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerIMTAN()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/IMTAN.php';
|
|
|
|
}
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSQRT
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2018-07-25 13:38:44 +00:00
|
|
|
* @param mixed $value
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2018-07-25 13:38:44 +00:00
|
|
|
public function testIMSQRT($expectedResult, $value)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2018-07-25 13:38:44 +00:00
|
|
|
$result = Engineering::IMSQRT($value);
|
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMSQRT()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMSQRT.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSUB
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testIMSUB($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::IMSUB(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMSUB()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMSUB.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerIMSUM
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testIMSUM($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::IMSUM(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertTrue(
|
|
|
|
$this->complexAssert->assertComplexEquals($expectedResult, $result, self::COMPLEX_PRECISION),
|
|
|
|
$this->complexAssert->getErrorMessage()
|
|
|
|
);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerIMSUM()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/IMSUM.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerERF
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testERF($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::ERF(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::ERF_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerERF()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/ERF.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2018-07-22 18:17:04 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerERFPRECISE
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
*/
|
|
|
|
public function testERFPRECISE($expectedResult, ...$args)
|
|
|
|
{
|
|
|
|
$result = Engineering::ERFPRECISE(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::ERF_PRECISION);
|
2018-07-22 18:17:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function providerERFPRECISE()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/ERFPRECISE.php';
|
|
|
|
}
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerERFC
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testERFC($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::ERFC(...$args);
|
2018-07-25 13:38:44 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null, self::ERF_PRECISION);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerERFC()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/ERFC.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBIN2DEC
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBIN2DEC($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BINTODEC(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBIN2DEC()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BIN2DEC.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBIN2HEX
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBIN2HEX($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BINTOHEX(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBIN2HEX()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BIN2HEX.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBIN2OCT
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testBIN2OCT($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::BINTOOCT(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerBIN2OCT()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/BIN2OCT.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerDEC2BIN
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testDEC2BIN($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::DECTOBIN(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerDEC2BIN()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/DEC2BIN.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerDEC2HEX
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testDEC2HEX($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::DECTOHEX(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerDEC2HEX()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/DEC2HEX.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerDEC2OCT
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testDEC2OCT($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::DECTOOCT(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerDEC2OCT()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/DEC2OCT.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerHEX2BIN
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testHEX2BIN($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::HEXTOBIN(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerHEX2BIN()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/HEX2BIN.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerHEX2DEC
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testHEX2DEC($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::HEXTODEC(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerHEX2DEC()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/HEX2DEC.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerHEX2OCT
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testHEX2OCT($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::HEXTOOCT(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerHEX2OCT()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/HEX2OCT.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerOCT2BIN
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testOCT2BIN($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::OCTTOBIN(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerOCT2BIN()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/OCT2BIN.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerOCT2DEC
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testOCT2DEC($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::OCTTODEC(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerOCT2DEC()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/OCT2DEC.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerOCT2HEX
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testOCT2HEX($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::OCTTOHEX(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerOCT2HEX()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/OCT2HEX.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2018-07-22 21:16:34 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerBITAND
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed[] $args
|
|
|
|
*/
|
|
|
|
public function testBITAND($expectedResult, array $args)
|
|
|
|
{
|
|
|
|
$result = Engineering::BITAND(...$args);
|
|
|
|
self::assertEquals($expectedResult, $result, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerBITAND()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/BITAND.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBITOR
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed[] $args
|
|
|
|
*/
|
|
|
|
public function testBITOR($expectedResult, array $args)
|
|
|
|
{
|
|
|
|
$result = Engineering::BITOR(...$args);
|
|
|
|
self::assertEquals($expectedResult, $result, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerBITOR()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/BITOR.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBITXOR
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed[] $args
|
|
|
|
*/
|
|
|
|
public function testBITXOR($expectedResult, array $args)
|
|
|
|
{
|
|
|
|
$result = Engineering::BITXOR(...$args);
|
|
|
|
self::assertEquals($expectedResult, $result, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerBITXOR()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/BITXOR.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBITLSHIFT
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed[] $args
|
|
|
|
*/
|
|
|
|
public function testBITLSHIFT($expectedResult, array $args)
|
|
|
|
{
|
|
|
|
$result = Engineering::BITLSHIFT(...$args);
|
|
|
|
self::assertEquals($expectedResult, $result, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerBITLSHIFT()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/BITLSHIFT.php';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerBITRSHIFT
|
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
|
|
|
* @param mixed[] $args
|
|
|
|
*/
|
|
|
|
public function testBITRSHIFT($expectedResult, array $args)
|
|
|
|
{
|
|
|
|
$result = Engineering::BITRSHIFT(...$args);
|
|
|
|
self::assertEquals($expectedResult, $result, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function providerBITRSHIFT()
|
|
|
|
{
|
|
|
|
return require 'data/Calculation/Engineering/BITRSHIFT.php';
|
|
|
|
}
|
|
|
|
|
2012-07-31 20:56:11 +00:00
|
|
|
/**
|
|
|
|
* @dataProvider providerDELTA
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testDELTA($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::DELTA(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerDELTA()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/DELTA.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerGESTEP
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testGESTEP($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::GESTEP(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerGESTEP()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/GESTEP.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetConversionGroups()
|
|
|
|
{
|
2016-08-14 04:08:43 +00:00
|
|
|
$result = Engineering::getConversionGroups();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertInternalType('array', $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetConversionGroupUnits()
|
|
|
|
{
|
2016-08-14 04:08:43 +00:00
|
|
|
$result = Engineering::getConversionGroupUnits();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertInternalType('array', $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetConversionGroupUnitDetails()
|
|
|
|
{
|
2016-08-14 04:08:43 +00:00
|
|
|
$result = Engineering::getConversionGroupUnitDetails();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertInternalType('array', $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
2015-05-17 13:00:02 +00:00
|
|
|
public function testGetConversionMultipliers()
|
|
|
|
{
|
2016-08-14 04:08:43 +00:00
|
|
|
$result = Engineering::getConversionMultipliers();
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertInternalType('array', $result);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerCONVERTUOM
|
2017-01-23 05:49:10 +00:00
|
|
|
*
|
|
|
|
* @param mixed $expectedResult
|
2012-07-31 20:56:11 +00:00
|
|
|
*/
|
2017-01-23 05:49:10 +00:00
|
|
|
public function testCONVERTUOM($expectedResult, ...$args)
|
2015-05-17 13:00:02 +00:00
|
|
|
{
|
2017-01-23 05:49:10 +00:00
|
|
|
$result = Engineering::CONVERTUOM(...$args);
|
2017-09-20 05:55:42 +00:00
|
|
|
self::assertEquals($expectedResult, $result, null);
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
|
|
|
|
public function providerCONVERTUOM()
|
|
|
|
{
|
2016-08-16 12:00:19 +00:00
|
|
|
return require 'data/Calculation/Engineering/CONVERTUOM.php';
|
2015-05-17 13:00:02 +00:00
|
|
|
}
|
2012-07-31 20:56:11 +00:00
|
|
|
}
|