{
/**
* Method used to test logging of php warnings generated by user functions.
+ * @param PhpXmlRpc\Request $req
+ * @return PhpXmlRpc\Response
*/
public function phpWarningGenerator($req)
{
/**
* Method used to test catching of exceptions in the server.
+ * @param PhpXmlRpc\Request $req
+ * @throws Exception
*/
public function exceptionGenerator($req)
{
throw new Exception("it's just a test", 1);
}
+ /**
+ * @param string $msg
+ */
+ public function debugMessageGenerator($msg)
+ {
+ PhpXmlRpc\Server::xmlrpc_debugmsg($msg);
+ }
+
/**
* A PHP version of the state-number server. Send me an integer and i'll sell you a state.
* Used to test wrapping of PHP methods into xmlrpc methods.
}
}
+ public function testServerComments()
+ {
+ $f = new xmlrpcmsg('tests.xmlrpcServerMethodsContainer.debugMessageGenerator', array(
+ new xmlrpcval('hello world', 'string'),
+ ));
+ $r = $this->send($f, 0, true);
+ $this->assertContains('hello world', $r->raw_data);
+ }
+
public function testSendTwiceSameMsg()
{
$f = new xmlrpcmsg('examples.stringecho', array(
*/
function _runtests()
{
- $unsafeMethods = array('testHttps', 'testCatchExceptions', 'testUtf8Method');
+ $unsafeMethods = array('testHttps', 'testCatchExceptions', 'testUtf8Method', 'testServerComments');
foreach(get_class_methods('LocalhostTest') as $method)
{
if(strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods))