function FieldTypeDefaultsTest::testDefaultsException

Same name and namespace in other branches
  1. 10 core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldTypeDefaultsTest::testDefaultsException()
  2. 9 core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldTypeDefaultsTest::testDefaultsException()
  3. 8.9.x core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldTypeDefaultsTest::testDefaultsException()
  4. main core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php \Drupal\Tests\field\Unit\Plugin\migrate\process\d6\FieldTypeDefaultsTest::testDefaultsException()

Tests an exception is thrown when the input is not a date field.

@legacy-covers ::transform

File

core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldTypeDefaultsTest.php, line 54

Class

FieldTypeDefaultsTest
Tests D6 fields defaults.

Namespace

Drupal\Tests\field\Unit\Plugin\migrate\process\d6

Code

public function testDefaultsException() : void {
  $this->expectException(MigrateException::class);
  $this->expectExceptionMessage(sprintf('Failed to lookup field type %s in the static map.', var_export([], TRUE)));
  $this->plugin
    ->transform([], $this->migrateExecutable, $this->row, 'property');
}

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