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 * Tests an Exception is thrown when the field type is not a known date type.
17 public function testUnknownDateType($method = 'defineValueProcessPipeline') {
18 $migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
19 $plugin = new DateField([], '', []);
21 $this->setExpectedException(MigrateException::class, "Field field_date of type 'timestamp' is an unknown date field type.");
22 $plugin->$method($migration, 'field_date', ['type' => 'timestamp']);