diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-13 16:16:02 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-09-13 16:31:33 +0200 |
commit | db710e0b034d6f42a00f7b1188d8ff7399ea1d7a (patch) | |
tree | fd699cd08e4c856e4152803df624d1c7d48c676b /tests/lib/TestCase.php | |
parent | 0543661064b00c27c2e9a1780acf34c8a364f6ce (diff) | |
download | nextcloud-server-db710e0b034d6f42a00f7b1188d8ff7399ea1d7a.tar.gz nextcloud-server-db710e0b034d6f42a00f7b1188d8ff7399ea1d7a.zip |
Make tests work with 4.8 at least
Diffstat (limited to 'tests/lib/TestCase.php')
-rw-r--r-- | tests/lib/TestCase.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index f5d65679c90..0389ef5d46b 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -48,6 +48,24 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase { protected $services = []; /** + * Wrapper to be forward compatible to phpunit 5.4+ + * + * @param string $originalClassName + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function createMock($originalClassName) { + if (is_callable('parent::createMock')) { + return parent::createMock($originalClassName); + } + + return $this->getMockBuilder($originalClassName) + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->getMock(); + } + + /** * @param string $name * @param mixed $newService * @return bool |