You are here

public function DateTimeTest::testEOMONTHtoPHPObject in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/DateTimeTest.php \DateTimeTest::testEOMONTHtoPHPObject()

File

vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Calculation/DateTimeTest.php, line 405

Class

DateTimeTest

Code

public function testEOMONTHtoPHPObject() {
  PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
  $result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26', -1);
  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('d-M-Y'), '31-Dec-2011');
}