Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / datetime / tests / src / Unit / Plugin / migrate / field / d6 / DateFieldTest.php
1 <?php
2
3 namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field\d6;
4
5 use Drupal\datetime\Plugin\migrate\field\d6\DateField;
6 use Drupal\migrate\MigrateException;
7 use Drupal\Tests\UnitTestCase;
8
9 /**
10  * @group migrate
11  * @group legacy
12  */
13 class DateFieldTest extends UnitTestCase {
14
15   /**
16    * @var \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
17    */
18   protected $plugin;
19
20   /**
21    * @var \Drupal\migrate\Plugin\MigrationInterface
22    */
23   protected $migration;
24
25   /**
26    * Tests an Exception is thrown when the field type is not a known date type.
27    */
28   public function testUnknownDateType() {
29     $this->migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
30     $this->plugin = new DateField([], '', []);
31
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']);
34   }
35
36 }