Unit tests

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@89039 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2012-04-09 21:17:34 +00:00
parent 97a7f80f68
commit b1b4c77893
1 changed files with 80 additions and 0 deletions

View File

@ -399,6 +399,70 @@ class FinancialTest extends PHPUnit_Framework_TestCase
return new testDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data'); return new testDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data');
} }
/**
* @dataProvider providerMIRR
*/
public function testMIRR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','MIRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMIRR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/MIRR.data');
}
/**
* @dataProvider providerNOMINAL
*/
public function testNOMINAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NOMINAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNOMINAL()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/NOMINAL.data');
}
/**
* @dataProvider providerNPER
*/
public function testNPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNPER()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/NPER.data');
}
/**
* @dataProvider providerNPV
*/
public function testNPV()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPV'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNPV()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/NPV.data');
}
/** /**
* @dataProvider providerRATE * @dataProvider providerRATE
*/ */
@ -415,4 +479,20 @@ class FinancialTest extends PHPUnit_Framework_TestCase
return new testDataFileIterator('rawTestData/Calculation/Financial/RATE.data'); return new testDataFileIterator('rawTestData/Calculation/Financial/RATE.data');
} }
/**
* @dataProvider providerXIRR
*/
public function testXIRR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','XIRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerXIRR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/XIRR.data');
}
} }