You are here

public function DateFieldTest::testDefineValueProcessPipelineException in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldTest.php \Drupal\Tests\datetime\Unit\Plugin\migrate\field\DateFieldTest::testDefineValueProcessPipelineException()

Tests invalid date types throw an exception.

@covers ::defineValueProcessPipeline

File

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

Class

DateFieldTest
Provides unit tests for the DateField Plugin.

Namespace

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

Code

public function testDefineValueProcessPipelineException() {
  $migration = $this
    ->createMock('Drupal\\migrate\\Plugin\\MigrationInterface');
  $plugin = new DateField([], '', []);
  $this
    ->expectException(MigrateException::class);
  $plugin
    ->defineValueProcessPipeline($migration, 'field_date', [
    'type' => 'totoro',
  ]);
}