You are here

public function DateFieldTest::providerTestDefineValueProcessPipeline in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\DateFieldTest::providerTestDefineValueProcessPipeline()
  2. 9 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 67

Class

DateFieldTest
Provides unit tests for the DateField Plugin.

Namespace

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

Code

public 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',
    ],
  ];
}