Reorganised unit test directories
This commit is contained in:
parent
83c083392a
commit
f12189b29d
|
@ -1,56 +1,56 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
class AutoloaderTest extends PHPUnit_Framework_TestCase
|
class AutoloaderTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!defined('PHPEXCEL_ROOT'))
|
if (!defined('PHPEXCEL_ROOT'))
|
||||||
{
|
{
|
||||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||||
}
|
}
|
||||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAutoloaderNonPHPExcelClass()
|
public function testAutoloaderNonPHPExcelClass()
|
||||||
{
|
{
|
||||||
$className = 'InvalidClass';
|
$className = 'InvalidClass';
|
||||||
|
|
||||||
$result = PHPExcel_Autoloader::Load($className);
|
$result = PHPExcel_Autoloader::Load($className);
|
||||||
// Must return a boolean...
|
// Must return a boolean...
|
||||||
$this->assertTrue(is_bool($result));
|
$this->assertTrue(is_bool($result));
|
||||||
// ... indicating failure
|
// ... indicating failure
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAutoloaderInvalidPHPExcelClass()
|
public function testAutoloaderInvalidPHPExcelClass()
|
||||||
{
|
{
|
||||||
$className = 'PHPExcel_Invalid_Class';
|
$className = 'PHPExcel_Invalid_Class';
|
||||||
|
|
||||||
$result = PHPExcel_Autoloader::Load($className);
|
$result = PHPExcel_Autoloader::Load($className);
|
||||||
// Must return a boolean...
|
// Must return a boolean...
|
||||||
$this->assertTrue(is_bool($result));
|
$this->assertTrue(is_bool($result));
|
||||||
// ... indicating failure
|
// ... indicating failure
|
||||||
$this->assertFalse($result);
|
$this->assertFalse($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAutoloadValidPHPExcelClass()
|
public function testAutoloadValidPHPExcelClass()
|
||||||
{
|
{
|
||||||
$className = 'PHPExcel_IOFactory';
|
$className = 'PHPExcel_IOFactory';
|
||||||
|
|
||||||
$result = PHPExcel_Autoloader::Load($className);
|
$result = PHPExcel_Autoloader::Load($className);
|
||||||
// Check that class has been loaded
|
// Check that class has been loaded
|
||||||
$this->assertTrue(class_exists($className));
|
$this->assertTrue(class_exists($className));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAutoloadInstantiateSuccess()
|
public function testAutoloadInstantiateSuccess()
|
||||||
{
|
{
|
||||||
$result = new PHPExcel_Calculation_Function(1,2,3);
|
$result = new PHPExcel_Calculation_Function(1,2,3);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
|
$this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,464 +1,464 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once 'testDataFileIterator.php';
|
require_once 'testDataFileIterator.php';
|
||||||
|
|
||||||
class DateTimeTest extends PHPUnit_Framework_TestCase
|
class DateTimeTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!defined('PHPEXCEL_ROOT'))
|
if (!defined('PHPEXCEL_ROOT'))
|
||||||
{
|
{
|
||||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||||
}
|
}
|
||||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerDATE
|
* @dataProvider providerDATE
|
||||||
*/
|
*/
|
||||||
public function testDATE()
|
public function testDATE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerDATE()
|
public function providerDATE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDATEtoPHP()
|
public function testDATEtoPHP()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||||
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
|
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDATEtoPHPObject()
|
public function testDATEtoPHPObject()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||||
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
|
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'DateTime'));
|
$this->assertTrue(is_a($result,'DateTime'));
|
||||||
// ... with the correct value
|
// ... with the correct value
|
||||||
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
|
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDATEwith1904Calendar()
|
public function testDATEwith1904Calendar()
|
||||||
{
|
{
|
||||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
|
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
|
||||||
$result = PHPExcel_Calculation_DateTime::DATE(1918,11,11);
|
$result = PHPExcel_Calculation_DateTime::DATE(1918,11,11);
|
||||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
|
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
|
||||||
$this->assertEquals($result,5428);
|
$this->assertEquals($result,5428);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDATEwith1904CalendarError()
|
public function testDATEwith1904CalendarError()
|
||||||
{
|
{
|
||||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
|
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
|
||||||
$result = PHPExcel_Calculation_DateTime::DATE(1901,1,31);
|
$result = PHPExcel_Calculation_DateTime::DATE(1901,1,31);
|
||||||
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
|
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
|
||||||
$this->assertEquals($result,'#NUM!');
|
$this->assertEquals($result,'#NUM!');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerDATEVALUE
|
* @dataProvider providerDATEVALUE
|
||||||
*/
|
*/
|
||||||
public function testDATEVALUE()
|
public function testDATEVALUE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerDATEVALUE()
|
public function providerDATEVALUE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDATEVALUEtoPHP()
|
public function testDATEVALUEtoPHP()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||||
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
$this->assertEquals(1327968000, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDATEVALUEtoPHPObject()
|
public function testDATEVALUEtoPHPObject()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||||
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'DateTime'));
|
$this->assertTrue(is_a($result,'DateTime'));
|
||||||
// ... with the correct value
|
// ... with the correct value
|
||||||
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
|
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerYEAR
|
* @dataProvider providerYEAR
|
||||||
*/
|
*/
|
||||||
public function testYEAR()
|
public function testYEAR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerYEAR()
|
public function providerYEAR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMONTH
|
* @dataProvider providerMONTH
|
||||||
*/
|
*/
|
||||||
public function testMONTH()
|
public function testMONTH()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMONTH()
|
public function providerMONTH()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerWEEKNUM
|
* @dataProvider providerWEEKNUM
|
||||||
*/
|
*/
|
||||||
public function testWEEKNUM()
|
public function testWEEKNUM()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerWEEKNUM()
|
public function providerWEEKNUM()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerWEEKDAY
|
* @dataProvider providerWEEKDAY
|
||||||
*/
|
*/
|
||||||
public function testWEEKDAY()
|
public function testWEEKDAY()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerWEEKDAY()
|
public function providerWEEKDAY()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerDAY
|
* @dataProvider providerDAY
|
||||||
*/
|
*/
|
||||||
public function testDAY()
|
public function testDAY()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerDAY()
|
public function providerDAY()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerTIME
|
* @dataProvider providerTIME
|
||||||
*/
|
*/
|
||||||
public function testTIME()
|
public function testTIME()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerTIME()
|
public function providerTIME()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTIMEtoPHP()
|
public function testTIMEtoPHP()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||||
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
|
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
$this->assertEquals(27020, $result, NULL, 1E-8);
|
$this->assertEquals(27020, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTIMEtoPHPObject()
|
public function testTIMEtoPHPObject()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||||
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
|
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'DateTime'));
|
$this->assertTrue(is_a($result,'DateTime'));
|
||||||
// ... with the correct value
|
// ... with the correct value
|
||||||
$this->assertEquals($result->format('H:i:s'),'07:30:20');
|
$this->assertEquals($result->format('H:i:s'),'07:30:20');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerTIMEVALUE
|
* @dataProvider providerTIMEVALUE
|
||||||
*/
|
*/
|
||||||
public function testTIMEVALUE()
|
public function testTIMEVALUE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerTIMEVALUE()
|
public function providerTIMEVALUE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTIMEVALUEtoPHP()
|
public function testTIMEVALUEtoPHP()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||||
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
$this->assertEquals(23420, $result, NULL, 1E-8);
|
$this->assertEquals(23420, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTIMEVALUEtoPHPObject()
|
public function testTIMEVALUEtoPHPObject()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||||
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'DateTime'));
|
$this->assertTrue(is_a($result,'DateTime'));
|
||||||
// ... with the correct value
|
// ... with the correct value
|
||||||
$this->assertEquals($result->format('H:i:s'),'07:30:20');
|
$this->assertEquals($result->format('H:i:s'),'07:30:20');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerHOUR
|
* @dataProvider providerHOUR
|
||||||
*/
|
*/
|
||||||
public function testHOUR()
|
public function testHOUR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerHOUR()
|
public function providerHOUR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMINUTE
|
* @dataProvider providerMINUTE
|
||||||
*/
|
*/
|
||||||
public function testMINUTE()
|
public function testMINUTE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMINUTE()
|
public function providerMINUTE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSECOND
|
* @dataProvider providerSECOND
|
||||||
*/
|
*/
|
||||||
public function testSECOND()
|
public function testSECOND()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSECOND()
|
public function providerSECOND()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerNETWORKDAYS
|
* @dataProvider providerNETWORKDAYS
|
||||||
*/
|
*/
|
||||||
public function testNETWORKDAYS()
|
public function testNETWORKDAYS()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerNETWORKDAYS()
|
public function providerNETWORKDAYS()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerWORKDAY
|
* @dataProvider providerWORKDAY
|
||||||
*/
|
*/
|
||||||
public function testWORKDAY()
|
public function testWORKDAY()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerWORKDAY()
|
public function providerWORKDAY()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerEDATE
|
* @dataProvider providerEDATE
|
||||||
*/
|
*/
|
||||||
public function testEDATE()
|
public function testEDATE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerEDATE()
|
public function providerEDATE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEDATEtoPHP()
|
public function testEDATEtoPHP()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||||
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
|
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
$this->assertEquals(1324857600, $result, NULL, 1E-8);
|
$this->assertEquals(1324857600, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEDATEtoPHPObject()
|
public function testEDATEtoPHPObject()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||||
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
|
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'DateTime'));
|
$this->assertTrue(is_a($result,'DateTime'));
|
||||||
// ... with the correct value
|
// ... with the correct value
|
||||||
$this->assertEquals($result->format('d-M-Y'),'26-Dec-2011');
|
$this->assertEquals($result->format('d-M-Y'),'26-Dec-2011');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerEOMONTH
|
* @dataProvider providerEOMONTH
|
||||||
*/
|
*/
|
||||||
public function testEOMONTH()
|
public function testEOMONTH()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerEOMONTH()
|
public function providerEOMONTH()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEOMONTHtoPHP()
|
public function testEOMONTHtoPHP()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
|
||||||
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
|
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
$this->assertEquals(1325289600, $result, NULL, 1E-8);
|
$this->assertEquals(1325289600, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEOMONTHtoPHPObject()
|
public function testEOMONTHtoPHPObject()
|
||||||
{
|
{
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
|
||||||
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
|
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
|
||||||
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
|
||||||
// Must return an object...
|
// Must return an object...
|
||||||
$this->assertTrue(is_object($result));
|
$this->assertTrue(is_object($result));
|
||||||
// ... of the correct type
|
// ... of the correct type
|
||||||
$this->assertTrue(is_a($result,'DateTime'));
|
$this->assertTrue(is_a($result,'DateTime'));
|
||||||
// ... with the correct value
|
// ... with the correct value
|
||||||
$this->assertEquals($result->format('d-M-Y'),'31-Dec-2011');
|
$this->assertEquals($result->format('d-M-Y'),'31-Dec-2011');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerDATEDIF
|
* @dataProvider providerDATEDIF
|
||||||
*/
|
*/
|
||||||
public function testDATEDIF()
|
public function testDATEDIF()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerDATEDIF()
|
public function providerDATEDIF()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerDAYS360
|
* @dataProvider providerDAYS360
|
||||||
*/
|
*/
|
||||||
public function testDAYS360()
|
public function testDAYS360()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerDAYS360()
|
public function providerDAYS360()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerYEARFRAC
|
* @dataProvider providerYEARFRAC
|
||||||
*/
|
*/
|
||||||
public function testYEARFRAC()
|
public function testYEARFRAC()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerYEARFRAC()
|
public function providerYEARFRAC()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
|
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,274 +1,274 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once 'testDataFileIterator.php';
|
require_once 'testDataFileIterator.php';
|
||||||
|
|
||||||
class FunctionsTest extends PHPUnit_Framework_TestCase
|
class FunctionsTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!defined('PHPEXCEL_ROOT'))
|
if (!defined('PHPEXCEL_ROOT'))
|
||||||
{
|
{
|
||||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||||
}
|
}
|
||||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDUMMY()
|
public function testDUMMY()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::DUMMY();
|
$result = PHPExcel_Calculation_Functions::DUMMY();
|
||||||
$this->assertEquals('#Not Yet Implemented', $result);
|
$this->assertEquals('#Not Yet Implemented', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDIV0()
|
public function testDIV0()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::DIV0();
|
$result = PHPExcel_Calculation_Functions::DIV0();
|
||||||
$this->assertEquals('#DIV/0!', $result);
|
$this->assertEquals('#DIV/0!', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNA()
|
public function testNA()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::NA();
|
$result = PHPExcel_Calculation_Functions::NA();
|
||||||
$this->assertEquals('#N/A', $result);
|
$this->assertEquals('#N/A', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNaN()
|
public function testNaN()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::NaN();
|
$result = PHPExcel_Calculation_Functions::NaN();
|
||||||
$this->assertEquals('#NUM!', $result);
|
$this->assertEquals('#NUM!', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNAME()
|
public function testNAME()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::NAME();
|
$result = PHPExcel_Calculation_Functions::NAME();
|
||||||
$this->assertEquals('#NAME?', $result);
|
$this->assertEquals('#NAME?', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testREF()
|
public function testREF()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::REF();
|
$result = PHPExcel_Calculation_Functions::REF();
|
||||||
$this->assertEquals('#REF!', $result);
|
$this->assertEquals('#REF!', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNULL()
|
public function testNULL()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::NULL();
|
$result = PHPExcel_Calculation_Functions::NULL();
|
||||||
$this->assertEquals('#NULL!', $result);
|
$this->assertEquals('#NULL!', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testVALUE()
|
public function testVALUE()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Functions::VALUE();
|
$result = PHPExcel_Calculation_Functions::VALUE();
|
||||||
$this->assertEquals('#VALUE!', $result);
|
$this->assertEquals('#VALUE!', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_BLANK
|
* @dataProvider providerIS_BLANK
|
||||||
*/
|
*/
|
||||||
public function testIS_BLANK()
|
public function testIS_BLANK()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_BLANK()
|
public function providerIS_BLANK()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_ERR
|
* @dataProvider providerIS_ERR
|
||||||
*/
|
*/
|
||||||
public function testIS_ERR()
|
public function testIS_ERR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_ERR()
|
public function providerIS_ERR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_ERROR
|
* @dataProvider providerIS_ERROR
|
||||||
*/
|
*/
|
||||||
public function testIS_ERROR()
|
public function testIS_ERROR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_ERROR()
|
public function providerIS_ERROR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerERROR_TYPE
|
* @dataProvider providerERROR_TYPE
|
||||||
*/
|
*/
|
||||||
public function testERROR_TYPE()
|
public function testERROR_TYPE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerERROR_TYPE()
|
public function providerERROR_TYPE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_LOGICAL
|
* @dataProvider providerIS_LOGICAL
|
||||||
*/
|
*/
|
||||||
public function testIS_LOGICAL()
|
public function testIS_LOGICAL()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_LOGICAL()
|
public function providerIS_LOGICAL()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_NA
|
* @dataProvider providerIS_NA
|
||||||
*/
|
*/
|
||||||
public function testIS_NA()
|
public function testIS_NA()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_NA()
|
public function providerIS_NA()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_NUMBER
|
* @dataProvider providerIS_NUMBER
|
||||||
*/
|
*/
|
||||||
public function testIS_NUMBER()
|
public function testIS_NUMBER()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_NUMBER()
|
public function providerIS_NUMBER()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_TEXT
|
* @dataProvider providerIS_TEXT
|
||||||
*/
|
*/
|
||||||
public function testIS_TEXT()
|
public function testIS_TEXT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_TEXT()
|
public function providerIS_TEXT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_NONTEXT
|
* @dataProvider providerIS_NONTEXT
|
||||||
*/
|
*/
|
||||||
public function testIS_NONTEXT()
|
public function testIS_NONTEXT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_NONTEXT()
|
public function providerIS_NONTEXT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_EVEN
|
* @dataProvider providerIS_EVEN
|
||||||
*/
|
*/
|
||||||
public function testIS_EVEN()
|
public function testIS_EVEN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_EVEN()
|
public function providerIS_EVEN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIS_ODD
|
* @dataProvider providerIS_ODD
|
||||||
*/
|
*/
|
||||||
public function testIS_ODD()
|
public function testIS_ODD()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIS_ODD()
|
public function providerIS_ODD()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerTYPE
|
* @dataProvider providerTYPE
|
||||||
*/
|
*/
|
||||||
public function testTYPE()
|
public function testTYPE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerTYPE()
|
public function providerTYPE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerN
|
* @dataProvider providerN
|
||||||
*/
|
*/
|
||||||
public function testN()
|
public function testN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerN()
|
public function providerN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
|
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,110 +1,110 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once 'testDataFileIterator.php';
|
require_once 'testDataFileIterator.php';
|
||||||
|
|
||||||
class LogicalTest extends PHPUnit_Framework_TestCase
|
class LogicalTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!defined('PHPEXCEL_ROOT'))
|
if (!defined('PHPEXCEL_ROOT'))
|
||||||
{
|
{
|
||||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||||
}
|
}
|
||||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testTRUE()
|
public function testTRUE()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Logical::TRUE();
|
$result = PHPExcel_Calculation_Logical::TRUE();
|
||||||
$this->assertEquals(TRUE, $result);
|
$this->assertEquals(TRUE, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFALSE()
|
public function testFALSE()
|
||||||
{
|
{
|
||||||
$result = PHPExcel_Calculation_Logical::FALSE();
|
$result = PHPExcel_Calculation_Logical::FALSE();
|
||||||
$this->assertEquals(FALSE, $result);
|
$this->assertEquals(FALSE, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerAND
|
* @dataProvider providerAND
|
||||||
*/
|
*/
|
||||||
public function testAND()
|
public function testAND()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerAND()
|
public function providerAND()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
|
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerOR
|
* @dataProvider providerOR
|
||||||
*/
|
*/
|
||||||
public function testOR()
|
public function testOR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerOR()
|
public function providerOR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
|
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerNOT
|
* @dataProvider providerNOT
|
||||||
*/
|
*/
|
||||||
public function testNOT()
|
public function testNOT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerNOT()
|
public function providerNOT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
|
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIF
|
* @dataProvider providerIF
|
||||||
*/
|
*/
|
||||||
public function testIF()
|
public function testIF()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIF()
|
public function providerIF()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
|
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerIFERROR
|
* @dataProvider providerIFERROR
|
||||||
*/
|
*/
|
||||||
public function testIFERROR()
|
public function testIFERROR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerIFERROR()
|
public function providerIFERROR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
|
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,484 +1,484 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once 'testDataFileIterator.php';
|
require_once 'testDataFileIterator.php';
|
||||||
|
|
||||||
class MathTrigTest extends PHPUnit_Framework_TestCase
|
class MathTrigTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!defined('PHPEXCEL_ROOT'))
|
if (!defined('PHPEXCEL_ROOT'))
|
||||||
{
|
{
|
||||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||||
}
|
}
|
||||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerATAN2
|
* @dataProvider providerATAN2
|
||||||
*/
|
*/
|
||||||
public function testATAN2()
|
public function testATAN2()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerATAN2()
|
public function providerATAN2()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerCEILING
|
* @dataProvider providerCEILING
|
||||||
*/
|
*/
|
||||||
public function testCEILING()
|
public function testCEILING()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerCEILING()
|
public function providerCEILING()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerCOMBIN
|
* @dataProvider providerCOMBIN
|
||||||
*/
|
*/
|
||||||
public function testCOMBIN()
|
public function testCOMBIN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerCOMBIN()
|
public function providerCOMBIN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerEVEN
|
* @dataProvider providerEVEN
|
||||||
*/
|
*/
|
||||||
public function testEVEN()
|
public function testEVEN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerEVEN()
|
public function providerEVEN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerODD
|
* @dataProvider providerODD
|
||||||
*/
|
*/
|
||||||
public function testODD()
|
public function testODD()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerODD()
|
public function providerODD()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerFACT
|
* @dataProvider providerFACT
|
||||||
*/
|
*/
|
||||||
public function testFACT()
|
public function testFACT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerFACT()
|
public function providerFACT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerFACTDOUBLE
|
* @dataProvider providerFACTDOUBLE
|
||||||
*/
|
*/
|
||||||
public function testFACTDOUBLE()
|
public function testFACTDOUBLE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerFACTDOUBLE()
|
public function providerFACTDOUBLE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerFLOOR
|
* @dataProvider providerFLOOR
|
||||||
*/
|
*/
|
||||||
public function testFLOOR()
|
public function testFLOOR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerFLOOR()
|
public function providerFLOOR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerGCD
|
* @dataProvider providerGCD
|
||||||
*/
|
*/
|
||||||
public function testGCD()
|
public function testGCD()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerGCD()
|
public function providerGCD()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerLCM
|
* @dataProvider providerLCM
|
||||||
*/
|
*/
|
||||||
public function testLCM()
|
public function testLCM()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerLCM()
|
public function providerLCM()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerINT
|
* @dataProvider providerINT
|
||||||
*/
|
*/
|
||||||
public function testINT()
|
public function testINT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerINT()
|
public function providerINT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSIGN
|
* @dataProvider providerSIGN
|
||||||
*/
|
*/
|
||||||
public function testSIGN()
|
public function testSIGN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSIGN()
|
public function providerSIGN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerPOWER
|
* @dataProvider providerPOWER
|
||||||
*/
|
*/
|
||||||
public function testPOWER()
|
public function testPOWER()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerPOWER()
|
public function providerPOWER()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerLOG
|
* @dataProvider providerLOG
|
||||||
*/
|
*/
|
||||||
public function testLOG()
|
public function testLOG()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerLOG()
|
public function providerLOG()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMOD
|
* @dataProvider providerMOD
|
||||||
*/
|
*/
|
||||||
public function testMOD()
|
public function testMOD()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMOD()
|
public function providerMOD()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMDETERM
|
* @dataProvider providerMDETERM
|
||||||
*/
|
*/
|
||||||
public function testMDETERM()
|
public function testMDETERM()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMDETERM()
|
public function providerMDETERM()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMINVERSE
|
* @dataProvider providerMINVERSE
|
||||||
*/
|
*/
|
||||||
public function testMINVERSE()
|
public function testMINVERSE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMINVERSE()
|
public function providerMINVERSE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMMULT
|
* @dataProvider providerMMULT
|
||||||
*/
|
*/
|
||||||
public function testMMULT()
|
public function testMMULT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMMULT()
|
public function providerMMULT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMULTINOMIAL
|
* @dataProvider providerMULTINOMIAL
|
||||||
*/
|
*/
|
||||||
public function testMULTINOMIAL()
|
public function testMULTINOMIAL()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMULTINOMIAL()
|
public function providerMULTINOMIAL()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMROUND
|
* @dataProvider providerMROUND
|
||||||
*/
|
*/
|
||||||
public function testMROUND()
|
public function testMROUND()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
|
||||||
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
|
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMROUND()
|
public function providerMROUND()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerPRODUCT
|
* @dataProvider providerPRODUCT
|
||||||
*/
|
*/
|
||||||
public function testPRODUCT()
|
public function testPRODUCT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerPRODUCT()
|
public function providerPRODUCT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerQUOTIENT
|
* @dataProvider providerQUOTIENT
|
||||||
*/
|
*/
|
||||||
public function testQUOTIENT()
|
public function testQUOTIENT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerQUOTIENT()
|
public function providerQUOTIENT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerROUNDUP
|
* @dataProvider providerROUNDUP
|
||||||
*/
|
*/
|
||||||
public function testROUNDUP()
|
public function testROUNDUP()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerROUNDUP()
|
public function providerROUNDUP()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerROUNDDOWN
|
* @dataProvider providerROUNDDOWN
|
||||||
*/
|
*/
|
||||||
public function testROUNDDOWN()
|
public function testROUNDDOWN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerROUNDDOWN()
|
public function providerROUNDDOWN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSERIESSUM
|
* @dataProvider providerSERIESSUM
|
||||||
*/
|
*/
|
||||||
public function testSERIESSUM()
|
public function testSERIESSUM()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSERIESSUM()
|
public function providerSERIESSUM()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSUMSQ
|
* @dataProvider providerSUMSQ
|
||||||
*/
|
*/
|
||||||
public function testSUMSQ()
|
public function testSUMSQ()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSUMSQ()
|
public function providerSUMSQ()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerTRUNC
|
* @dataProvider providerTRUNC
|
||||||
*/
|
*/
|
||||||
public function testTRUNC()
|
public function testTRUNC()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerTRUNC()
|
public function providerTRUNC()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerROMAN
|
* @dataProvider providerROMAN
|
||||||
*/
|
*/
|
||||||
public function testROMAN()
|
public function testROMAN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerROMAN()
|
public function providerROMAN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSQRTPI
|
* @dataProvider providerSQRTPI
|
||||||
*/
|
*/
|
||||||
public function testSQRTPI()
|
public function testSQRTPI()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
|
||||||
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSQRTPI()
|
public function providerSQRTPI()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data');
|
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,343 +1,343 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
require_once 'testDataFileIterator.php';
|
require_once 'testDataFileIterator.php';
|
||||||
|
|
||||||
class TextDataTest extends PHPUnit_Framework_TestCase
|
class TextDataTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
public function setUp()
|
public function setUp()
|
||||||
{
|
{
|
||||||
if (!defined('PHPEXCEL_ROOT'))
|
if (!defined('PHPEXCEL_ROOT'))
|
||||||
{
|
{
|
||||||
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
|
||||||
}
|
}
|
||||||
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerCHAR
|
* @dataProvider providerCHAR
|
||||||
*/
|
*/
|
||||||
public function testCHAR()
|
public function testCHAR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerCHAR()
|
public function providerCHAR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerCODE
|
* @dataProvider providerCODE
|
||||||
*/
|
*/
|
||||||
public function testCODE()
|
public function testCODE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerCODE()
|
public function providerCODE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerCONCATENATE
|
* @dataProvider providerCONCATENATE
|
||||||
*/
|
*/
|
||||||
public function testCONCATENATE()
|
public function testCONCATENATE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerCONCATENATE()
|
public function providerCONCATENATE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerLEFT
|
* @dataProvider providerLEFT
|
||||||
*/
|
*/
|
||||||
public function testLEFT()
|
public function testLEFT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerLEFT()
|
public function providerLEFT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerMID
|
* @dataProvider providerMID
|
||||||
*/
|
*/
|
||||||
public function testMID()
|
public function testMID()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerMID()
|
public function providerMID()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerRIGHT
|
* @dataProvider providerRIGHT
|
||||||
*/
|
*/
|
||||||
public function testRIGHT()
|
public function testRIGHT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerRIGHT()
|
public function providerRIGHT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerLOWER
|
* @dataProvider providerLOWER
|
||||||
*/
|
*/
|
||||||
public function testLOWER()
|
public function testLOWER()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerLOWER()
|
public function providerLOWER()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerUPPER
|
* @dataProvider providerUPPER
|
||||||
*/
|
*/
|
||||||
public function testUPPER()
|
public function testUPPER()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerUPPER()
|
public function providerUPPER()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerPROPER
|
* @dataProvider providerPROPER
|
||||||
*/
|
*/
|
||||||
public function testPROPER()
|
public function testPROPER()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerPROPER()
|
public function providerPROPER()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerLEN
|
* @dataProvider providerLEN
|
||||||
*/
|
*/
|
||||||
public function testLEN()
|
public function testLEN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerLEN()
|
public function providerLEN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSEARCH
|
* @dataProvider providerSEARCH
|
||||||
*/
|
*/
|
||||||
public function testSEARCH()
|
public function testSEARCH()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSEARCH()
|
public function providerSEARCH()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerFIND
|
* @dataProvider providerFIND
|
||||||
*/
|
*/
|
||||||
public function testFIND()
|
public function testFIND()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerFIND()
|
public function providerFIND()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerREPLACE
|
* @dataProvider providerREPLACE
|
||||||
*/
|
*/
|
||||||
public function testREPLACE()
|
public function testREPLACE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerREPLACE()
|
public function providerREPLACE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerSUBSTITUTE
|
* @dataProvider providerSUBSTITUTE
|
||||||
*/
|
*/
|
||||||
public function testSUBSTITUTE()
|
public function testSUBSTITUTE()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerSUBSTITUTE()
|
public function providerSUBSTITUTE()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerTRIM
|
* @dataProvider providerTRIM
|
||||||
*/
|
*/
|
||||||
public function testTRIM()
|
public function testTRIM()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerTRIM()
|
public function providerTRIM()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerCLEAN
|
* @dataProvider providerCLEAN
|
||||||
*/
|
*/
|
||||||
public function testCLEAN()
|
public function testCLEAN()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerCLEAN()
|
public function providerCLEAN()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerDOLLAR
|
* @dataProvider providerDOLLAR
|
||||||
*/
|
*/
|
||||||
public function testDOLLAR()
|
public function testDOLLAR()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerDOLLAR()
|
public function providerDOLLAR()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerFIXED
|
* @dataProvider providerFIXED
|
||||||
*/
|
*/
|
||||||
public function testFIXED()
|
public function testFIXED()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerFIXED()
|
public function providerFIXED()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerT
|
* @dataProvider providerT
|
||||||
*/
|
*/
|
||||||
public function testT()
|
public function testT()
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerT()
|
public function providerT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerTEXT
|
* @dataProvider providerTEXT
|
||||||
*/
|
*/
|
||||||
public function testTEXT()
|
public function testTEXT()
|
||||||
{
|
{
|
||||||
// Enforce decimal and thousands separator values to UK/US, and currency code to USD
|
// 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','setDecimalSeparator'),'.');
|
||||||
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
|
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
|
||||||
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
|
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
|
||||||
|
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
|
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function providerTEXT()
|
public function providerTEXT()
|
||||||
{
|
{
|
||||||
return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
|
return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -17,7 +17,7 @@
|
||||||
<ini name="memory_limit" value="2048M"/>
|
<ini name="memory_limit" value="2048M"/>
|
||||||
</php>
|
</php>
|
||||||
<testsuite name="PHPExcel Unit Test Suite">
|
<testsuite name="PHPExcel Unit Test Suite">
|
||||||
<directory suffix="Test.php">./PHPExcel</directory>
|
<directory suffix="Test.php">./Classes</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist>
|
<whitelist>
|
||||||
|
|
Loading…
Reference in New Issue