Reorganised unit test directories

This commit is contained in:
Mark Baker 2012-07-31 21:56:11 +01:00
parent 83c083392a
commit f12189b29d
16 changed files with 2941 additions and 2941 deletions

View File

@ -1,56 +1,56 @@
<?php
class AutoloaderTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testAutoloaderNonPHPExcelClass()
{
$className = 'InvalidClass';
$result = PHPExcel_Autoloader::Load($className);
// Must return a boolean...
$this->assertTrue(is_bool($result));
// ... indicating failure
$this->assertFalse($result);
}
public function testAutoloaderInvalidPHPExcelClass()
{
$className = 'PHPExcel_Invalid_Class';
$result = PHPExcel_Autoloader::Load($className);
// Must return a boolean...
$this->assertTrue(is_bool($result));
// ... indicating failure
$this->assertFalse($result);
}
public function testAutoloadValidPHPExcelClass()
{
$className = 'PHPExcel_IOFactory';
$result = PHPExcel_Autoloader::Load($className);
// Check that class has been loaded
$this->assertTrue(class_exists($className));
}
public function testAutoloadInstantiateSuccess()
{
$result = new PHPExcel_Calculation_Function(1,2,3);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
}
<?php
class AutoloaderTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testAutoloaderNonPHPExcelClass()
{
$className = 'InvalidClass';
$result = PHPExcel_Autoloader::Load($className);
// Must return a boolean...
$this->assertTrue(is_bool($result));
// ... indicating failure
$this->assertFalse($result);
}
public function testAutoloaderInvalidPHPExcelClass()
{
$className = 'PHPExcel_Invalid_Class';
$result = PHPExcel_Autoloader::Load($className);
// Must return a boolean...
$this->assertTrue(is_bool($result));
// ... indicating failure
$this->assertFalse($result);
}
public function testAutoloadValidPHPExcelClass()
{
$className = 'PHPExcel_IOFactory';
$result = PHPExcel_Autoloader::Load($className);
// Check that class has been loaded
$this->assertTrue(class_exists($className));
}
public function testAutoloadInstantiateSuccess()
{
$result = new PHPExcel_Calculation_Function(1,2,3);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
}
}

View File

@ -1,464 +1,464 @@
<?php
require_once 'testDataFileIterator.php';
class DateTimeTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerDATE
*/
public function testDATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data');
}
public function testDATEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
}
public function testDATEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
}
public function testDATEwith1904Calendar()
{
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1918,11,11);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result,5428);
}
public function testDATEwith1904CalendarError()
{
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1901,1,31);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result,'#NUM!');
}
/**
* @dataProvider providerDATEVALUE
*/
public function testDATEVALUE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATEVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data');
}
public function testDATEVALUEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
}
public function testDATEVALUEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
}
/**
* @dataProvider providerYEAR
*/
public function testYEAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerYEAR()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data');
}
/**
* @dataProvider providerMONTH
*/
public function testMONTH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMONTH()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data');
}
/**
* @dataProvider providerWEEKNUM
*/
public function testWEEKNUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWEEKNUM()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data');
}
/**
* @dataProvider providerWEEKDAY
*/
public function testWEEKDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWEEKDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data');
}
/**
* @dataProvider providerDAY
*/
public function testDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data');
}
/**
* @dataProvider providerTIME
*/
public function testTIME()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTIME()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data');
}
public function testTIMEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(27020, $result, NULL, 1E-8);
}
public function testTIMEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('H:i:s'),'07:30:20');
}
/**
* @dataProvider providerTIMEVALUE
*/
public function testTIMEVALUE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTIMEVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data');
}
public function testTIMEVALUEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(23420, $result, NULL, 1E-8);
}
public function testTIMEVALUEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('H:i:s'),'07:30:20');
}
/**
* @dataProvider providerHOUR
*/
public function testHOUR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerHOUR()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data');
}
/**
* @dataProvider providerMINUTE
*/
public function testMINUTE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMINUTE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data');
}
/**
* @dataProvider providerSECOND
*/
public function testSECOND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerSECOND()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data');
}
/**
* @dataProvider providerNETWORKDAYS
*/
public function testNETWORKDAYS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNETWORKDAYS()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data');
}
/**
* @dataProvider providerWORKDAY
*/
public function testWORKDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWORKDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data');
}
/**
* @dataProvider providerEDATE
*/
public function testEDATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEDATE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data');
}
public function testEDATEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1324857600, $result, NULL, 1E-8);
}
public function testEDATEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'26-Dec-2011');
}
/**
* @dataProvider providerEOMONTH
*/
public function testEOMONTH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEOMONTH()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data');
}
public function testEOMONTHtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1325289600, $result, NULL, 1E-8);
}
public function testEOMONTHtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Dec-2011');
}
/**
* @dataProvider providerDATEDIF
*/
public function testDATEDIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATEDIF()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data');
}
/**
* @dataProvider providerDAYS360
*/
public function testDAYS360()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDAYS360()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data');
}
/**
* @dataProvider providerYEARFRAC
*/
public function testYEARFRAC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerYEARFRAC()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
}
}
<?php
require_once 'testDataFileIterator.php';
class DateTimeTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerDATE
*/
public function testDATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data');
}
public function testDATEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
}
public function testDATEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
}
public function testDATEwith1904Calendar()
{
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1918,11,11);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result,5428);
}
public function testDATEwith1904CalendarError()
{
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1901,1,31);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result,'#NUM!');
}
/**
* @dataProvider providerDATEVALUE
*/
public function testDATEVALUE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATEVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data');
}
public function testDATEVALUEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
}
public function testDATEVALUEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
}
/**
* @dataProvider providerYEAR
*/
public function testYEAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerYEAR()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data');
}
/**
* @dataProvider providerMONTH
*/
public function testMONTH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMONTH()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data');
}
/**
* @dataProvider providerWEEKNUM
*/
public function testWEEKNUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWEEKNUM()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data');
}
/**
* @dataProvider providerWEEKDAY
*/
public function testWEEKDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWEEKDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data');
}
/**
* @dataProvider providerDAY
*/
public function testDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data');
}
/**
* @dataProvider providerTIME
*/
public function testTIME()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTIME()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data');
}
public function testTIMEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(27020, $result, NULL, 1E-8);
}
public function testTIMEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('H:i:s'),'07:30:20');
}
/**
* @dataProvider providerTIMEVALUE
*/
public function testTIMEVALUE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTIMEVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data');
}
public function testTIMEVALUEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(23420, $result, NULL, 1E-8);
}
public function testTIMEVALUEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('H:i:s'),'07:30:20');
}
/**
* @dataProvider providerHOUR
*/
public function testHOUR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerHOUR()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data');
}
/**
* @dataProvider providerMINUTE
*/
public function testMINUTE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMINUTE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data');
}
/**
* @dataProvider providerSECOND
*/
public function testSECOND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerSECOND()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data');
}
/**
* @dataProvider providerNETWORKDAYS
*/
public function testNETWORKDAYS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNETWORKDAYS()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data');
}
/**
* @dataProvider providerWORKDAY
*/
public function testWORKDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWORKDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data');
}
/**
* @dataProvider providerEDATE
*/
public function testEDATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEDATE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data');
}
public function testEDATEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1324857600, $result, NULL, 1E-8);
}
public function testEDATEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'26-Dec-2011');
}
/**
* @dataProvider providerEOMONTH
*/
public function testEOMONTH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEOMONTH()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data');
}
public function testEOMONTHtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1325289600, $result, NULL, 1E-8);
}
public function testEOMONTHtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Dec-2011');
}
/**
* @dataProvider providerDATEDIF
*/
public function testDATEDIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATEDIF()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data');
}
/**
* @dataProvider providerDAYS360
*/
public function testDAYS360()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDAYS360()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data');
}
/**
* @dataProvider providerYEARFRAC
*/
public function testYEARFRAC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerYEARFRAC()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
}
}

View File

@ -1,274 +1,274 @@
<?php
require_once 'testDataFileIterator.php';
class FunctionsTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testDUMMY()
{
$result = PHPExcel_Calculation_Functions::DUMMY();
$this->assertEquals('#Not Yet Implemented', $result);
}
public function testDIV0()
{
$result = PHPExcel_Calculation_Functions::DIV0();
$this->assertEquals('#DIV/0!', $result);
}
public function testNA()
{
$result = PHPExcel_Calculation_Functions::NA();
$this->assertEquals('#N/A', $result);
}
public function testNaN()
{
$result = PHPExcel_Calculation_Functions::NaN();
$this->assertEquals('#NUM!', $result);
}
public function testNAME()
{
$result = PHPExcel_Calculation_Functions::NAME();
$this->assertEquals('#NAME?', $result);
}
public function testREF()
{
$result = PHPExcel_Calculation_Functions::REF();
$this->assertEquals('#REF!', $result);
}
public function testNULL()
{
$result = PHPExcel_Calculation_Functions::NULL();
$this->assertEquals('#NULL!', $result);
}
public function testVALUE()
{
$result = PHPExcel_Calculation_Functions::VALUE();
$this->assertEquals('#VALUE!', $result);
}
/**
* @dataProvider providerIS_BLANK
*/
public function testIS_BLANK()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_BLANK()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
}
/**
* @dataProvider providerIS_ERR
*/
public function testIS_ERR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ERR()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
}
/**
* @dataProvider providerIS_ERROR
*/
public function testIS_ERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
}
/**
* @dataProvider providerERROR_TYPE
*/
public function testERROR_TYPE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerERROR_TYPE()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
}
/**
* @dataProvider providerIS_LOGICAL
*/
public function testIS_LOGICAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_LOGICAL()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
}
/**
* @dataProvider providerIS_NA
*/
public function testIS_NA()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NA()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
}
/**
* @dataProvider providerIS_NUMBER
*/
public function testIS_NUMBER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NUMBER()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
}
/**
* @dataProvider providerIS_TEXT
*/
public function testIS_TEXT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_TEXT()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
}
/**
* @dataProvider providerIS_NONTEXT
*/
public function testIS_NONTEXT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NONTEXT()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
}
/**
* @dataProvider providerIS_EVEN
*/
public function testIS_EVEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_EVEN()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
}
/**
* @dataProvider providerIS_ODD
*/
public function testIS_ODD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ODD()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
}
/**
* @dataProvider providerTYPE
*/
public function testTYPE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTYPE()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
}
/**
* @dataProvider providerN
*/
public function testN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerN()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
}
}
<?php
require_once 'testDataFileIterator.php';
class FunctionsTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testDUMMY()
{
$result = PHPExcel_Calculation_Functions::DUMMY();
$this->assertEquals('#Not Yet Implemented', $result);
}
public function testDIV0()
{
$result = PHPExcel_Calculation_Functions::DIV0();
$this->assertEquals('#DIV/0!', $result);
}
public function testNA()
{
$result = PHPExcel_Calculation_Functions::NA();
$this->assertEquals('#N/A', $result);
}
public function testNaN()
{
$result = PHPExcel_Calculation_Functions::NaN();
$this->assertEquals('#NUM!', $result);
}
public function testNAME()
{
$result = PHPExcel_Calculation_Functions::NAME();
$this->assertEquals('#NAME?', $result);
}
public function testREF()
{
$result = PHPExcel_Calculation_Functions::REF();
$this->assertEquals('#REF!', $result);
}
public function testNULL()
{
$result = PHPExcel_Calculation_Functions::NULL();
$this->assertEquals('#NULL!', $result);
}
public function testVALUE()
{
$result = PHPExcel_Calculation_Functions::VALUE();
$this->assertEquals('#VALUE!', $result);
}
/**
* @dataProvider providerIS_BLANK
*/
public function testIS_BLANK()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_BLANK()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
}
/**
* @dataProvider providerIS_ERR
*/
public function testIS_ERR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ERR()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
}
/**
* @dataProvider providerIS_ERROR
*/
public function testIS_ERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
}
/**
* @dataProvider providerERROR_TYPE
*/
public function testERROR_TYPE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerERROR_TYPE()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
}
/**
* @dataProvider providerIS_LOGICAL
*/
public function testIS_LOGICAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_LOGICAL()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
}
/**
* @dataProvider providerIS_NA
*/
public function testIS_NA()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NA()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
}
/**
* @dataProvider providerIS_NUMBER
*/
public function testIS_NUMBER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NUMBER()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
}
/**
* @dataProvider providerIS_TEXT
*/
public function testIS_TEXT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_TEXT()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
}
/**
* @dataProvider providerIS_NONTEXT
*/
public function testIS_NONTEXT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NONTEXT()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
}
/**
* @dataProvider providerIS_EVEN
*/
public function testIS_EVEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_EVEN()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
}
/**
* @dataProvider providerIS_ODD
*/
public function testIS_ODD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ODD()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
}
/**
* @dataProvider providerTYPE
*/
public function testTYPE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTYPE()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
}
/**
* @dataProvider providerN
*/
public function testN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerN()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
}
}

View File

@ -1,110 +1,110 @@
<?php
require_once 'testDataFileIterator.php';
class LogicalTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testTRUE()
{
$result = PHPExcel_Calculation_Logical::TRUE();
$this->assertEquals(TRUE, $result);
}
public function testFALSE()
{
$result = PHPExcel_Calculation_Logical::FALSE();
$this->assertEquals(FALSE, $result);
}
/**
* @dataProvider providerAND
*/
public function testAND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerAND()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
}
/**
* @dataProvider providerOR
*/
public function testOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerOR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
}
/**
* @dataProvider providerNOT
*/
public function testNOT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerNOT()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
}
/**
* @dataProvider providerIF
*/
public function testIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIF()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
}
/**
* @dataProvider providerIFERROR
*/
public function testIFERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIFERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
}
}
<?php
require_once 'testDataFileIterator.php';
class LogicalTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testTRUE()
{
$result = PHPExcel_Calculation_Logical::TRUE();
$this->assertEquals(TRUE, $result);
}
public function testFALSE()
{
$result = PHPExcel_Calculation_Logical::FALSE();
$this->assertEquals(FALSE, $result);
}
/**
* @dataProvider providerAND
*/
public function testAND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerAND()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
}
/**
* @dataProvider providerOR
*/
public function testOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerOR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
}
/**
* @dataProvider providerNOT
*/
public function testNOT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerNOT()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
}
/**
* @dataProvider providerIF
*/
public function testIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIF()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
}
/**
* @dataProvider providerIFERROR
*/
public function testIFERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIFERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
}
}

View File

@ -1,484 +1,484 @@
<?php
require_once 'testDataFileIterator.php';
class MathTrigTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerATAN2
*/
public function testATAN2()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerATAN2()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data');
}
/**
* @dataProvider providerCEILING
*/
public function testCEILING()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerCEILING()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data');
}
/**
* @dataProvider providerCOMBIN
*/
public function testCOMBIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerCOMBIN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data');
}
/**
* @dataProvider providerEVEN
*/
public function testEVEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerEVEN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data');
}
/**
* @dataProvider providerODD
*/
public function testODD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerODD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data');
}
/**
* @dataProvider providerFACT
*/
public function testFACT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFACT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data');
}
/**
* @dataProvider providerFACTDOUBLE
*/
public function testFACTDOUBLE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFACTDOUBLE()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data');
}
/**
* @dataProvider providerFLOOR
*/
public function testFLOOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFLOOR()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data');
}
/**
* @dataProvider providerGCD
*/
public function testGCD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerGCD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data');
}
/**
* @dataProvider providerLCM
*/
public function testLCM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerLCM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data');
}
/**
* @dataProvider providerINT
*/
public function testINT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerINT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data');
}
/**
* @dataProvider providerSIGN
*/
public function testSIGN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSIGN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data');
}
/**
* @dataProvider providerPOWER
*/
public function testPOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerPOWER()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data');
}
/**
* @dataProvider providerLOG
*/
public function testLOG()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerLOG()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data');
}
/**
* @dataProvider providerMOD
*/
public function testMOD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMOD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data');
}
/**
* @dataProvider providerMDETERM
*/
public function testMDETERM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMDETERM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data');
}
/**
* @dataProvider providerMINVERSE
*/
public function testMINVERSE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMINVERSE()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data');
}
/**
* @dataProvider providerMMULT
*/
public function testMMULT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMMULT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data');
}
/**
* @dataProvider providerMULTINOMIAL
*/
public function testMULTINOMIAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMULTINOMIAL()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data');
}
/**
* @dataProvider providerMROUND
*/
public function testMROUND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMROUND()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data');
}
/**
* @dataProvider providerPRODUCT
*/
public function testPRODUCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerPRODUCT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data');
}
/**
* @dataProvider providerQUOTIENT
*/
public function testQUOTIENT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerQUOTIENT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data');
}
/**
* @dataProvider providerROUNDUP
*/
public function testROUNDUP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerROUNDUP()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data');
}
/**
* @dataProvider providerROUNDDOWN
*/
public function testROUNDDOWN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerROUNDDOWN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data');
}
/**
* @dataProvider providerSERIESSUM
*/
public function testSERIESSUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSERIESSUM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data');
}
/**
* @dataProvider providerSUMSQ
*/
public function testSUMSQ()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSUMSQ()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data');
}
/**
* @dataProvider providerTRUNC
*/
public function testTRUNC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerTRUNC()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data');
}
/**
* @dataProvider providerROMAN
*/
public function testROMAN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerROMAN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data');
}
/**
* @dataProvider providerSQRTPI
*/
public function testSQRTPI()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSQRTPI()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data');
}
}
<?php
require_once 'testDataFileIterator.php';
class MathTrigTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerATAN2
*/
public function testATAN2()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerATAN2()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data');
}
/**
* @dataProvider providerCEILING
*/
public function testCEILING()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerCEILING()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data');
}
/**
* @dataProvider providerCOMBIN
*/
public function testCOMBIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerCOMBIN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data');
}
/**
* @dataProvider providerEVEN
*/
public function testEVEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerEVEN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data');
}
/**
* @dataProvider providerODD
*/
public function testODD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerODD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data');
}
/**
* @dataProvider providerFACT
*/
public function testFACT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFACT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data');
}
/**
* @dataProvider providerFACTDOUBLE
*/
public function testFACTDOUBLE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFACTDOUBLE()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data');
}
/**
* @dataProvider providerFLOOR
*/
public function testFLOOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFLOOR()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data');
}
/**
* @dataProvider providerGCD
*/
public function testGCD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerGCD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data');
}
/**
* @dataProvider providerLCM
*/
public function testLCM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerLCM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data');
}
/**
* @dataProvider providerINT
*/
public function testINT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerINT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data');
}
/**
* @dataProvider providerSIGN
*/
public function testSIGN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSIGN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data');
}
/**
* @dataProvider providerPOWER
*/
public function testPOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerPOWER()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data');
}
/**
* @dataProvider providerLOG
*/
public function testLOG()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerLOG()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data');
}
/**
* @dataProvider providerMOD
*/
public function testMOD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMOD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data');
}
/**
* @dataProvider providerMDETERM
*/
public function testMDETERM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMDETERM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data');
}
/**
* @dataProvider providerMINVERSE
*/
public function testMINVERSE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMINVERSE()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data');
}
/**
* @dataProvider providerMMULT
*/
public function testMMULT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMMULT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data');
}
/**
* @dataProvider providerMULTINOMIAL
*/
public function testMULTINOMIAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMULTINOMIAL()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data');
}
/**
* @dataProvider providerMROUND
*/
public function testMROUND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMROUND()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data');
}
/**
* @dataProvider providerPRODUCT
*/
public function testPRODUCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerPRODUCT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data');
}
/**
* @dataProvider providerQUOTIENT
*/
public function testQUOTIENT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerQUOTIENT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data');
}
/**
* @dataProvider providerROUNDUP
*/
public function testROUNDUP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerROUNDUP()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data');
}
/**
* @dataProvider providerROUNDDOWN
*/
public function testROUNDDOWN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerROUNDDOWN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data');
}
/**
* @dataProvider providerSERIESSUM
*/
public function testSERIESSUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSERIESSUM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data');
}
/**
* @dataProvider providerSUMSQ
*/
public function testSUMSQ()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSUMSQ()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data');
}
/**
* @dataProvider providerTRUNC
*/
public function testTRUNC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerTRUNC()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data');
}
/**
* @dataProvider providerROMAN
*/
public function testROMAN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerROMAN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data');
}
/**
* @dataProvider providerSQRTPI
*/
public function testSQRTPI()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSQRTPI()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data');
}
}

View File

@ -1,343 +1,343 @@
<?php
require_once 'testDataFileIterator.php';
class TextDataTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerCHAR
*/
public function testCHAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCHAR()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
}
/**
* @dataProvider providerCODE
*/
public function testCODE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCODE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
}
/**
* @dataProvider providerCONCATENATE
*/
public function testCONCATENATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCONCATENATE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
}
/**
* @dataProvider providerLEFT
*/
public function testLEFT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLEFT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
}
/**
* @dataProvider providerMID
*/
public function testMID()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerMID()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
}
/**
* @dataProvider providerRIGHT
*/
public function testRIGHT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerRIGHT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
}
/**
* @dataProvider providerLOWER
*/
public function testLOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLOWER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
}
/**
* @dataProvider providerUPPER
*/
public function testUPPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerUPPER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
}
/**
* @dataProvider providerPROPER
*/
public function testPROPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerPROPER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
}
/**
* @dataProvider providerLEN
*/
public function testLEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLEN()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
}
/**
* @dataProvider providerSEARCH
*/
public function testSEARCH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerSEARCH()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
}
/**
* @dataProvider providerFIND
*/
public function testFIND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFIND()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
}
/**
* @dataProvider providerREPLACE
*/
public function testREPLACE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerREPLACE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
}
/**
* @dataProvider providerSUBSTITUTE
*/
public function testSUBSTITUTE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerSUBSTITUTE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
}
/**
* @dataProvider providerTRIM
*/
public function testTRIM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerTRIM()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
}
/**
* @dataProvider providerCLEAN
*/
public function testCLEAN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCLEAN()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
}
/**
* @dataProvider providerDOLLAR
*/
public function testDOLLAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerDOLLAR()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
}
/**
* @dataProvider providerFIXED
*/
public function testFIXED()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFIXED()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
}
/**
* @dataProvider providerT
*/
public function testT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
}
/**
* @dataProvider providerTEXT
*/
public function testTEXT()
{
// Enforce decimal and thousands separator values to UK/US, and currency code to USD
call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerTEXT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
}
}
<?php
require_once 'testDataFileIterator.php';
class TextDataTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerCHAR
*/
public function testCHAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCHAR()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
}
/**
* @dataProvider providerCODE
*/
public function testCODE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCODE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
}
/**
* @dataProvider providerCONCATENATE
*/
public function testCONCATENATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCONCATENATE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
}
/**
* @dataProvider providerLEFT
*/
public function testLEFT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLEFT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
}
/**
* @dataProvider providerMID
*/
public function testMID()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerMID()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
}
/**
* @dataProvider providerRIGHT
*/
public function testRIGHT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerRIGHT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
}
/**
* @dataProvider providerLOWER
*/
public function testLOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLOWER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
}
/**
* @dataProvider providerUPPER
*/
public function testUPPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerUPPER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
}
/**
* @dataProvider providerPROPER
*/
public function testPROPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerPROPER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
}
/**
* @dataProvider providerLEN
*/
public function testLEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLEN()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
}
/**
* @dataProvider providerSEARCH
*/
public function testSEARCH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerSEARCH()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
}
/**
* @dataProvider providerFIND
*/
public function testFIND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFIND()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
}
/**
* @dataProvider providerREPLACE
*/
public function testREPLACE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerREPLACE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
}
/**
* @dataProvider providerSUBSTITUTE
*/
public function testSUBSTITUTE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerSUBSTITUTE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
}
/**
* @dataProvider providerTRIM
*/
public function testTRIM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerTRIM()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
}
/**
* @dataProvider providerCLEAN
*/
public function testCLEAN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCLEAN()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
}
/**
* @dataProvider providerDOLLAR
*/
public function testDOLLAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerDOLLAR()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
}
/**
* @dataProvider providerFIXED
*/
public function testFIXED()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFIXED()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
}
/**
* @dataProvider providerT
*/
public function testT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
}
/**
* @dataProvider providerTEXT
*/
public function testTEXT()
{
// Enforce decimal and thousands separator values to UK/US, and currency code to USD
call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerTEXT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
}
}

View File

@ -17,7 +17,7 @@
<ini name="memory_limit" value="2048M"/>
</php>
<testsuite name="PHPExcel Unit Test Suite">
<directory suffix="Test.php">./PHPExcel</directory>
<directory suffix="Test.php">./Classes</directory>
</testsuite>
<filter>
<whitelist>