Skip to content

Commit 5a34316

Browse files
committed
[CodeQuality] Skip on non-mock object on DecorateWillReturnMapWithExpectsMockRector
1 parent 5eee71e commit 5a34316

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Expression\DecorateWillReturnMapWithExpectsMockRector\Fixture;
6+
7+
use PHPUnit\Framework\MockObject\Stub;
8+
use Rector\PHPUnit\Tests\CodeQuality\Rector\Expression\DecorateWillReturnMapWithExpectsMockRector\Source\SomeInterfaceToStub;
9+
10+
final class SkipOnCreateStub extends \PHPUnit\Framework\TestCase
11+
{
12+
private SomeInterfaceToStub&Stub $service;
13+
14+
protected function setUp(): void
15+
{
16+
$this->service = $this->createStub(SomeInterfaceToStub::class);
17+
}
18+
19+
public function test()
20+
{
21+
$this->service->method('execute')->willReturnMap(['asdf', 'adsfasdf']);
22+
$this->service->execute();
23+
}
24+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Expression\DecorateWillReturnMapWithExpectsMockRector\Source;
6+
7+
interface SomeInterfaceToStub
8+
{
9+
public function execute(): string;
10+
}

0 commit comments

Comments
 (0)