# adapt the apache / env setup scripts to accommodate that...)
dist: xenial
+
+global:
+ # temp workaround to xdebug 3.0.0 bug
+ - XDEBUG_MODE=coverage
+
php:
#- 5.3
#- 5.4
"name": "phpxmlrpc/phpxmlrpc",
"description": "A php library for building xmlrpc clients and servers",
"license": "BSD-3-Clause",
- "homepage": "http://gggeek.github.io/phpxmlrpc/",
+ "homepage": "https://gggeek.github.io/phpxmlrpc/",
"keywords": [ "xmlrpc", "webservices" ],
"require": {
"php": ">=5.3.0",
"ext-xml": "*"
},
"require-dev": {
- "phpunit/phpunit": "~4.0 || ~5.0",
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^8.5.12",
"phpunit/phpunit-selenium": "*",
+ "yoast/phpunit-polyfills": "*",
"ext-curl": "*",
"ext-dom": "*",
"ext-mbstring": "*",
"ext-xsl": "*",
- "indeyets/pake": "~1.99",
- "sami/sami": "~3.3",
- "docbook/docbook-xsl": "~1.79"
+ "indeyets/pake": "^1.99",
+ "sami/sami": "^3.3 || ^4.1",
+ "docbook/docbook-xsl": "^1.79"
},
"suggest": {
"ext-curl": "Needed for HTTPS and HTTP 1.1 support, NTLM Auth etc...",
use PhpXmlRpc\Helper\Charset;
+include_once __DIR__ . '/PolyfillTestCase.php';
+
/**
* Test conversion between encodings
*
* chcp 28591 (latin1)
* chcp 65001 (utf8)
*/
-class CharsetTest extends PHPUnit_Framework_TestCase
+class CharsetTest extends PhpXmlRpc_PolyfillTestCase
{
// Consolas font should render these properly
protected $runes = "ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ";
protected $chinese = "我能吞下玻璃而不伤身体。";
protected $latinString;
- protected function setUp()
+ protected function set_up()
{
// construct a latin string with all chars (except control ones)
$this->latinString = "\n\r\t";
include_once __DIR__ . '/parse_args.php';
+include_once __DIR__ . '/PolyfillTestCase.php';
+
/**
* Tests involving parsing of xml and handling of xmlrpc values
*/
-class ParsingBugsTests extends PHPUnit_Framework_TestCase
+class ParsingBugsTests extends PhpXmlRpc_PolyfillTestCase
{
public $args = array();
- protected function setUp()
+ protected function set_up()
{
$this->args = argParser::getArgs();
if ($this->args['DEBUG'] == 1)
ob_start();
}
- protected function tearDown()
+ protected function tear_down()
{
if ($this->args['DEBUG'] != 1)
return;
include_once __DIR__ . '/parse_args.php';
+include_once __DIR__ . '/PolyfillTestCase.php';
+
/**
* Tests involving requests sent to non-existing servers
*/
-class InvalidHostTest extends PHPUnit_Framework_TestCase
+class InvalidHostTest extends PhpXmlRpc_PolyfillTestCase
{
/** @var xmlrpc_client $client */
public $client = null;
public $args = array();
- public function setUp()
+ public function set_up()
{
$this->args = argParser::getArgs();
ob_start();
}
- protected function tearDown()
+ protected function tear_down()
{
if ($this->args['DEBUG'] != 1)
return;
include_once __DIR__ . '/parse_args.php';
+include_once __DIR__ . '/PolyfillTestCase.php';
+
+use PHPUnit\Framework\TestResult;
+
/**
* Tests which involve interaction between the client and the server.
* They are run against the server found in demo/server.php
*/
-class LocalhostTest extends PHPUnit_Framework_TestCase
+class LocalhostTest extends PhpXmlRpc_PolyfillTestCase
{
/** @var xmlrpc_client $client */
protected $client = null;
protected $collectCodeCoverageInformation;
protected $coverageScriptUrl;
- public static function fail($message = '')
+ public static function _fail($message = '')
{
// save in a static var that this particular test has failed
// (but only if not called from subclass objects / multitests)
}
}
- parent::fail($message);
+ parent::_fail($message);
}
/**
* Reimplemented to allow us to collect code coverage info from the target server.
* Code taken from PHPUnit_Extensions_Selenium2TestCase
*
- * @param PHPUnit_Framework_TestResult $result
- * @return PHPUnit_Framework_TestResult
+ * @param TestResult $result
+ * @return TestResult
* @throws Exception
*/
- public function run(PHPUnit_Framework_TestResult $result = NULL)
+ public function _run(TestResult $result = NULL)
{
$this->testId = get_class($this) . '__' . $this->getName();
$this->collectCodeCoverageInformation = $result->getCollectCodeCoverageInformation();
- parent::run($result);
+ parent::_run($result);
if ($this->collectCodeCoverageInformation) {
$coverage = new PHPUnit_Extensions_SeleniumCommon_RemoteCoverage(
return $result;
}
- public function setUp()
+ public function set_up()
{
$this->args = argParser::getArgs();
ob_start();
}
- protected function tearDown()
+ protected function tear_down()
{
if ($this->args['DEBUG'] != 1)
return;
*/
class DemoFilesTest extends PhpXmlRpc_LocalFileTestCase
{
- public function setUp()
+ public function set_up()
{
$this->args = argParser::getArgs();
class DebuggerTest extends PhpXmlRpc_LocalFileTestCase
{
- public function setUp()
+ public function set_up()
{
$this->args = argParser::getArgs();
*/
class ExtraTest extends PhpXmlRpc_LocalFileTestCase
{
- public function setUp()
+ public function set_up()
{
$this->args = argParser::getArgs();
{
$page = $this->request('verify_compat.php');
}
-}
\ No newline at end of file
+}
include_once __DIR__ . '/parse_args.php';
-abstract class PhpXmlRpc_LocalFileTestCase extends PHPUnit_Framework_TestCase
+include_once __DIR__ . '/PolyfillTestCase.php';
+
+use PHPUnit\Framework\TestResult;
+
+abstract class PhpXmlRpc_LocalFileTestCase extends PhpXmlRpc_PolyfillTestCase
{
public $args = array();
protected $collectCodeCoverageInformation;
protected $coverageScriptUrl;
- public function run(PHPUnit_Framework_TestResult $result = NULL)
+ public function _run(TestResult $result = NULL)
{
$this->testId = get_class($this) . '__' . $this->getName();
$this->collectCodeCoverageInformation = $result->getCollectCodeCoverageInformation();
- parent::run($result);
+ parent::_run($result);
if ($this->collectCodeCoverageInformation) {
$coverage = new PHPUnit_Extensions_SeleniumCommon_RemoteCoverage(
--- /dev/null
+<?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);
+ }
+ }
+} 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);
+ }
+ }
+}