-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-phpunit
#655Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | 2.3.6 |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/9db2158f-daff-4c24-af4c-0a7ece60f49a
<?php
use \PHPUnit\Framework\MockObject\Stub;
interface SomeInterface
{
public function execute(): string;
}
final class FoobarTest extends \PHPUnit\Framework\TestCase
{
private SomeInterface&Stub $service;
protected function setUp() {
$this->service = $this->createStub(SomeInterface::class);
}
public function run(bool $param)
{
$this->service->method('execute')->willReturnMap(['asdf', 'adsfasdf']);
$this->service->execute(); // simulate test
}
}Responsible rules
DecorateWillReturnMapWithExpectsMockRector
Expected Behavior
No code change, as Stub does not implement expects method (only MockObject does).
Reactions are currently unavailable