Skip to content

Commit 874fe1e

Browse files
committed
use createStub if exists
1 parent 8f2e59d commit 874fe1e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

tests/MockDisablerTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ public function testCallback()
3838
{
3939
$executed = false;
4040
$executedWith = null;
41-
$mock = $this->createStub(Deactivatable::class);
41+
42+
$mock = method_exists($this, 'createStub')
43+
? $this->createStub(Deactivatable::class)
44+
: $this->createMock(Deactivatable::class);
45+
4246
$disabler = new MockDisabler($mock, static function ($disabler) use (&$executed, &$executedWith) {
4347
self::assertInstanceOf(MockDisabler::class, $disabler);
4448

tests/MockObjectProxyTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ class MockObjectProxyTest extends TestCase
3333
*/
3434
public function testExpects()
3535
{
36-
$matcher = $this->createStub(Invocation::class);
36+
$matcher = method_exists($this, 'createStub')
37+
? $this->createStub(Invocation::class)
38+
: $this->createMock(Invocation::class);
3739

3840
if (class_exists(ConfigurableMethod::class)) {
3941
if (class_exists(\PHPUnit\Runner\Version::class)

0 commit comments

Comments
 (0)