X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Ftests%2Fsrc%2FUnit%2Fprocess%2FStaticMapTest.php;h=1a9a61acd68a3c8115a26ed5be5a909bd9a44953;hb=4f1b9b4ab48a8498afac9e2213a02a23ccf4a06c;hp=714d5f7c193b5421a3edb42b4d353df5bd9b7f45;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php b/web/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php index 714d5f7c1..1a9a61acd 100644 --- a/web/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php +++ b/web/core/modules/migrate/tests/src/Unit/process/StaticMapTest.php @@ -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); } /**