From 3c1490b3687a02c2f47afbfb3bf0b26db8f99444 Mon Sep 17 00:00:00 2001 From: Phy <git@phy25.com> Date: Tue, 6 Mar 2018 14:54:04 +0800 Subject: [PATCH] remove createMock & createPartialMock polyfill, dropping support for PHPUnit 5.7- --- _test/core/DokuWikiTest.php | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/_test/core/DokuWikiTest.php b/_test/core/DokuWikiTest.php index 2e4caefdb..98a5aa796 100644 --- a/_test/core/DokuWikiTest.php +++ b/_test/core/DokuWikiTest.php @@ -1,12 +1,12 @@ <?php - - if(!class_exists('PHPUnit_Framework_TestCase')) { /** * phpunit 5/6 compatibility */ class PHPUnit_Framework_TestCase extends PHPUnit\Framework\TestCase { /** + * setExpectedException is deprecated in PHPUnit 6 + * * @param string $class * @param null|string $message */ @@ -19,10 +19,10 @@ if(!class_exists('PHPUnit_Framework_TestCase')) { } } - - /** * Helper class to provide basic functionality for tests + * + * @uses PHPUnit_Framework_TestCase and thus PHPUnit 5.7+ is required */ abstract class DokuWikiTest extends PHPUnit_Framework_TestCase { @@ -150,35 +150,6 @@ abstract class DokuWikiTest extends PHPUnit_Framework_TestCase { $INPUT = new Input(); } - /** - * Compatibility for older PHPUnit versions - * - * @param string $originalClassName - * @return PHPUnit_Framework_MockObject_MockObject - */ - protected function createMock($originalClassName) { - if(is_callable(array('parent', 'createMock'))) { - return parent::createMock($originalClassName); - } else { - return $this->getMock($originalClassName); - } - } - - /** - * Compatibility for older PHPUnit versions - * - * @param string $originalClassName - * @param array $methods - * @return PHPUnit_Framework_MockObject_MockObject - */ - protected function createPartialMock($originalClassName, array $methods) { - if(is_callable(array('parent', 'createPartialMock'))) { - return parent::createPartialMock($originalClassName, $methods); - } else { - return $this->getMock($originalClassName, $methods); - } - } - /** * Waits until a new second has passed * -- GitLab