Skip to content

Commit 0d90f9f

Browse files
committed
add fixture to TypeWillReturnCallableArrowFunctionRector
1 parent 0eff2fa commit 0d90f9f

File tree

1 file changed

+37
-0
lines changed
  • rules-tests/CodeQuality/Rector/Class_/TypeWillReturnCallableArrowFunctionRector/Fixture

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\TypeWillReturnCallableArrowFunctionRector\Fixture;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\TypeWillReturnCallableArrowFunctionRector\Source\SomeMockedClass;
7+
8+
final class FillKnownParamType extends TestCase
9+
{
10+
public function test($value): void
11+
{
12+
$this->createMock(SomeMockedClass::class)
13+
->method('someMethod')
14+
->with($this->callback(fn ($name) => $value));
15+
}
16+
}
17+
18+
?>
19+
-----
20+
<?php
21+
22+
namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\TypeWillReturnCallableArrowFunctionRector\Fixture;
23+
24+
use PHPUnit\Framework\TestCase;
25+
use Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\TypeWillReturnCallableArrowFunctionRector\Source\SomeMockedClass;
26+
27+
final class FillKnownParamType extends TestCase
28+
{
29+
public function test($value): void
30+
{
31+
$this->createMock(SomeMockedClass::class)
32+
->method('someMethod')
33+
->with($this->callback(fn (string $name): int => $value));
34+
}
35+
}
36+
37+
?>

0 commit comments

Comments
 (0)