function DateFieldTest::providerTestDefineValueProcessPipeline

Same name in other branches
  1. 9 core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\DateFieldTest::providerTestDefineValueProcessPipeline()
  2. 8.9.x core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\DateFieldTest::providerTestDefineValueProcessPipeline()
  3. 11.x core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\DateFieldTest::providerTestDefineValueProcessPipeline()

Provides data for testDefineValueProcessPipeline().

File

core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php, line 69

Class

DateFieldTest
Provides unit tests for the DateField Plugin.

Namespace

Drupal\Tests\datetime\Unit\Plugin\migrate\field

Code

public static function providerTestDefineValueProcessPipeline() {
    return [
        [
            [
                'type' => 'date',
            ],
            'Y-m-d\\TH:i:s',
            'Y-m-d\\TH:i:s',
        ],
        [
            [
                'type' => 'datestamp',
            ],
            'U',
            'U',
        ],
        [
            [
                'type' => 'datetime',
            ],
            'Y-m-d H:i:s',
            'Y-m-d\\TH:i:s',
        ],
        [
            [
                'type' => 'datetime',
                'field_definition' => [
                    'data' => serialize([
                        'settings' => [
                            'granularity' => [
                                'hour' => 0,
                                'minute' => 0,
                                'second' => 0,
                            ],
                        ],
                    ]),
                ],
            ],
            'Y-m-d H:i:s',
            'Y-m-d',
        ],
        [
            [
                'type' => 'date',
                'field_definition' => [
                    'data' => serialize([
                        'settings' => [
                            'granularity' => [
                                0 => 'year',
                                1 => 'month',
                            ],
                            'todate' => '',
                        ],
                    ]),
                ],
            ],
            'Y-m-d\\TH:i:s',
            'Y-m-d',
        ],
        'datetime with a todate' => [
            [
                'type' => 'datetime',
                'field_definition' => [
                    'data' => serialize([
                        'settings' => [
                            'granularity' => [
                                'hour' => 0,
                                'minute' => 0,
                                'second' => 0,
                            ],
                            'todate' => 'optional',
                        ],
                    ]),
                ],
            ],
            'Y-m-d H:i:s',
            'Y-m-d',
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.