Skip to content

Commit 646a3b2

Browse files
committed
Try to cater for PHPUnit <= 8.2, use constant instead of hardcoded method name
1 parent f17d4a9 commit 646a3b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

classes/PHPMock.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ public function getFunctionMock($namespace, $name)
6767

6868
$builder = $this->getMockBuilder($delegateBuilder->getFullyQualifiedClassName());
6969
if (is_callable([$builder, 'onlyMethods'])) {
70-
$builder->onlyMethods(['delegate', $name]);
70+
$builder->onlyMethods([MockDelegateFunctionBuilder::METHOD, $name]);
71+
} elseif (is_callable([$builder, 'setMethods'])) {
72+
$builder->setMethods([MockDelegateFunctionBuilder::METHOD, $name]);
7173
}
7274
$mock = $builder->getMock();
7375
$this->addMatcher($mock, $name);

0 commit comments

Comments
 (0)