Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / migrate / tests / src / Unit / process / MakeUniqueEntityFieldTest.php
index 27557d18af8c164c996b24046c60bae56699eacc..9d3ab06da56ff42c75d1acd7701709453c9f012e 100644 (file)
@@ -6,7 +6,6 @@ use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\migrate\Plugin\migrate\process\MakeUniqueEntityField;
-use Drupal\Component\Utility\Unicode;
 
 /**
  * @coversDefaultClass \Drupal\migrate\Plugin\migrate\process\MakeUniqueEntityField
@@ -17,7 +16,7 @@ class MakeUniqueEntityFieldTest extends MigrateProcessTestCase {
   /**
    * The mock entity query.
    *
-   * @var \Drupal\Core\Entity\Query\QueryInterface|\Drupal\Core\Entity\Query\QueryFactory
+   * @var \Drupal\Core\Entity\Query\QueryInterface
    */
   protected $entityQuery;
 
@@ -76,7 +75,7 @@ class MakeUniqueEntityFieldTest 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);
   }
@@ -197,7 +196,7 @@ class MakeUniqueEntityFieldTest 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]],