Problem/Motivation

The MigrateProcessTestCase base class defines the protected $row property as \Drupal\migrate\Row variable type. Later in the code, the variable is mocked as migrate row and thus has also to be typed as \PHPUnit\Framework\MockObject\MockObject.

Steps to reproduce

  • Check code of Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase or run a static code analysis for that class

Proposed resolution

  • Define variable type hinting as \Drupal\migrate\MigrateExecutable|\PHPUnit\Framework\MockObject\MockObject

Remaining tasks

  • Done: Fix variable type

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

Use correct variable type hint for $row property of Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase

Issue fork drupal-3203265

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hctom created an issue. See original summary.

hctom’s picture

Issue summary: View changes

Please review the issue fork for the necessary change.

hctom’s picture

Status: Active » Needs review

quietone’s picture

Status: Needs review » Reviewed & tested by the community

Yes, the hint is missing the mock part. This change is correct.

@htcom, thanks!

  • catch committed 1df9944 on 9.2.x
    Issue #3203265 by hctom, quietone: Wrong/Missing variable type hint for...

  • catch committed 7408756 on 9.1.x
    Issue #3203265 by hctom, quietone: Wrong/Missing variable type hint for...
catch’s picture

Version: 9.2.x-dev » 9.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.2.x and cherry-picked to 9.1.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.