Unverified Commit 8ce8eb9b authored by larowlan's avatar larowlan
Browse files

Issue #3241130 by alexpott: Migrate units test trigger deprecations on PHP 8.1

parent ac01e625
......@@ -200,6 +200,9 @@ protected function runEnsureTablesTest($schema) {
$database->expects($this->any())
->method('schema')
->willReturn($schema);
$database->expects($this->any())
->method('tablePrefix')
->willReturn('');
$migration = $this->getMigration();
$plugin = $this->createMock('Drupal\migrate\Plugin\MigrateSourceInterface');
$plugin->expects($this->any())
......
......@@ -72,13 +72,13 @@ public function testMakeUniqueEntityField($count, $postfix = '', $start = NULL,
if ($postfix) {
$configuration['postfix'] = $postfix;
}
$configuration['start'] = isset($start) ? $start : NULL;
$configuration['length'] = isset($length) ? $length : NULL;
$configuration['start'] = $start;
$configuration['length'] = $length;
$plugin = new MakeUniqueEntityField($configuration, 'make_unique', [], $this->getMigration(), $this->entityTypeManager);
$this->entityQueryExpects($count);
$value = $this->randomMachineName(32);
$actual = $plugin->transform($value, $this->migrateExecutable, $this->row, 'testproperty');
$expected = mb_substr($value, $start, $length);
$expected = mb_substr($value, $start ?? 0, $length);
$expected .= $count ? $postfix . $count : '';
$this->assertSame($expected, $actual);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment