You are here

public function DateFieldLegacyTest::testUnknownDateType in Drupal 8

Same name in this branch
  1. 8 core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\DateFieldLegacyTest::testUnknownDateType()
  2. 8 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',
  ]);
}