update 1.0.8.0
Commits for version update
This commit is contained in:
466
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/DateTimeTest.php
vendored
Normal file
466
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/DateTimeTest.php
vendored
Normal file
@@ -0,0 +1,466 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class DateTimeTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDATE
|
||||
*/
|
||||
public function testDATE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDATE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data');
|
||||
}
|
||||
|
||||
public function testDATEtoPHP()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function testDATEtoPHPObject()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
// Must return an object...
|
||||
$this->assertTrue(is_object($result));
|
||||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result,'DateTime'));
|
||||
// ... with the correct value
|
||||
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
|
||||
}
|
||||
|
||||
public function testDATEwith1904Calendar()
|
||||
{
|
||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
|
||||
$result = PHPExcel_Calculation_DateTime::DATE(1918,11,11);
|
||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
|
||||
$this->assertEquals($result,5428);
|
||||
}
|
||||
|
||||
public function testDATEwith1904CalendarError()
|
||||
{
|
||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
|
||||
$result = PHPExcel_Calculation_DateTime::DATE(1901,1,31);
|
||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
|
||||
$this->assertEquals($result,'#NUM!');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDATEVALUE
|
||||
*/
|
||||
public function testDATEVALUE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDATEVALUE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data');
|
||||
}
|
||||
|
||||
public function testDATEVALUEtoPHP()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function testDATEVALUEtoPHPObject()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
// Must return an object...
|
||||
$this->assertTrue(is_object($result));
|
||||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result,'DateTime'));
|
||||
// ... with the correct value
|
||||
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerYEAR
|
||||
*/
|
||||
public function testYEAR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerYEAR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMONTH
|
||||
*/
|
||||
public function testMONTH()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerMONTH()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerWEEKNUM
|
||||
*/
|
||||
public function testWEEKNUM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerWEEKNUM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerWEEKDAY
|
||||
*/
|
||||
public function testWEEKDAY()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerWEEKDAY()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDAY
|
||||
*/
|
||||
public function testDAY()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDAY()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTIME
|
||||
*/
|
||||
public function testTIME()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerTIME()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data');
|
||||
}
|
||||
|
||||
public function testTIMEtoPHP()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(27020, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function testTIMEtoPHPObject()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
// Must return an object...
|
||||
$this->assertTrue(is_object($result));
|
||||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result,'DateTime'));
|
||||
// ... with the correct value
|
||||
$this->assertEquals($result->format('H:i:s'),'07:30:20');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTIMEVALUE
|
||||
*/
|
||||
public function testTIMEVALUE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerTIMEVALUE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data');
|
||||
}
|
||||
|
||||
public function testTIMEVALUEtoPHP()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(23420, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function testTIMEVALUEtoPHPObject()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
// Must return an object...
|
||||
$this->assertTrue(is_object($result));
|
||||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result,'DateTime'));
|
||||
// ... with the correct value
|
||||
$this->assertEquals($result->format('H:i:s'),'07:30:20');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerHOUR
|
||||
*/
|
||||
public function testHOUR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerHOUR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMINUTE
|
||||
*/
|
||||
public function testMINUTE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerMINUTE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSECOND
|
||||
*/
|
||||
public function testSECOND()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerSECOND()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerNETWORKDAYS
|
||||
*/
|
||||
public function testNETWORKDAYS()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNETWORKDAYS()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerWORKDAY
|
||||
*/
|
||||
public function testWORKDAY()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerWORKDAY()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerEDATE
|
||||
*/
|
||||
public function testEDATE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerEDATE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data');
|
||||
}
|
||||
|
||||
public function testEDATEtoPHP()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1324857600, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function testEDATEtoPHPObject()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
// Must return an object...
|
||||
$this->assertTrue(is_object($result));
|
||||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result,'DateTime'));
|
||||
// ... with the correct value
|
||||
$this->assertEquals($result->format('d-M-Y'),'26-Dec-2011');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerEOMONTH
|
||||
*/
|
||||
public function testEOMONTH()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerEOMONTH()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data');
|
||||
}
|
||||
|
||||
public function testEOMONTHtoPHP()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
$this->assertEquals(1325289600, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function testEOMONTHtoPHPObject()
|
||||
{
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
|
||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||
// Must return an object...
|
||||
$this->assertTrue(is_object($result));
|
||||
// ... of the correct type
|
||||
$this->assertTrue(is_a($result,'DateTime'));
|
||||
// ... with the correct value
|
||||
$this->assertEquals($result->format('d-M-Y'),'31-Dec-2011');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDATEDIF
|
||||
*/
|
||||
public function testDATEDIF()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDATEDIF()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDAYS360
|
||||
*/
|
||||
public function testDAYS360()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDAYS360()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerYEARFRAC
|
||||
*/
|
||||
public function testYEARFRAC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerYEARFRAC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
|
||||
}
|
||||
|
||||
}
|
698
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/EngineeringTest.php
vendored
Normal file
698
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/EngineeringTest.php
vendored
Normal file
@@ -0,0 +1,698 @@
|
||||
<?php
|
||||
|
||||
// Custom assertion class for handling precision of Complex numbers
|
||||
require_once 'custom/complexAssert.php';
|
||||
|
||||
// Data Provider handler
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
|
||||
class EngineeringTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBESSELI
|
||||
*/
|
||||
public function testBESSELI()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELI'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELI()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBESSELJ
|
||||
*/
|
||||
public function testBESSELJ()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELJ'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELJ()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBESSELK
|
||||
*/
|
||||
public function testBESSELK()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELK'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELK()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBESSELY
|
||||
*/
|
||||
public function testBESSELY()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELY'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerBESSELY()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOMPLEX
|
||||
*/
|
||||
public function testCOMPLEX()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','COMPLEX'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCOMPLEX()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMAGINARY
|
||||
*/
|
||||
public function testIMAGINARY()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMAGINARY'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMAGINARY()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMREAL
|
||||
*/
|
||||
public function testIMREAL()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMREAL'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMREAL()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMABS
|
||||
*/
|
||||
public function testIMABS()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMABS'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMABS()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMARGUMENT
|
||||
*/
|
||||
public function testIMARGUMENT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMARGUMENT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIMARGUMENT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMCONJUGATE
|
||||
*/
|
||||
public function testIMCONJUGATE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCONJUGATE'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMCONJUGATE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMCOS
|
||||
*/
|
||||
public function testIMCOS()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCOS'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMCOS()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMDIV
|
||||
*/
|
||||
public function testIMDIV()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMDIV'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMDIV()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMEXP
|
||||
*/
|
||||
public function testIMEXP()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMEXP'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMEXP()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMLN
|
||||
*/
|
||||
public function testIMLN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLN'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMLN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMLOG2
|
||||
*/
|
||||
public function testIMLOG2()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG2'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMLOG2()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMLOG10
|
||||
*/
|
||||
public function testIMLOG10()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG10'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMLOG10()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMPOWER
|
||||
*/
|
||||
public function testIMPOWER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPOWER'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMPOWER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMPRODUCT
|
||||
*/
|
||||
public function testIMPRODUCT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPRODUCT'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMPRODUCT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMSIN
|
||||
*/
|
||||
public function testIMSIN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSIN'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSIN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMSQRT
|
||||
*/
|
||||
public function testIMSQRT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSQRT'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSQRT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMSUB
|
||||
*/
|
||||
public function testIMSUB()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUB'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSUB()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIMSUM
|
||||
*/
|
||||
public function testIMSUM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUM'),$args);
|
||||
$complexAssert = new complexAssert();
|
||||
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
|
||||
$complexAssert->getErrorMessage());
|
||||
}
|
||||
|
||||
public function providerIMSUM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerERF
|
||||
*/
|
||||
public function testERF()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERF'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerERF()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/ERF.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerERFC
|
||||
*/
|
||||
public function testERFC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERFC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerERFC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBIN2DEC
|
||||
*/
|
||||
public function testBIN2DEC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTODEC'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerBIN2DEC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBIN2HEX
|
||||
*/
|
||||
public function testBIN2HEX()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOHEX'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerBIN2HEX()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerBIN2OCT
|
||||
*/
|
||||
public function testBIN2OCT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOOCT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerBIN2OCT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDEC2BIN
|
||||
*/
|
||||
public function testDEC2BIN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOBIN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerDEC2BIN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDEC2HEX
|
||||
*/
|
||||
public function testDEC2HEX()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOHEX'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerDEC2HEX()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDEC2OCT
|
||||
*/
|
||||
public function testDEC2OCT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOOCT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerDEC2OCT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerHEX2BIN
|
||||
*/
|
||||
public function testHEX2BIN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOBIN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerHEX2BIN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerHEX2DEC
|
||||
*/
|
||||
public function testHEX2DEC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTODEC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerHEX2DEC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerHEX2OCT
|
||||
*/
|
||||
public function testHEX2OCT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOOCT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerHEX2OCT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerOCT2BIN
|
||||
*/
|
||||
public function testOCT2BIN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOBIN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerOCT2BIN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerOCT2DEC
|
||||
*/
|
||||
public function testOCT2DEC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTODEC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerOCT2DEC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerOCT2HEX
|
||||
*/
|
||||
public function testOCT2HEX()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOHEX'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerOCT2HEX()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDELTA
|
||||
*/
|
||||
public function testDELTA()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DELTA'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerDELTA()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerGESTEP
|
||||
*/
|
||||
public function testGESTEP()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','GESTEP'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerGESTEP()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data');
|
||||
}
|
||||
|
||||
public function testGetConversionGroups()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Engineering::getConversionGroups();
|
||||
$this->assertInternalType('array', $result);
|
||||
}
|
||||
|
||||
public function testGetConversionGroupUnits()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Engineering::getConversionGroupUnits();
|
||||
$this->assertInternalType('array', $result);
|
||||
}
|
||||
|
||||
public function testGetConversionGroupUnitDetails()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Engineering::getConversionGroupUnitDetails();
|
||||
$this->assertInternalType('array', $result);
|
||||
}
|
||||
|
||||
public function testGetConversionMultipliers()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Engineering::getConversionMultipliers();
|
||||
$this->assertInternalType('array', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCONVERTUOM
|
||||
*/
|
||||
public function testCONVERTUOM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','CONVERTUOM'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL);
|
||||
}
|
||||
|
||||
public function providerCONVERTUOM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data');
|
||||
}
|
||||
|
||||
}
|
516
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/FinancialTest.php
vendored
Normal file
516
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/FinancialTest.php
vendored
Normal file
@@ -0,0 +1,516 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class FinancialTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerACCRINT
|
||||
*/
|
||||
public function testACCRINT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerACCRINT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/ACCRINT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerACCRINTM
|
||||
*/
|
||||
public function testACCRINTM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINTM'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerACCRINTM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/ACCRINTM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerAMORDEGRC
|
||||
*/
|
||||
public function testAMORDEGRC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORDEGRC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerAMORDEGRC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/AMORDEGRC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerAMORLINC
|
||||
*/
|
||||
public function testAMORLINC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORLINC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerAMORLINC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/AMORLINC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOUPDAYBS
|
||||
*/
|
||||
public function testCOUPDAYBS()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYBS'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPDAYBS()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYBS.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOUPDAYS
|
||||
*/
|
||||
public function testCOUPDAYS()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYS'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPDAYS()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYS.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOUPDAYSNC
|
||||
*/
|
||||
public function testCOUPDAYSNC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYSNC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPDAYSNC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYSNC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOUPNCD
|
||||
*/
|
||||
public function testCOUPNCD()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNCD'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPNCD()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPNCD.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOUPNUM
|
||||
*/
|
||||
public function testCOUPNUM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNUM'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPNUM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPNUM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOUPPCD
|
||||
*/
|
||||
public function testCOUPPCD()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPPCD'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCOUPPCD()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPPCD.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCUMIPMT
|
||||
*/
|
||||
public function testCUMIPMT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMIPMT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCUMIPMT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/CUMIPMT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCUMPRINC
|
||||
*/
|
||||
public function testCUMPRINC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMPRINC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerCUMPRINC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/CUMPRINC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDB
|
||||
*/
|
||||
public function testDB()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DB'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDB()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/DB.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDDB
|
||||
*/
|
||||
public function testDDB()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DDB'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDDB()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/DDB.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDISC
|
||||
*/
|
||||
public function testDISC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DISC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDISC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/DISC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDOLLARDE
|
||||
*/
|
||||
public function testDOLLARDE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARDE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDOLLARDE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/DOLLARDE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDOLLARFR
|
||||
*/
|
||||
public function testDOLLARFR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARFR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerDOLLARFR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/DOLLARFR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerEFFECT
|
||||
*/
|
||||
public function testEFFECT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','EFFECT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerEFFECT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/EFFECT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFV
|
||||
*/
|
||||
public function testFV()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FV'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerFV()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/FV.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFVSCHEDULE
|
||||
*/
|
||||
public function testFVSCHEDULE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FVSCHEDULE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerFVSCHEDULE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/FVSCHEDULE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerINTRATE
|
||||
*/
|
||||
public function testINTRATE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','INTRATE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerINTRATE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/INTRATE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIPMT
|
||||
*/
|
||||
public function testIPMT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IPMT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIPMT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/IPMT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIRR
|
||||
*/
|
||||
public function testIRR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IRR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIRR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/IRR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerISPMT
|
||||
*/
|
||||
public function testISPMT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ISPMT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerISPMT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMIRR
|
||||
*/
|
||||
public function testMIRR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','MIRR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerMIRR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/MIRR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerNOMINAL
|
||||
*/
|
||||
public function testNOMINAL()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NOMINAL'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNOMINAL()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/NOMINAL.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerNPER
|
||||
*/
|
||||
public function testNPER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPER'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNPER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/NPER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerNPV
|
||||
*/
|
||||
public function testNPV()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPV'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerNPV()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/NPV.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerPRICE
|
||||
*/
|
||||
public function testPRICE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','PRICE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerPRICE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/PRICE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerRATE
|
||||
*/
|
||||
public function testRATE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','RATE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerRATE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/RATE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerXIRR
|
||||
*/
|
||||
public function testXIRR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','XIRR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerXIRR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Financial/XIRR.data');
|
||||
}
|
||||
|
||||
}
|
276
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/FunctionsTest.php
vendored
Normal file
276
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/FunctionsTest.php
vendored
Normal file
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class FunctionsTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
public function testDUMMY()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::DUMMY();
|
||||
$this->assertEquals('#Not Yet Implemented', $result);
|
||||
}
|
||||
|
||||
public function testDIV0()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::DIV0();
|
||||
$this->assertEquals('#DIV/0!', $result);
|
||||
}
|
||||
|
||||
public function testNA()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::NA();
|
||||
$this->assertEquals('#N/A', $result);
|
||||
}
|
||||
|
||||
public function testNaN()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::NaN();
|
||||
$this->assertEquals('#NUM!', $result);
|
||||
}
|
||||
|
||||
public function testNAME()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::NAME();
|
||||
$this->assertEquals('#NAME?', $result);
|
||||
}
|
||||
|
||||
public function testREF()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::REF();
|
||||
$this->assertEquals('#REF!', $result);
|
||||
}
|
||||
|
||||
public function testNULL()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::NULL();
|
||||
$this->assertEquals('#NULL!', $result);
|
||||
}
|
||||
|
||||
public function testVALUE()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Functions::VALUE();
|
||||
$this->assertEquals('#VALUE!', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_BLANK
|
||||
*/
|
||||
public function testIS_BLANK()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_BLANK()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_ERR
|
||||
*/
|
||||
public function testIS_ERR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_ERR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_ERROR
|
||||
*/
|
||||
public function testIS_ERROR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_ERROR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerERROR_TYPE
|
||||
*/
|
||||
public function testERROR_TYPE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerERROR_TYPE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_LOGICAL
|
||||
*/
|
||||
public function testIS_LOGICAL()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_LOGICAL()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_NA
|
||||
*/
|
||||
public function testIS_NA()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_NA()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_NUMBER
|
||||
*/
|
||||
public function testIS_NUMBER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_NUMBER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_TEXT
|
||||
*/
|
||||
public function testIS_TEXT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_TEXT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_NONTEXT
|
||||
*/
|
||||
public function testIS_NONTEXT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_NONTEXT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_EVEN
|
||||
*/
|
||||
public function testIS_EVEN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_EVEN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIS_ODD
|
||||
*/
|
||||
public function testIS_ODD()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerIS_ODD()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTYPE
|
||||
*/
|
||||
public function testTYPE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerTYPE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerN
|
||||
*/
|
||||
public function testN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
|
||||
}
|
||||
|
||||
}
|
112
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/LogicalTest.php
vendored
Normal file
112
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/LogicalTest.php
vendored
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class LogicalTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
public function testTRUE()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Logical::TRUE();
|
||||
$this->assertEquals(TRUE, $result);
|
||||
}
|
||||
|
||||
public function testFALSE()
|
||||
{
|
||||
$result = PHPExcel_Calculation_Logical::FALSE();
|
||||
$this->assertEquals(FALSE, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerAND
|
||||
*/
|
||||
public function testAND()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerAND()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerOR
|
||||
*/
|
||||
public function testOR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerOR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerNOT
|
||||
*/
|
||||
public function testNOT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerNOT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIF
|
||||
*/
|
||||
public function testIF()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerIF()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerIFERROR
|
||||
*/
|
||||
public function testIFERROR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerIFERROR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
|
||||
}
|
||||
|
||||
}
|
52
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/LookupRefTest.php
vendored
Normal file
52
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/LookupRefTest.php
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class LookupRefTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerHLOOKUP
|
||||
*/
|
||||
public function testHLOOKUP()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','HLOOKUP'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerHLOOKUP()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/LookupRef/HLOOKUP.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerVLOOKUP
|
||||
*/
|
||||
public function testVLOOKUP()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','VLOOKUP'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerVLOOKUP()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data');
|
||||
}
|
||||
|
||||
}
|
560
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/MathTrigTest.php
vendored
Normal file
560
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/MathTrigTest.php
vendored
Normal file
@@ -0,0 +1,560 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class MathTrigTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerATAN2
|
||||
*/
|
||||
public function testATAN2()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerATAN2()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCEILING
|
||||
*/
|
||||
public function testCEILING()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerCEILING()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCOMBIN
|
||||
*/
|
||||
public function testCOMBIN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerCOMBIN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerEVEN
|
||||
*/
|
||||
public function testEVEN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerEVEN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerODD
|
||||
*/
|
||||
public function testODD()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerODD()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFACT
|
||||
*/
|
||||
public function testFACT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerFACT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFACTDOUBLE
|
||||
*/
|
||||
public function testFACTDOUBLE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerFACTDOUBLE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFLOOR
|
||||
*/
|
||||
public function testFLOOR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerFLOOR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerGCD
|
||||
*/
|
||||
public function testGCD()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerGCD()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerLCM
|
||||
*/
|
||||
public function testLCM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerLCM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerINT
|
||||
*/
|
||||
public function testINT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerINT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSIGN
|
||||
*/
|
||||
public function testSIGN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSIGN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerPOWER
|
||||
*/
|
||||
public function testPOWER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerPOWER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerLOG
|
||||
*/
|
||||
public function testLOG()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerLOG()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMOD
|
||||
*/
|
||||
public function testMOD()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMOD()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMDETERM
|
||||
*/
|
||||
public function testMDETERM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMDETERM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMINVERSE
|
||||
*/
|
||||
public function testMINVERSE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMINVERSE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMMULT
|
||||
*/
|
||||
public function testMMULT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMMULT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMULTINOMIAL
|
||||
*/
|
||||
public function testMULTINOMIAL()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMULTINOMIAL()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMROUND
|
||||
*/
|
||||
public function testMROUND()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
|
||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerMROUND()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerPRODUCT
|
||||
*/
|
||||
public function testPRODUCT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerPRODUCT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerQUOTIENT
|
||||
*/
|
||||
public function testQUOTIENT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerQUOTIENT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerROUNDUP
|
||||
*/
|
||||
public function testROUNDUP()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerROUNDUP()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerROUNDDOWN
|
||||
*/
|
||||
public function testROUNDDOWN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerROUNDDOWN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSERIESSUM
|
||||
*/
|
||||
public function testSERIESSUM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSERIESSUM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSUMSQ
|
||||
*/
|
||||
public function testSUMSQ()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSUMSQ()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTRUNC
|
||||
*/
|
||||
public function testTRUNC()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerTRUNC()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerROMAN
|
||||
*/
|
||||
public function testROMAN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerROMAN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSQRTPI
|
||||
*/
|
||||
public function testSQRTPI()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSQRTPI()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSUMIF
|
||||
*/
|
||||
public function testSUMIF()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig', 'SUMIF'), $args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||
}
|
||||
|
||||
public function providerSUMIF()
|
||||
{
|
||||
return array(
|
||||
array(
|
||||
array(
|
||||
array(1),
|
||||
array(5),
|
||||
array(10),
|
||||
),
|
||||
'>=5',
|
||||
15,
|
||||
),
|
||||
array(
|
||||
array(
|
||||
array('text'),
|
||||
array(2),
|
||||
),
|
||||
'=text',
|
||||
array(
|
||||
array(10),
|
||||
array(100),
|
||||
),
|
||||
10,
|
||||
),
|
||||
array(
|
||||
array(
|
||||
array('"text with quotes"'),
|
||||
array(2),
|
||||
),
|
||||
'="text with quotes"',
|
||||
array(
|
||||
array(10),
|
||||
array(100),
|
||||
),
|
||||
10,
|
||||
),
|
||||
array(
|
||||
array(
|
||||
array('"text with quotes"'),
|
||||
array(''),
|
||||
),
|
||||
'>"', // Compare to the single characater " (double quote)
|
||||
array(
|
||||
array(10),
|
||||
array(100),
|
||||
),
|
||||
10
|
||||
),
|
||||
array(
|
||||
array(
|
||||
array(''),
|
||||
array('anything'),
|
||||
),
|
||||
'>"', // Compare to the single characater " (double quote)
|
||||
array(
|
||||
array(10),
|
||||
array(100),
|
||||
),
|
||||
100
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
365
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/TextDataTest.php
vendored
Normal file
365
vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/TextDataTest.php
vendored
Normal file
@@ -0,0 +1,365 @@
|
||||
<?php
|
||||
|
||||
|
||||
require_once 'testDataFileIterator.php';
|
||||
|
||||
class TextDataTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
if (!defined('PHPEXCEL_ROOT'))
|
||||
{
|
||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||
}
|
||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||
|
||||
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCHAR
|
||||
*/
|
||||
public function testCHAR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCHAR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCODE
|
||||
*/
|
||||
public function testCODE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCODE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCONCATENATE
|
||||
*/
|
||||
public function testCONCATENATE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCONCATENATE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerLEFT
|
||||
*/
|
||||
public function testLEFT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerLEFT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerMID
|
||||
*/
|
||||
public function testMID()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerMID()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerRIGHT
|
||||
*/
|
||||
public function testRIGHT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerRIGHT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerLOWER
|
||||
*/
|
||||
public function testLOWER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerLOWER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerUPPER
|
||||
*/
|
||||
public function testUPPER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerUPPER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerPROPER
|
||||
*/
|
||||
public function testPROPER()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerPROPER()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerLEN
|
||||
*/
|
||||
public function testLEN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerLEN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSEARCH
|
||||
*/
|
||||
public function testSEARCH()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerSEARCH()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFIND
|
||||
*/
|
||||
public function testFIND()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerFIND()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerREPLACE
|
||||
*/
|
||||
public function testREPLACE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerREPLACE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerSUBSTITUTE
|
||||
*/
|
||||
public function testSUBSTITUTE()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerSUBSTITUTE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTRIM
|
||||
*/
|
||||
public function testTRIM()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerTRIM()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerCLEAN
|
||||
*/
|
||||
public function testCLEAN()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerCLEAN()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerDOLLAR
|
||||
*/
|
||||
public function testDOLLAR()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerDOLLAR()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerFIXED
|
||||
*/
|
||||
public function testFIXED()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerFIXED()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerT
|
||||
*/
|
||||
public function testT()
|
||||
{
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerTEXT
|
||||
*/
|
||||
public function testTEXT()
|
||||
{
|
||||
// Enforce decimal and thousands separator values to UK/US, and currency code to USD
|
||||
call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
|
||||
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
|
||||
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
|
||||
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
|
||||
$this->assertEquals($expectedResult, $result);
|
||||
}
|
||||
|
||||
public function providerTEXT()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerVALUE
|
||||
*/
|
||||
public function testVALUE()
|
||||
{
|
||||
call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
|
||||
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),' ');
|
||||
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
|
||||
|
||||
$args = func_get_args();
|
||||
$expectedResult = array_pop($args);
|
||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','VALUE'),$args);
|
||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||
}
|
||||
|
||||
public function providerVALUE()
|
||||
{
|
||||
return new testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user