Skip to content

Commit 573db6e

Browse files
committed
test tweak
1 parent cc91a90 commit 573db6e

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

tests/07ClientTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,26 @@ public function testCurlKAErr()
9898
is_object($ro) && $this->assertEquals('hello', $ro->scalarVal());
9999
}
100100

101+
public function testCustomHeaders()
102+
{
103+
$opts = array(\PhpXmlRpc\Client::USE_CURL_NEVER);
104+
if (function_exists('curl_init'))
105+
{
106+
$opts[] = \PhpXmlRpc\Client::USE_CURL_ALWAYS;
107+
}
108+
109+
$this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_HEADERS, array('X-PXR-Test: yes'));
110+
$r = new \PhpXmlRpc\Request('tests.getallheaders');
111+
112+
foreach ($opts as $opt) {
113+
$this->client->setOption(\PhpXmlRpc\Client::OPT_USE_CURL, $opt);
114+
$r = $this->client->send($r);
115+
$this->assertEquals(0, $r->faultCode());
116+
$ro = $r->value();
117+
$this->assertArrayHasKey('X-Pxr-Test', $ro->scalarVal(), "Testing with curl mode: $opt");
118+
}
119+
}
120+
101121
public function testgetUrl()
102122
{
103123
$m = $this->client->getUrl(PHP_URL_SCHEME);

tests/09HTTPTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,6 @@ public function testDigestAuth($method)
530530
$this->$method();
531531
}
532532

533-
public function testCustomHeaders()
534-
{
535-
$this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_HEADERS, array('X-PXR-Test: yes'));
536-
537-
$r = new \PhpXmlRpc\Request('tests.getallheaders');
538-
$v = $this->send($r);
539-
$this->assertArrayHasKey('X-Pxr-Test', $v);
540-
}
541-
542533
/**
543534
* @param \PhpXmlRpc\Response $r
544535
* @return void

0 commit comments

Comments
 (0)