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());
+ }
}
}
function testAutoRegisteredMethod()
{
- $func=wrap_xmlrpc_method($this->client, 'examples.getStateName');
+ // make a 'deep client copy' as the original one might have many properties set
+ $func=wrap_xmlrpc_method($this->client, 'examples.getStateName', array('simple_client_copy' => 1));
if($func == '')
{
$this->fail('Registration of examples.getStateName failed');
else
{
$v=$func(23);
+ // work around bug in current version of phpunit
+ if(is_object($v))
+ {
+ $v = var_export($v, true);
+ }
$this->assertEquals('Michigan', $v);
}
}
if(strpos($meth, 'test') === 0 && $meth != 'testHttps' && $meth != 'testCatchExceptions')
{
if (!isset($failed_tests[$meth]))
+ {
$this->$meth();
+ }
}
if ($this->_failed)
{
$this->client->method = 'https';
$this->client->path = $HTTPSURI;
$this->client->setSSLVerifyPeer( !$HTTPSIGNOREPEER );
+ // silence warning with newish php versions
+ $this->client->setSSLVerifyHost(2);
$this->_runtests();
}
</form>
</div>
<?php
-echo $result->toHTML()."\n</body>\n</html>\n";
+ echo $result->toHTML()."\n</body>\n</html>\n";
+}
+else
+{
+ exit($result->failureCount());
}
?>
\ No newline at end of file