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
* The mock entity query.
*
* @var \Drupal\Core\Entity\Query\QueryInterface
- * @var \Drupal\Core\Entity\Query\QueryFactory
*/
protected $entityQuery;
$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);
}
->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--;
+ }));
}
/**
// 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]],