Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / datetime / tests / src / Unit / Plugin / migrate / field / d6 / DateFieldTest.php
index 7e6788110e900abe36b5ba581ac82b20a2e1e391..6c212aff8de1488cc2773c55911250b6f546229e 100644 (file)
@@ -4,6 +4,7 @@ namespace Drupal\Tests\datetime\Unit\Plugin\migrate\field\d6;
 
 use Drupal\datetime\Plugin\migrate\field\d6\DateField;
 use Drupal\migrate\MigrateException;
+use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -13,24 +14,29 @@ use Drupal\Tests\UnitTestCase;
 class DateFieldTest extends UnitTestCase {
 
   /**
-   * @var \Drupal\migrate_drupal\Plugin\MigrateFieldInterface
+   * @var \Drupal\migrate\Plugin\MigrationInterface
    */
-  protected $plugin;
+  protected $migration;
 
   /**
-   * @var \Drupal\migrate\Plugin\MigrationInterface
+   * {@inheritdoc}
    */
-  protected $migration;
+  protected function setUp() {
+    parent::setUp();
+    $this->migration = $this->prophesize(MigrationInterface::class)->reveal();
+  }
 
   /**
    * Tests an Exception is thrown when the field type is not a known date type.
+   *
+   * @runInSeparateProcess
+   * @expectedDeprecation DateField is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\datetime\Plugin\migrate\field\DateField instead.
    */
-  public function testUnknownDateType() {
-    $this->migration = $this->prophesize('Drupal\migrate\Plugin\MigrationInterface')->reveal();
-    $this->plugin = new DateField([], '', []);
+  public function testUnknownDateType($method = 'defineValueProcessPipeline') {
+    $plugin = new DateField([], '', []);
 
     $this->setExpectedException(MigrateException::class, "Field field_date of type 'timestamp' is an unknown date field type.");
-    $this->plugin->processFieldValues($this->migration, 'field_date', ['type' => 'timestamp']);
+    $plugin->$method($this->migration, 'field_date', ['type' => 'timestamp']);
   }
 
 }