Commit b859a4c0 authored by catch's avatar catch
Browse files

Issue #3555886 by alexpott, smustgrave:...

Issue #3555886 by alexpott, smustgrave: \Drupal\Tests\Core\Entity\ContentEntityBaseUnitTest does not mock EntityType::getId() correctly cuasing PHP 8.5 deprecations

(cherry picked from commit 22f40445)
parent dfe6669b
Loading
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -148,6 +148,15 @@ protected function setUp(): void {
        'id' => 'id',
        'uuid' => 'uuid',
      ]);
    $this->entityType
      ->method('getKey')
      ->willReturnMap([
        ['default_langcode', 'default_langcode'],
        ['id', 'id'],
        ['langcode', 'langcode'],
        ['revision', 'revision_id'],
        ['uuid', 'uuid'],
      ]);

    $this->entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
    $this->entityTypeManager->expects($this->any())
@@ -241,10 +250,6 @@ public function testIsNewRevision(): void {
      ->method('hasKey')
      ->with('revision')
      ->willReturnOnConsecutiveCalls(FALSE, TRUE, TRUE, TRUE);
    $this->entityType->expects($this->exactly(2))
      ->method('getKey')
      ->with('revision')
      ->willReturn('revision_id');

    $field_item_list = $this->getMockBuilder('\Drupal\Core\Field\FieldItemList')
      ->disableOriginalConstructor()