Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / migrate / tests / src / Unit / process / StaticMapTest.php
index 714d5f7c193b5421a3edb42b4d353df5bd9b7f45..1a9a61acd68a3c8115a26ed5be5a909bd9a44953 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit\process;
 
+use Drupal\Component\Utility\Variable;
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\MigrateSkipRowException;
 use Drupal\migrate\Plugin\migrate\process\StaticMap;
@@ -27,7 +28,7 @@ class StaticMapTest extends MigrateProcessTestCase {
    */
   public function testMapWithSourceString() {
     $value = $this->plugin->transform('foo', $this->migrateExecutable, $this->row, 'destinationproperty');
-    $this->assertSame($value, ['bar' => 'baz']);
+    $this->assertSame(['bar' => 'baz'], $value);
   }
 
   /**
@@ -35,7 +36,7 @@ class StaticMapTest extends MigrateProcessTestCase {
    */
   public function testMapWithSourceList() {
     $value = $this->plugin->transform(['foo', 'bar'], $this->migrateExecutable, $this->row, 'destinationproperty');
-    $this->assertSame($value, 'baz');
+    $this->assertSame('baz', $value);
   }
 
   /**
@@ -50,7 +51,7 @@ class StaticMapTest extends MigrateProcessTestCase {
    * Tests when the source is invalid.
    */
   public function testMapwithInvalidSource() {
-    $this->setExpectedException(MigrateSkipRowException::class);
+    $this->setExpectedException(MigrateSkipRowException::class, sprintf("No static mapping found for '%s' and no default value provided for destination '%s'.", Variable::export(['bar']), 'destinationproperty'));
     $this->plugin->transform(['bar'], $this->migrateExecutable, $this->row, 'destinationproperty');
   }
 
@@ -62,7 +63,7 @@ class StaticMapTest extends MigrateProcessTestCase {
     $configuration['default_value'] = 'test';
     $this->plugin = new StaticMap($configuration, 'map', []);
     $value = $this->plugin->transform(['bar'], $this->migrateExecutable, $this->row, 'destinationproperty');
-    $this->assertSame($value, 'test');
+    $this->assertSame('test', $value);
   }
 
   /**