Unverified Commit 8ce8eb9b authored by Lee Rowlands's avatar Lee Rowlands
Browse files

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

parent ac01e625
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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())
+3 −3
Original line number Diff line number Diff line
@@ -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);
  }