Ejemplo n.º 1
0
 /**
  * Test invalid date handling.
  *
  * @param mixed $input
  *   Input argument for DateTimePlus.
  * @param string $timezone
  *   Timezone argument for DateTimePlus.
  * @param string $format
  *   Format argument for DateTimePlus.
  * @param string $message
  *   Message to print if no errors are thrown by the invalid dates.
  *
  * @dataProvider providerTestInvalidDates
  * @expectedException \Exception
  */
 public function testInvalidDates($input, $timezone, $format, $message)
 {
     DateTimePlus::createFromFormat($format, $input, $timezone);
 }
Ejemplo n.º 2
0
 /**
  * Provides data for date tests.
  *
  * @return array
  *   An array of arrays, each containing the input parameters for
  *   DateTimePlusTest::testInvalidDateDiff().
  *
  * @see DateTimePlusTest::testInvalidDateDiff()
  */
 public function providerTestInvalidDateDiff()
 {
     return array(array('input1' => DateTimePlus::createFromFormat('U', 3600), 'input2' => '1970-01-01 00:00:00', 'absolute' => FALSE), array('input1' => DateTimePlus::createFromFormat('U', 3600), 'input2' => NULL, 'absolute' => FALSE));
 }