Skip to content

Commit 7dcbd20

Browse files
authored
[CodeQuality] Use atLeast() instead of exactly() in DecorateWillReturnMapWithExpectsMockRector (#719)
1 parent 404733e commit 7dcbd20

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎rules-tests/CodeQuality/Rector/Expression/DecorateWillReturnMapWithExpectsMockRector/Fixture/fixture.php.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class SomeTest extends \PHPUnit\Framework\TestCase
2626
public function test()
2727
{
2828
$someMock = $this->createMock(\stdClass::class);
29-
$someMock->expects($this->exactly(2))->method('some')->willReturnMap([1, 2]);
29+
$someMock->expects($this->atLeast(2))->method('some')->willReturnMap([1, 2]);
3030
}
3131
}
3232

‎rules/CodeQuality/Rector/Expression/DecorateWillReturnMapWithExpectsMockRector.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function setUp(): void
7070
{
7171
$this->someMock = $this->createMock(SomeClass::class);
7272
73-
$this->someMock->expects($this->exactly(2))
73+
$this->someMock->expects($this->atLeast(2))
7474
->method("someMethod")
7575
->willReturnMap([
7676
["arg1", "arg2", "result1"],
@@ -166,7 +166,7 @@ private function refactorExpression(Expression $expression): bool
166166
new Identifier('expects'),
167167
[new Arg(new MethodCall(
168168
new Variable('this'),
169-
new Identifier('exactly'),
169+
new Identifier('atLeast'),
170170
[new Arg(new Int_($mapCount))]
171171
))]
172172
);

0 commit comments

Comments
 (0)