4require_once
'testDataFileIterator.php';
11 if (!
defined(
'PHPEXCEL_ROOT')) {
12 define(
'PHPEXCEL_ROOT', APPLICATION_PATH .
'/');
14 require_once(PHPEXCEL_ROOT .
'PHPExcel/Autoloader.php');
22 $args = func_get_args();
23 $expectedResult = array_pop($args);
24 $result = call_user_func_array(array(
'PHPExcel_Cell',
'columnIndexFromString'),$args);
25 $this->assertEquals($expectedResult,
$result);
35 $cellAddress =
'ABCD';
37 $result = call_user_func(array(
'PHPExcel_Cell',
'columnIndexFromString'),$cellAddress);
39 $this->assertEquals($e->getMessage(),
'Column string index can not be longer than 3 characters');
42 $this->fail(
'An expected exception has not been raised.');
49 $result = call_user_func(array(
'PHPExcel_Cell',
'columnIndexFromString'),$cellAddress);
51 $this->assertEquals($e->getMessage(),
'Column string index can not be empty');
54 $this->fail(
'An expected exception has not been raised.');
62 $args = func_get_args();
63 $expectedResult = array_pop($args);
64 $result = call_user_func_array(array(
'PHPExcel_Cell',
'stringFromColumnIndex'),$args);
65 $this->assertEquals($expectedResult,
$result);
78 $args = func_get_args();
79 $expectedResult = array_pop($args);
80 $result = call_user_func_array(array(
'PHPExcel_Cell',
'coordinateFromString'),$args);
81 $this->assertEquals($expectedResult,
$result);
91 $cellAddress =
'A1:AI2012';
93 $result = call_user_func(array(
'PHPExcel_Cell',
'coordinateFromString'),$cellAddress);
95 $this->assertEquals($e->getMessage(),
'Cell coordinate string can not be a range of cells');
98 $this->fail(
'An expected exception has not been raised.');
105 $result = call_user_func(array(
'PHPExcel_Cell',
'coordinateFromString'),$cellAddress);
107 $this->assertEquals($e->getMessage(),
'Cell coordinate can not be zero-length string');
110 $this->fail(
'An expected exception has not been raised.');
117 $result = call_user_func(array(
'PHPExcel_Cell',
'coordinateFromString'),$cellAddress);
119 $this->assertEquals($e->getMessage(),
'Invalid cell coordinate '.$cellAddress);
122 $this->fail(
'An expected exception has not been raised.');
130 $args = func_get_args();
131 $expectedResult = array_pop($args);
132 $result = call_user_func_array(array(
'PHPExcel_Cell',
'absoluteCoordinate'),$args);
133 $this->assertEquals($expectedResult,
$result);
143 $cellAddress =
'A1:AI2012';
145 $result = call_user_func(array(
'PHPExcel_Cell',
'absoluteCoordinate'),$cellAddress);
147 $this->assertEquals($e->getMessage(),
'Cell coordinate string can not be a range of cells');
150 $this->fail(
'An expected exception has not been raised.');
158 $args = func_get_args();
159 $expectedResult = array_pop($args);
160 $result = call_user_func_array(array(
'PHPExcel_Cell',
'absoluteReference'),$args);
161 $this->assertEquals($expectedResult,
$result);
171 $cellAddress =
'A1:AI2012';
173 $result = call_user_func(array(
'PHPExcel_Cell',
'absoluteReference'),$cellAddress);
175 $this->assertEquals($e->getMessage(),
'Cell coordinate string can not be a range of cells');
178 $this->fail(
'An expected exception has not been raised.');
186 $args = func_get_args();
187 $expectedResult = array_pop($args);
188 $result = call_user_func_array(array(
'PHPExcel_Cell',
'splitRange'),$args);
190 if (!is_array($expectedResult[
$key])) {
191 $this->assertEquals($expectedResult[
$key], $split[0]);
193 $this->assertEquals($expectedResult[
$key], $split);
208 $args = func_get_args();
209 $expectedResult = array_pop($args);
210 $result = call_user_func_array(array(
'PHPExcel_Cell',
'buildRange'),$args);
211 $this->assertEquals($expectedResult,
$result);
223 $result = call_user_func(array(
'PHPExcel_Cell',
'buildRange'),$cellRange);
225 $this->assertEquals($e->getMessage(),
'Range does not contain any information');
228 $this->fail(
'An expected exception has not been raised.');
236 $args = func_get_args();
237 $expectedResult = array_pop($args);
238 $result = call_user_func_array(array(
'PHPExcel_Cell',
'rangeBoundaries'),$args);
239 $this->assertEquals($expectedResult,
$result);
252 $args = func_get_args();
253 $expectedResult = array_pop($args);
254 $result = call_user_func_array(array(
'PHPExcel_Cell',
'rangeDimension'),$args);
255 $this->assertEquals($expectedResult,
$result);
268 $args = func_get_args();
269 $expectedResult = array_pop($args);
270 $result = call_user_func_array(array(
'PHPExcel_Cell',
'getRangeBoundaries'),$args);
271 $this->assertEquals($expectedResult,
$result);
284 $args = func_get_args();
285 $expectedResult = array_pop($args);
286 $result = call_user_func_array(array(
'PHPExcel_Cell',
'extractAllCellReferencesInRange'),$args);
287 $this->assertEquals($expectedResult,
$result);
An exception for terminatinating execution or to throw for unit testing.
testSplitRange()
@dataProvider providerSplitRange
providerExtractAllCellReferencesInRange()
testBuildRange()
@dataProvider providerBuildRange
testColumnIndexFromStringTooShort()
testCoordinateFromString()
@dataProvider providerCoordinates
testRangeDimension()
@dataProvider providerRangeDimension
testAbsoluteReferenceFromString()
@dataProvider providerAbsoluteReferences
testColumnIndexFromString()
@dataProvider providerColumnString
testExtractAllCellReferencesInRange()
@dataProvider providerExtractAllCellReferencesInRange
providerRangeBoundaries()
testAbsoluteCoordinateFromStringWithRangeAddress()
testCoordinateFromStringWithEmptyAddress()
providerGetRangeBoundaries()
testAbsoluteCoordinateFromString()
@dataProvider providerAbsoluteCoordinates
testGetRangeBoundaries()
@dataProvider providerGetRangeBoundaries
providerAbsoluteCoordinates()
testCoordinateFromStringWithRangeAddress()
testColumnIndexFromStringTooLong()
testStringFromColumnIndex()
@dataProvider providerColumnIndex
providerAbsoluteReferences()
testRangeBoundaries()
@dataProvider providerRangeBoundaries
testAbsoluteReferenceFromStringWithRangeAddress()
testCoordinateFromStringWithInvalidAddress()
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'