Returntype incorrect for UnitTestCase::getConfigFactoryStub()

Created on 9 September 2023, about 1 year ago
Updated 18 October 2023, about 1 year ago

Problem/Motivation

The return type on UnitTestCase::getConfigFactoryStub
* @return \PHPUnit\Framework\MockObject\MockBuilder
However the code returns a MockObject, and more specifically it is Drupal\Core\Config\ConfigFactoryInterface&PHPUnit\Framework\MockObject\MockObject

This creates a warning when running PHPStan across (contrib) UnitTests that $configFactory (Drupal\Core\Config\ConfigFactoryInterface&PHPUnit\Framework\MockObject\MockObject) does not accept PHPUnit\Framework\MockObject\MockBuilder.

Tagging as novice because this just needs a simple text change to the return type and an update to the return text.

Steps to reproduce

Review code,

Proposed resolution

Adjust typehint.

Remaining tasks

Patch

User interface changes

None

API changes

Technically none, this is just updating the documentation to reflect the actual return type.

Data model changes

NOne

Release notes snippet

๐Ÿ› Bug report
Status

Fixed

Version

10.1 โœจ

Component
PHPUnitย  โ†’

Last updated about 8 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States cmlara

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024