Skip to content

Commit f36614f

Browse files
committed
Simplify phpunit's ->will($this->returnCallback()) with ->willReturnCallback()
1 parent 1ad364e commit f36614f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Provider/Chain/Tests/ChainTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function testReverse(): void
4545
$mockOne = $this->getMockBuilder(Provider::class)->getMock();
4646
$mockOne->expects($this->once())
4747
->method('reverseQuery')
48-
->will($this->returnCallback(function () {
48+
->willReturnCallback(function () {
4949
throw new \Exception();
50-
}));
50+
});
5151

5252
$mockTwo = $this->getMockBuilder(Provider::class)->getMock();
5353
$result = new AddressCollection(['foo' => 'bar']);
@@ -66,9 +66,9 @@ public function testGeocode(): void
6666
$mockOne = $this->getMockBuilder(Provider::class)->getMock();
6767
$mockOne->expects($this->once())
6868
->method('geocodeQuery')
69-
->will($this->returnCallback(function () {
69+
->willReturnCallback(function () {
7070
throw new \Exception();
71-
}));
71+
});
7272

7373
$mockTwo = $this->getMockBuilder(Provider::class)->getMock();
7474
$result = new AddressCollection(['foo' => 'bar']);

0 commit comments

Comments
 (0)