PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/EngineeringTest.php

698 lines
18 KiB
PHP
Raw Normal View History

2012-07-31 20:56:11 +00:00
<?php
namespace PhpOffice\PhpSpreadsheetTests\Calculation;
2012-07-31 20:56:11 +00:00
use PhpOffice\PhpSpreadsheet\Calculation\Engineering;
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
use PhpOffice\PhpSpreadsheetTests\Custom\ComplexAssert;
use PHPUnit\Framework\TestCase;
class EngineeringTest extends TestCase
2012-07-31 20:56:11 +00:00
{
/**
* @var ComplexAssert
*/
protected $complexAssert;
2012-07-31 20:56:11 +00:00
public function setUp()
{
$this->complexAssert = new ComplexAssert();
Functions::setCompatibilityMode(Functions::COMPATIBILITY_EXCEL);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function tearDown()
{
$this->complexAssert = null;
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerBESSELI
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBESSELI($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BESSELI(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBESSELI()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBESSELJ($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BESSELJ(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBESSELJ()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBESSELK($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BESSELK(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBESSELK()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBESSELY($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BESSELY(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBESSELY()
{
return require 'data/Calculation/Engineering/BESSELY.php';
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerCOMPLEX
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testCOMPLEX($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::COMPLEX(...$args);
self::assertEquals($expectedResult, $result);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerCOMPLEX()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMAGINARY($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMAGINARY(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMAGINARY()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMREAL($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMREAL(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMREAL()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMABS($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMABS(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMABS()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMARGUMENT($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMARGUMENT(...$args);
self::assertEquals($expectedResult, $result, null, 1E-8);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMARGUMENT()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMCONJUGATE($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMCONJUGATE(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMCONJUGATE()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMCOS($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMCOS(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMCOS()
{
return require 'data/Calculation/Engineering/IMCOS.php';
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerIMDIV
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMDIV($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$this->markTestIncomplete('TODO: This test should be fixed');
$result = Engineering::IMDIV(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMDIV()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMEXP($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMEXP(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMEXP()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMLN($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMLN(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMLN()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMLOG2($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMLOG2(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMLOG2()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMLOG10($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMLOG10(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMLOG10()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMPOWER($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$this->markTestIncomplete('TODO: This test should be fixed');
$result = Engineering::IMPOWER(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMPOWER()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMPRODUCT($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMPRODUCT(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMPRODUCT()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMSIN($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMSIN(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMSIN()
{
return require 'data/Calculation/Engineering/IMSIN.php';
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerIMSQRT
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMSQRT($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMSQRT(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMSQRT()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMSUB($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$this->markTestIncomplete('TODO: This test should be fixed');
$result = Engineering::IMSUB(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMSUB()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testIMSUM($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::IMSUM(...$args);
self::assertTrue($this->complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $this->complexAssert->getErrorMessage());
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerIMSUM()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testERF($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::ERF(...$args);
self::assertEquals($expectedResult, $result, null, 1E-12);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerERF()
{
return require 'data/Calculation/Engineering/ERF.php';
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
Add further new Functions introduced in MS Excel 2013 and 2016 (#608) - Fix ISFORMULA() function to work with a cell reference to another worksheet - Added calculation engine support for the new functions that were added in MS Excel 2013 and MS Excel 2016 - Text Functions - CONCAT() Synonym for CONCATENATE() - NUMBERVALUE() Converts text to a number, in a locale-independent way - UNICHAR() Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally - UNIORD() Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally - TEXTJOIN() Joins together two or more text strings, separated by a delimiter - Logical Functions - XOR() Returns a logical Exclusive Or of all arguments - Date/Time Functions - ISOWEEKNUM() Returns the ISO 8601 week number of the year for a given date - Lookup and Reference Functions - FORMULATEXT() Returns a formula as a string - Engineering Functions - ERF.PRECISE() Returns the error function integrated between 0 and a supplied limit - ERFC.PRECISE() Synonym for ERFC - Math and Trig Functions - SEC() Returns the secant of an angle - SECH() Returns the hyperbolic secant of an angle - CSC() Returns the cosecant of an angle - CSCH() Returns the hyperbolic cosecant of an angle - COT() Returns the cotangent of an angle - COTH() Returns the hyperbolic cotangent of an angle - ACOT() Returns the cotangent of an angle - ACOTH() Returns the hyperbolic cotangent of an angle - Financial Functions - PDURATION() Calculates the number of periods required for an investment to reach a specified value - RRI() Calculates the interest rate required for an investment to grow to a specified future value
2018-07-22 18:17:04 +00:00
/**
* @dataProvider providerERFPRECISE
*
* @param mixed $expectedResult
*/
public function testERFPRECISE($expectedResult, ...$args)
{
$result = Engineering::ERFPRECISE(...$args);
self::assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerERFPRECISE()
{
return require 'data/Calculation/Engineering/ERFPRECISE.php';
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerERFC
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testERFC($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::ERFC(...$args);
self::assertEquals($expectedResult, $result, null, 1E-12);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerERFC()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBIN2DEC($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BINTODEC(...$args);
self::assertEquals($expectedResult, $result);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBIN2DEC()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBIN2HEX($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BINTOHEX(...$args);
self::assertEquals($expectedResult, $result);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBIN2HEX()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testBIN2OCT($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::BINTOOCT(...$args);
self::assertEquals($expectedResult, $result);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerBIN2OCT()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testDEC2BIN($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::DECTOBIN(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerDEC2BIN()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testDEC2HEX($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::DECTOHEX(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerDEC2HEX()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testDEC2OCT($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::DECTOOCT(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerDEC2OCT()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testHEX2BIN($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::HEXTOBIN(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerHEX2BIN()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testHEX2DEC($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::HEXTODEC(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerHEX2DEC()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testHEX2OCT($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::HEXTOOCT(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerHEX2OCT()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testOCT2BIN($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::OCTTOBIN(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerOCT2BIN()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testOCT2DEC($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::OCTTODEC(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerOCT2DEC()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testOCT2HEX($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::OCTTOHEX(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerOCT2HEX()
{
return require 'data/Calculation/Engineering/OCT2HEX.php';
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerDELTA
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testDELTA($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::DELTA(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerDELTA()
{
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
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testGESTEP($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::GESTEP(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerGESTEP()
{
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()
{
$result = Engineering::getConversionGroups();
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()
{
$result = Engineering::getConversionGroupUnits();
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()
{
$result = Engineering::getConversionGroupUnitDetails();
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()
{
$result = Engineering::getConversionMultipliers();
self::assertInternalType('array', $result);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
/**
* @dataProvider providerCONVERTUOM
*
* @param mixed $expectedResult
2012-07-31 20:56:11 +00:00
*/
public function testCONVERTUOM($expectedResult, ...$args)
2015-05-17 13:00:02 +00:00
{
$result = Engineering::CONVERTUOM(...$args);
self::assertEquals($expectedResult, $result, null);
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
public function providerCONVERTUOM()
{
return require 'data/Calculation/Engineering/CONVERTUOM.php';
2015-05-17 13:00:02 +00:00
}
2012-07-31 20:56:11 +00:00
}