comments
[plcapi.git] / tests / PolyfillTestCase.php
index 5dc8961..14e42c9 100644 (file)
@@ -1,47 +1,15 @@
 <?php
 
-use PHPUnit\Framework\TestResult;
 use PHPUnit\Runner\Version as PHPUnit_Version;
-use Yoast\PHPUnitPolyfills\TestCases\TestCase;
 
-if (class_exists('PhpXmlRpc_PolyfillTestCase')) {
-    return;
+/// @todo we should do the opposite - write test code to the 'new' phpunit API, and alias it to the 'old' class name
+///       when old classes are present...
+if (!class_exists('PHPUnit_Extensions_SeleniumCommon_RemoteCoverage')) {
+    class PHPUnit_Extensions_SeleniumCommon_RemoteCoverage extends PHPUnit\Extensions\SeleniumCommon\RemoteCoverage {}
 }
 
 if (class_exists(PHPUnit_Version::class) === false || version_compare(PHPUnit_Version::id(), '8.0.0', '<')) {
-    abstract class PhpXmlRpc_PolyfillTestCase extends TestCase
-    {
-        public function _run($result = null) {
-            return parent::run($result);
-        }
-
-        public static function _fail() {}
-
-        public function run($result = null) {
-            return $this->_run($result);
-        }
-
-        public static function fail($message = '') {
-            static::_fail($message);
-            self::fail($message);
-        }
-    }
+    include_once __DIR__ . '/PolyfillTestCase7.php';
 } else {
-    abstract class PhpXmlRpc_PolyfillTestCase extends TestCase
-    {
-        public function _run(TestResult $result = null) {
-            return parent::run($result);
-        }
-
-        public static function _fail() {}
-
-        public function run(TestResult $result = null): TestResult {
-            return $this->_run($result);
-        }
-
-        public static function fail(string $message = ''): void {
-            static::_fail($message);
-            parent::fail($message);
-        }
-    }
+    include_once __DIR__ . '/PolyfillTestCase8.php';
 }