public function GranularityServiceTest::includeGranularityElementDataProvider in Duration Field 8.2
Same name and namespace in other branches
- 3.0.x tests/src/Unit/Service/GranularityServiceTest.php \Drupal\Tests\duration_field\Unit\Service\GranularityServiceTest::includeGranularityElementDataProvider()
Data provider for testincludeGranularityElement().
File
- tests/
src/ Unit/ Service/ GranularityServiceTest.php, line 134
Class
- GranularityServiceTest
- @coversDefaultClass \Drupal\duration_field\Service\GranularityService @group duration_field
Namespace
Drupal\Tests\duration_field\Unit\ServiceCode
public function includeGranularityElementDataProvider() {
return [
[
[
'granularity_element' => 'y',
'granularity_string' => 'y:m:d:h:i:s',
],
TRUE,
'y correctly returned TRUE when it is supposed to be included',
],
[
[
'granularity_element' => 'y',
'granularity_string' => 'm:d:h:i:s',
],
FALSE,
'y correctly returned FALSE when it is not supposed to be included',
],
[
[
'granularity_element' => 'm',
'granularity_string' => 'y:m:d:h:i:s',
],
TRUE,
'm correctly returned TRUE when it is supposed to be included',
],
[
[
'granularity_element' => 'm',
'granularity_string' => 'y:d:h:i:s',
],
FALSE,
'm correctly returned FALSE when it is not supposed to be included',
],
[
[
'granularity_element' => 'd',
'granularity_string' => 'y:m:d:h:i:s',
],
TRUE,
'd correctly returned TRUE when it is supposed to be included',
],
[
[
'granularity_element' => 'd',
'granularity_string' => 'y:m:h:i:s',
],
FALSE,
'y correctly returned FALSE when it is not supposed to be included',
],
[
[
'granularity_element' => 'h',
'granularity_string' => 'y:m:d:h:i:s',
],
TRUE,
'h correctly returned TRUE when it is supposed to be included',
],
[
[
'granularity_element' => 'h',
'granularity_string' => 'm:d:i:s',
],
FALSE,
'h correctly returned FALSE when it is not supposed to be included',
],
[
[
'granularity_element' => 'i',
'granularity_string' => 'y:m:d:h:i:s',
],
TRUE,
'i correctly returned TRUE when it is supposed to be included',
],
[
[
'granularity_element' => 'i',
'granularity_string' => 'm:d:h:s',
],
FALSE,
'y correctly returned FALSE when it is not supposed to be included',
],
[
[
'granularity_element' => 's',
'granularity_string' => 'y:m:d:h:i:s',
],
TRUE,
's correctly returned TRUE when it is supposed to be included',
],
[
[
'granularity_element' => 'y',
'granularity_string' => 'm:d:h:i',
],
FALSE,
'y correctly returned FALSE when it is not supposed to be included',
],
];
}