Unit tests

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@88320 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2012-03-24 23:11:57 +00:00
parent 30fb3fba20
commit c98eaf18f7
1 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,50 @@
<?php
require_once 'testDataFileIterator.php';
class FinancialTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerACCRINT
*/
public function testACCRINT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerACCRINT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/ACCRINT.data');
}
/**
* @dataProvider providerACCRINTM
*/
public function testACCRINTM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINTM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerACCRINTM()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/ACCRINTM.data');
}
}