Unit tests

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@89020 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2012-04-09 11:27:21 +00:00
parent 954208b56d
commit a807cc14ca

View File

@ -287,6 +287,118 @@ class FinancialTest extends PHPUnit_Framework_TestCase
return new testDataFileIterator('rawTestData/Calculation/Financial/DOLLARFR.data'); return new testDataFileIterator('rawTestData/Calculation/Financial/DOLLARFR.data');
} }
/**
* @dataProvider providerEFFECT
*/
public function testEFFECT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','EFFECT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEFFECT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/EFFECT.data');
}
/**
* @dataProvider providerFV
*/
public function testFV()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FV'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerFV()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/FV.data');
}
/**
* @dataProvider providerFVSCHEDULE
*/
public function testFVSCHEDULE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FVSCHEDULE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerFVSCHEDULE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/FVSCHEDULE.data');
}
/**
* @dataProvider providerINTRATE
*/
public function testINTRATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','INTRATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerINTRATE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/INTRATE.data');
}
/**
* @dataProvider providerIPMT
*/
public function testIPMT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIPMT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/IPMT.data');
}
/**
* @dataProvider providerIRR
*/
public function testIRR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIRR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/IRR.data');
}
/**
* @dataProvider providerISPMT
*/
public function testISPMT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ISPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerISPMT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data');
}
/** /**
* @dataProvider providerRATE * @dataProvider providerRATE
*/ */