public function DateTimeTest::testTIMEtoPHPObject in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/DateTimeTest.php \DateTimeTest::testTIMEtoPHPObject()
File
- vendor/
phpoffice/ phpexcel/ unitTests/ Classes/ PHPExcel/ Calculation/ DateTimeTest.php, line 214
Class
Code
public function testTIMEtoPHPObject() {
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIME(7, 30, 20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this
->assertTrue(is_object($result));
// ... of the correct type
$this
->assertTrue(is_a($result, 'DateTime'));
// ... with the correct value
$this
->assertEquals($result
->format('H:i:s'), '07:30:20');
}