X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2F2InvalidHostTest.php;h=18c8f6c0ed372d7046628f819bd23c2c2d7fe4ed;hb=98d4ea619cef778d0cbcc706ea9a157178f90da5;hp=1c81b550cabe772ee821f722f4a5e00e08580d38;hpb=fc4f17849d8bb022c3b8ff38a2bed1d1c188ac7f;p=plcapi.git diff --git a/tests/2InvalidHostTest.php b/tests/2InvalidHostTest.php index 1c81b55..18c8f6c 100644 --- a/tests/2InvalidHostTest.php +++ b/tests/2InvalidHostTest.php @@ -4,27 +4,29 @@ include_once __DIR__ . '/../lib/xmlrpc.inc'; 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(); - $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; @@ -79,12 +81,12 @@ class InvalidHostTest extends PHPUnit_Framework_TestCase $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());