Skip to content

Commit e306cb5

Browse files
Add polyfill for older PHPUnit (createMock)
1 parent 9096cad commit e306cb5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/CredisTestCommon.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ public static function tearDownAfterClass()
151151
}
152152
}
153153

154+
/**
155+
* Polyfill for older PHPUnit
156+
*/
157+
public function createMock($class)
158+
{
159+
if (method_exists($this, 'getMock')) {
160+
return $this->getMock($class);
161+
} else {
162+
return parent::createMock($class);
163+
}
164+
}
165+
154166
/**
155167
* Polyfill for older PHPUnit
156168
*/

0 commit comments

Comments
 (0)