function DateFieldLegacyTest::testUnknownDateType

Same name in this branch
  1. 8.9.x core/modules/datetime/tests/src/Unit/Plugin/migrate/field/d6/DateFieldLegacyTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\d6\DateFieldLegacyTest::testUnknownDateType()

Tests deprecation on calling processFieldValues().

@expectedDeprecation Deprecated in Drupal 8.6.0, to be removed before Drupal 9.0.0. Use defineValueProcessPipeline() instead. See https://www.drupal.org/node/2944598.

File

core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php, line 22

Class

DateFieldLegacyTest
Tests legacy methods on the date_field plugin.

Namespace

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

Code

public function testUnknownDateType() {
    $migration = $this->prophesize('Drupal\\migrate\\Plugin\\MigrationInterface')
        ->reveal();
    $plugin = new DateField([], '', []);
    $this->expectException(MigrateException::class);
    $this->expectExceptionMessage("Field field_date of type 'timestamp' is an unknown date field type.");
    $plugin->processFieldValues($migration, 'field_date', [
        'type' => 'timestamp',
    ]);
}

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