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