DateFieldLegacyTest.php in Drupal 8
File
core/modules/datetime/tests/src/Unit/Plugin/migrate/field/DateFieldLegacyTest.php
View source
<?php
namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field;
use Drupal\datetime\Plugin\migrate\field\DateField;
use Drupal\migrate\MigrateException;
use Drupal\Tests\UnitTestCase;
class DateFieldLegacyTest extends UnitTestCase {
public function testUnknownDateType() {
$migration = $this
->prophesize('Drupal\\migrate\\Plugin\\MigrationInterface')
->reveal();
$plugin = new DateField([], '', []);
$this
->expectException(MigrateException::class);
$this
->expectExceptionMessage("Field field_date of type 'timestamp' is an unknown date field type.");
$plugin
->processFieldValues($migration, 'field_date', [
'type' => 'timestamp',
]);
}
}