public function DurationServiceTest::convertDateArrayToDurationStringDataProvider in Duration Field 8.2
Same name and namespace in other branches
- 3.0.x tests/src/Unit/Service/DurationServiceTest.php \Drupal\Tests\duration_field\Unit\Service\DurationServiceTest::convertDateArrayToDurationStringDataProvider()
Data provider for testconvertDateArrayToDurationString().
File
- tests/
src/ Unit/ Service/ DurationServiceTest.php, line 56
Class
- DurationServiceTest
- @coversDefaultClass \Drupal\duration_field\Service\DurationService @group duration_field
Namespace
Drupal\Tests\duration_field\Unit\ServiceCode
public function convertDateArrayToDurationStringDataProvider() {
return [
[
[
'y' => 1,
'm' => 2,
'd' => 3,
'h' => 4,
'i' => 5,
's' => 6,
],
'P1Y2M3DT4H5M6S',
'P1Y2M3DT4H5M6S was correctly validated',
],
[
[
'y' => 1,
'm' => 2,
'd' => 3,
],
'P1Y2M3D',
'
P1Y2M3D was correctly validated',
],
[
[
'h' => 4,
'i' => 5,
's' => 6,
],
'PT4H5M6S',
'PT4H5M6S was correctly validated',
],
[
[
'y' => 1,
'h' => 4,
],
'P1YT4H',
'P1YT4H was correctly validated',
],
[
[],
'P0M',
'empty string was correctly validated',
],
];
}