travis
authorgggeek <giunta.gaetano@gmail.com>
Sun, 6 Dec 2020 15:14:05 +0000 (15:14 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sun, 6 Dec 2020 15:14:05 +0000 (15:14 +0000)
.travis.yml
tests/PolyfillTestCase.php
tests/PolyfillTestCase7.php [new file with mode: 0644]
tests/PolyfillTestCase8.php [new file with mode: 0644]

index 4d98740..81510da 100644 (file)
@@ -9,6 +9,17 @@ dist: xenial
 global:
     # temp workaround to xdebug 3.0.0 bug
     - XDEBUG_MODE=coverage
+    - LOCALSERVER=localhost
+    - URI=/demo/server/server.php
+    - HTTPSSERVER=localhost
+    - HTTPSURI=/demo/server/server.php
+    - PROXY=localhost:8080
+    # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
+    # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
+    - HTTPSVERIFYHOST=0
+    - HTTPSIGNOREPEER=1
+    - SSLVERSION=0
+    - DEBUG=0
 
 php:
   #- 5.3
@@ -50,9 +61,7 @@ before_script:
   - vendor/bin/phpunit --version
 
 script:
-  # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
-  # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
-  vendor/bin/phpunit $COVERAGE_OPTS tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=localhost HTTPSURI=/demo/server/server.php PROXY=localhost:8080 HTTPSVERIFYHOST=0 HTTPSIGNOREPEER=1 SSLVERSION=0 DEBUG=0
+  vendor/bin/phpunit $COVERAGE_OPTS tests
 
 after_failure:
   # Save as much info as we can to help developers
index 5dc8961..5e2fcdc 100644 (file)
@@ -1,47 +1,13 @@
 <?php
 
-use PHPUnit\Framework\TestResult;
 use PHPUnit\Runner\Version as PHPUnit_Version;
-use Yoast\PHPUnitPolyfills\TestCases\TestCase;
 
 if (class_exists('PhpXmlRpc_PolyfillTestCase')) {
     return;
 }
 
 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';
 }
diff --git a/tests/PolyfillTestCase7.php b/tests/PolyfillTestCase7.php
new file mode 100644 (file)
index 0000000..3c88b33
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+use PHPUnit\Framework\TestResult;
+use Yoast\PHPUnitPolyfills\TestCases\TestCase;
+
+abstract class PhpXmlRpc_PolyfillTestCase extends TestCase
+{
+    public function _run($result = null) {
+        return parent::run($result);
+    }
+
+    public static function _fail() {}
+
+    public function run(TestResult $result = null) {
+        return $this->_run($result);
+    }
+
+    public static function fail($message = '') {
+        static::_fail($message);
+        self::fail($message);
+    }
+}
diff --git a/tests/PolyfillTestCase8.php b/tests/PolyfillTestCase8.php
new file mode 100644 (file)
index 0000000..0f933ff
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+use PHPUnit\Framework\TestResult;
+use Yoast\PHPUnitPolyfills\TestCases\TestCase;
+
+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);
+    }
+}