View source
<?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';
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
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);
}
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, 1.0E-8);
}
public function providerIS_BLANK() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
}
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, 1.0E-8);
}
public function providerIS_ERR() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
}
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, 1.0E-8);
}
public function providerIS_ERROR() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
}
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, 1.0E-8);
}
public function providerERROR_TYPE() {
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
}
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, 1.0E-8);
}
public function providerIS_LOGICAL() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
}
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, 1.0E-8);
}
public function providerIS_NA() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
}
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, 1.0E-8);
}
public function providerIS_NUMBER() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
}
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, 1.0E-8);
}
public function providerIS_TEXT() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
}
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, 1.0E-8);
}
public function providerIS_NONTEXT() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
}
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, 1.0E-8);
}
public function providerIS_EVEN() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
}
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, 1.0E-8);
}
public function providerIS_ODD() {
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
}
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, 1.0E-8);
}
public function providerTYPE() {
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
}
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, 1.0E-8);
}
public function providerN() {
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
}
}