include_once __DIR__ . '/parse_args.php';
+include_once __DIR__ . '/PolyfillTestCase.php';
+
+use PHPUnit\Runner\BaseTestRunner;
+
/**
* 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();
- $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['LOCALSERVER'], 80);
+ $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['HTTPSERVER'], 80);
$this->client->setDebug($this->args['DEBUG']);
if ($this->args['DEBUG'] == 1)
ob_start();
}
- protected function tearDown()
+ protected function tear_down()
{
if ($this->args['DEBUG'] != 1)
return;
$out = ob_get_clean();
$status = $this->getStatus();
- if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR
- || $status == PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE) {
+ if ($status == BaseTestRunner::STATUS_ERROR
+ || $status == BaseTestRunner::STATUS_FAILURE) {
echo $out;
}
}
$this->assertTrue($r->faultCode() === 8 || $r->faultCode() == 5);
// now test a successful connection
- $server = explode(':', $this->args['LOCALSERVER']);
+ $server = explode(':', $this->args['HTTPSERVER']);
if (count($server) > 1) {
$this->client->port = $server[1];
}
$this->client->server = $server[0];
- $this->client->path = $this->args['URI'];
+ $this->client->path = $this->args['HTTPURI'];
$r = $this->client->send($m, 5, 'http11');
$this->assertEquals(0, $r->faultCode());