3 namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field\d6;
5 use Drupal\datetime\Plugin\migrate\field\d6\DateField;
6 use Drupal\migrate\MigrateException;
7 use Drupal\Tests\UnitTestCase;
13 class DateFieldTest extends UnitTestCase {
16 * @var \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
21 * @var \Drupal\migrate\Plugin\MigrationInterface
26 * Tests an Exception is thrown when the field type is not a known date type.
28 public function testUnknownDateType() {
29 $this->migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
30 $this->plugin = new DateField([], '', []);
32 $this->setExpectedException(MigrateException::class, "Field field_date of type 'timestamp' is an unknown date field type.");
33 $this->plugin->processFieldValues($this->migration, 'field_date', ['type' => 'timestamp']);