phpstan-mockery
phpstan-mockery copied to clipboard
Mocking public properties gives undefined property error
trafficstars
When creating a mock and setting a property on the mock, which is the recommended way for mocking public properties, it gives an undefined property error.
$user = Mockery::mock(User::class);
$user->name = "Oliver";
Access to an undefined property Mockery\MockInterface::$name.
current workaround is to just add the following ignore error
- '#Access to an undefined property Mockery\\MockInterface::\$.*\.#'