500eac2307bb4ccfcc6400e6fa8486a83a8f2c3b
[yaffs-website] / web / core / modules / datetime / tests / src / Unit / Plugin / migrate / field / DateFieldTest.php
1 <?php
2
3 namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field;
4
5 use Drupal\datetime\Plugin\migrate\field\DateField;
6 use Drupal\migrate\MigrateException;
7 use Drupal\Tests\UnitTestCase;
8
9 /**
10  * @group migrate
11  */
12 class DateFieldTest extends UnitTestCase {
13
14   /**
15    * Tests an Exception is thrown when the field type is not a known date type.
16    */
17   public function testUnknownDateType($method = 'defineValueProcessPipeline') {
18     $migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
19     $plugin = new DateField([], '', []);
20
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']);
23   }
24
25 }