X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Ftests%2Fsrc%2FUnit%2Fprocess%2FDedupeEntityTest.php;h=6dd8795305a7cd56546fc9e97b8c8263f4a92571;hb=4f1b9b4ab48a8498afac9e2213a02a23ccf4a06c;hp=a5daa7203207b57bd124bbc12fe46b8b910b24d5;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php b/web/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php index a5daa7203..6dd879530 100644 --- a/web/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php +++ b/web/core/modules/migrate/tests/src/Unit/process/DedupeEntityTest.php @@ -2,18 +2,15 @@ namespace Drupal\Tests\migrate\Unit\process; -@trigger_error('The ' . __NAMESPACE__ . '\DedupeEntityTest is deprecated in -Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use ' . __NAMESPACE__ . '\MakeUniqueEntityFieldTest', E_USER_DEPRECATED); - use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\migrate\Plugin\migrate\process\DedupeEntity; -use Drupal\Component\Utility\Unicode; /** * @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\DedupeEntity * @group migrate + * @group legacy */ class DedupeEntityTest extends MigrateProcessTestCase { @@ -21,7 +18,6 @@ class DedupeEntityTest extends MigrateProcessTestCase { * The mock entity query. * * @var \Drupal\Core\Entity\Query\QueryInterface - * @var \Drupal\Core\Entity\Query\QueryFactory */ protected $entityQuery; @@ -80,7 +76,7 @@ class DedupeEntityTest extends MigrateProcessTestCase { $this->entityQueryExpects($count); $value = $this->randomMachineName(32); $actual = $plugin->transform($value, $this->migrateExecutable, $this->row, 'testproperty'); - $expected = Unicode::substr($value, $start, $length); + $expected = mb_substr($value, $start, $length); $expected .= $count ? $postfix . $count : ''; $this->assertSame($expected, $actual); } @@ -168,7 +164,9 @@ class DedupeEntityTest extends MigrateProcessTestCase { ->will($this->returnValue($this->entityQuery)); $this->entityQuery->expects($this->exactly($count + 1)) ->method('execute') - ->will($this->returnCallback(function () use (&$count) { return $count--;})); + ->will($this->returnCallback(function () use (&$count) { + return $count--; + })); } /** @@ -199,7 +197,7 @@ class DedupeEntityTest extends MigrateProcessTestCase { // Entity 'forums' is pre-existing, entity 'test_vocab' was migrated. $this->idMap - ->method('lookupSourceID') + ->method('lookupSourceId') ->will($this->returnValueMap([ [['test_field' => 'forums'], FALSE], [['test_field' => 'test_vocab'], ['source_id' => 42]],