4 require_once
'testDataFileIterator.php';
13 define(
'PHPEXCEL_ROOT', APPLICATION_PATH .
'/');
15 require_once(PHPEXCEL_ROOT .
'PHPExcel/Autoloader.php');
25 $args = func_get_args();
26 $expectedResult = array_pop($args);
27 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'DATE'),$args);
28 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
41 $this->assertEquals(1327968000,
$result, NULL, 1E-8);
50 $this->assertTrue(is_object(
$result));
52 $this->assertTrue(is_a(
$result,
'DateTime'));
54 $this->assertEquals(
$result->format(
'd-M-Y'),
'31-Jan-2012');
62 $this->assertEquals(
$result,5428);
70 $this->assertEquals(
$result,
'#NUM!');
78 $args = func_get_args();
79 $expectedResult = array_pop($args);
80 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'DATEVALUE'),$args);
81 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
94 $this->assertEquals(1327968000,
$result, NULL, 1E-8);
103 $this->assertTrue(is_object(
$result));
105 $this->assertTrue(is_a(
$result,
'DateTime'));
107 $this->assertEquals(
$result->format(
'd-M-Y'),
'31-Jan-2012');
115 $args = func_get_args();
116 $expectedResult = array_pop($args);
117 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'YEAR'),$args);
118 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
131 $args = func_get_args();
132 $expectedResult = array_pop($args);
133 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'MONTHOFYEAR'),$args);
134 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
147 $args = func_get_args();
148 $expectedResult = array_pop($args);
149 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'WEEKOFYEAR'),$args);
150 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
163 $args = func_get_args();
164 $expectedResult = array_pop($args);
165 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'DAYOFWEEK'),$args);
166 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
179 $args = func_get_args();
180 $expectedResult = array_pop($args);
181 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'DAYOFMONTH'),$args);
182 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
195 $args = func_get_args();
196 $expectedResult = array_pop($args);
197 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'TIME'),$args);
198 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
211 $this->assertEquals(27020,
$result, NULL, 1E-8);
220 $this->assertTrue(is_object(
$result));
222 $this->assertTrue(is_a(
$result,
'DateTime'));
224 $this->assertEquals(
$result->format(
'H:i:s'),
'07:30:20');
232 $args = func_get_args();
233 $expectedResult = array_pop($args);
234 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'TIMEVALUE'),$args);
235 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
248 $this->assertEquals(23420,
$result, NULL, 1E-8);
257 $this->assertTrue(is_object(
$result));
259 $this->assertTrue(is_a(
$result,
'DateTime'));
261 $this->assertEquals(
$result->format(
'H:i:s'),
'07:30:20');
269 $args = func_get_args();
270 $expectedResult = array_pop($args);
271 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'HOUROFDAY'),$args);
272 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
285 $args = func_get_args();
286 $expectedResult = array_pop($args);
287 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'MINUTEOFHOUR'),$args);
288 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
301 $args = func_get_args();
302 $expectedResult = array_pop($args);
303 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'SECONDOFMINUTE'),$args);
304 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
317 $args = func_get_args();
318 $expectedResult = array_pop($args);
319 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'NETWORKDAYS'),$args);
320 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
333 $args = func_get_args();
334 $expectedResult = array_pop($args);
335 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'WORKDAY'),$args);
336 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
349 $args = func_get_args();
350 $expectedResult = array_pop($args);
351 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'EDATE'),$args);
352 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
365 $this->assertEquals(1324857600,
$result, NULL, 1E-8);
374 $this->assertTrue(is_object(
$result));
376 $this->assertTrue(is_a(
$result,
'DateTime'));
378 $this->assertEquals(
$result->format(
'd-M-Y'),
'26-Dec-2011');
386 $args = func_get_args();
387 $expectedResult = array_pop($args);
388 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'EOMONTH'),$args);
389 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
402 $this->assertEquals(1325289600,
$result, NULL, 1E-8);
411 $this->assertTrue(is_object(
$result));
413 $this->assertTrue(is_a(
$result,
'DateTime'));
415 $this->assertEquals(
$result->format(
'd-M-Y'),
'31-Dec-2011');
423 $args = func_get_args();
424 $expectedResult = array_pop($args);
425 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'DATEDIF'),$args);
426 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
439 $args = func_get_args();
440 $expectedResult = array_pop($args);
441 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'DAYS360'),$args);
442 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
455 $args = func_get_args();
456 $expectedResult = array_pop($args);
457 $result = call_user_func_array(
array(
'PHPExcel_Calculation_DateTime',
'YEARFRAC'),$args);
458 $this->assertEquals($expectedResult,
$result, NULL, 1E-8);
const RETURNDATE_PHP_OBJECT
static DATE($year=0, $month=1, $day=1)
static setExcelCalendar($baseDate)
Set the Excel calendar (Windows 1900 or Mac 1904)
static TIME($hour=0, $minute=0, $second=0)
const COMPATIBILITY_EXCEL
constants
testWORKDAY()
providerWORKDAY
testDATEwith1904CalendarError()
testDATEDIF()
providerDATEDIF
testDATEVALUE()
providerDATEVALUE
testEOMONTH()
providerEOMONTH
testWEEKNUM()
providerWEEKNUM
testDATEwith1904Calendar()
testSECOND()
providerSECOND
testDAYS360()
providerDAYS360
static EDATE($dateValue=1, $adjustmentMonths=0)
EDATE.
const RETURNDATE_PHP_NUMERIC
static DATEVALUE($dateValue=1)
testDATEVALUEtoPHPObject()
static TIMEVALUE($timeValue)
static EOMONTH($dateValue=1, $adjustmentMonths=0)
EOMONTH.
Create styles array
The data for the language used.
testTIMEVALUE()
providerTIMEVALUE
testWEEKDAY()
providerWEEKDAY
static setReturnDateType($returnDateType)
testMINUTE()
providerMINUTE
testNETWORKDAYS()
providerNETWORKDAYS
const CALENDAR_WINDOWS_1900
constants
testYEARFRAC()
providerYEARFRAC
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
static setCompatibilityMode($compatibilityMode)
testTIMEVALUEtoPHPObject()