<?php
-include(getcwd().'/parse_args.php');
+include(dirname(__FILE__).'/parse_args.php');
require_once('xmlrpc.inc');
require_once('xmlrpcs.inc');
if (class_exists('DateTime'))
{
$datetime = new DateTime();
- $t3 = new xmlrpcval($datetime->setTimestamp($time), 'dateTime.iso8601');
- $this->assertEquals($t1->serialize(), $t3->serialize());
+ // skip this test for php 5.2. It is a bit harder there to build a DateTime from unix timestamp with proper TZ info
+ if(is_callable(array($datetime,'setTimestamp')))
+ {
+ $t3 = new xmlrpcval($datetime->setTimestamp($time), 'dateTime.iso8601');
+ $this->assertEquals($t1->serialize(), $t3->serialize());
+ }
}
}
$this->assertEquals(1, $v->scalarval());
// now check if we decoded the cookies as we had set them
$rcookies = $r->cookies();
+ // remove extra cookies which might have been set by proxies
+ foreach($rcookies as $c => $v)
+ if(!in_array($c, array('c2', 'c3', 'c4', 'c5')))
+ unset($rcookies[$c]);
foreach($cookies as $c => $v)
// format for date string in cookies: 'Mon, 31 Oct 2005 13:50:56 GMT'
// but PHP versions differ on that, some use 'Mon, 31-Oct-2005 13:50:56 GMT'...
function testProxy()
{
- global $PROXYSERVER, $PROXYPORT;
+ global $PROXYSERVER, $PROXYPORT, $NOPROXY;
if ($PROXYSERVER)
{
$this->client->setProxy($PROXYSERVER, $PROXYPORT);
$this->_runtests();
}
else
- $this->fail('PROXY definition missing: cannot test proxy');
+ if (!$NOPROXY)
+ $this->fail('PROXY definition missing: cannot test proxy');
}
function testHttp11()
function testHttp11Proxy()
{
- global $PROXYSERVER, $PROXYPORT;
+ global $PROXYSERVER, $PROXYPORT, $NOPROXY;
if(!function_exists('curl_init'))
{
$this->fail('CURL missing: cannot test http 1.1 w. proxy');
}
else if ($PROXYSERVER == '')
{
- $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
+ if (!$NOPROXY)
+ $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
return;
}
$this->method = 'http11'; // not an error the double assignment!
function testHttpsProxy()
{
- global $HTTPSSERVER, $HTTPSURI, $PROXYSERVER, $PROXYPORT;;
+ global $HTTPSSERVER, $HTTPSURI, $PROXYSERVER, $PROXYPORT, $NOPROXY;
if(!function_exists('curl_init'))
{
$this->fail('CURL missing: cannot test https functionality');
}
else if ($PROXYSERVER == '')
{
- $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
+ if (!$NOPROXY)
+ $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
return;
}
$this->client->server = $HTTPSSERVER;