Skip to content

CreateStubOverCreateMockArgRector ignores parameter type #9683

@mttsch

Description

@mttsch

Bug Report

Subject Details
Rector version v2.3.8

Minimal PHP Code Causing Issue

https://getrector.com/demo/be38a84e-8156-4d5b-bdb7-cdef5b658a1c

Expected Behaviour

As the constructor has an explicit type hint for MockObject, replacing it with Stub causes an exception.

(Background: The real service gets the mock object and then provides multiple methods to configure complex expectations that would be too verbose to repeatedly configure in the tests.)

PS: Only now discovered rectorphp/rector-phpunit#661, which is similar.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions