public function DrupalDateTimeTest::providerTestInvalidDateDiff in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php \Drupal\Tests\Core\Datetime\DrupalDateTimeTest::providerTestInvalidDateDiff()
- 9 core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php \Drupal\Tests\Core\Datetime\DrupalDateTimeTest::providerTestInvalidDateDiff()
Provides data for date tests.
Return value
array An array of arrays, each containing the input parameters for DateTimePlusTest::testInvalidDateDiff().
See also
DateTimePlusTest::testInvalidDateDiff()
File
- core/
tests/ Drupal/ Tests/ Core/ Datetime/ DrupalDateTimeTest.php, line 143
Class
- DrupalDateTimeTest
- @coversDefaultClass \Drupal\Core\Datetime\DrupalDateTime @group Datetime
Namespace
Drupal\Tests\Core\DatetimeCode
public function providerTestInvalidDateDiff() {
$settings = [
'langcode' => 'en',
];
$utc_tz = new \DateTimeZone('UTC');
return [
[
'input1' => DrupalDateTime::createFromFormat('U', 3600, $utc_tz, $settings),
'input2' => '1970-01-01 00:00:00',
'absolute' => FALSE,
],
[
'input1' => DrupalDateTime::createFromFormat('U', 3600, $utc_tz, $settings),
'input2' => NULL,
'absolute' => FALSE,
],
];
}