Skip to content

Commit 0afbcc4

Browse files
committed
Fix tests for PHPUnit 9.x
1 parent f43177b commit 0afbcc4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/ImporterTest.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ class ImporterTest extends TestCase
1818
{
1919
protected function expect(bool $expect, MockObject $object, string $method, array $args = [], $return = null)
2020
{
21-
$object->expects($expect ? $this->once() : $this->never())
22-
->method($method)
23-
->with(...$args)
24-
->willReturn($return);
21+
$mock = $object->expects($expect ? $this->once() : $this->never())
22+
->method($method)
23+
->with(...$args);
24+
25+
if ($return !== null) {
26+
$mock->willReturn($return);
27+
}
2528
}
2629

2730
public function importBatchProvider()
@@ -101,10 +104,11 @@ public function testImportBatch(bool $hasNext, bool $isLocked, bool $didInterrup
101104
}
102105
}
103106

104-
public function importForSourcesProvider() {
107+
public function importForSourcesProvider()
108+
{
105109
return [
106110
[false],
107-
[true]
111+
[true],
108112
];
109113
}
110114

0 commit comments

Comments
 (0)