function DateTimeNormalizerTest::providerTestDenormalizeUserFormats
Same name in other branches
- 9 core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::providerTestDenormalizeUserFormats()
- 8.9.x core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::providerTestDenormalizeUserFormats()
- 11.x core/modules/serialization/tests/src/Unit/Normalizer/DateTimeNormalizerTest.php \Drupal\Tests\serialization\Unit\Normalizer\DateTimeNormalizerTest::providerTestDenormalizeUserFormats()
Data provider for testDenormalizeUserFormats.
Return value
array
File
-
core/
modules/ serialization/ tests/ src/ Unit/ Normalizer/ DateTimeNormalizerTest.php, line 155
Class
- DateTimeNormalizerTest
- Unit test coverage for @DataTypes implementing DateTimeInterface.
Namespace
Drupal\Tests\serialization\Unit\NormalizerCode
public static function providerTestDenormalizeUserFormats() {
$data = [];
$data['Y/m/d H:i:s P'] = [
'2016/11/06 09:02:00 +00:00',
'Y/m/d H:i:s P',
new \DateTimeImmutable('2016-11-06T09:02:00+00:00'),
];
$data['H:i:s Y/m/d P'] = [
'09:02:00 2016/11/06 +01:00',
'H:i:s Y/m/d P',
new \DateTimeImmutable('2016-11-06T09:02:00+01:00'),
];
$data['Y/m/d H:i:s'] = [
'09:02:00 2016/11/06',
'H:i:s Y/m/d',
new \DateTimeImmutable('2016-11-06T09:02:00+11:00'),
];
return $data;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.