Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://git.zendframework.com/zf into ZF2-13
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-mabe committed Jul 22, 2011
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/Server.php
Expand Up @@ -210,7 +210,7 @@ public function addFunction($function, $namespace = '')
if (!is_string($func) || !function_exists($func)) {
throw new Server\Exception\InvalidArgumentException('Unable to attach function; invalid', 611);
}
$reflection = Reflection\Reflection::reflectFunction($func, $argv, $namespace);
$reflection = Reflection::reflectFunction($func, $argv, $namespace);
$this->_buildSignature($reflection);
}
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public function setClass($class, $namespace = '', $argv = null)
$argv = array_slice($argv, 2);
}

$dispatchable = Reflection\Reflection::reflectClass($class, $argv, $namespace);
$dispatchable = Reflection::reflectClass($class, $argv, $namespace);
foreach ($dispatchable->getMethods() as $reflection) {
$this->_buildSignature($reflection, $class);
}
Expand Down
18 changes: 8 additions & 10 deletions test/ClientTest.php
Expand Up @@ -155,7 +155,7 @@ public function testSuccessfulRpcMethodCallWithParameters()
}

/**
* @see ZF-2090
* @group ZF-2090
*/
public function testSuccessfullyDetectsEmptyArrayParameterAsArray()
{
Expand All @@ -176,9 +176,7 @@ public function testSuccessfullyDetectsEmptyArrayParameterAsArray()
}

/**
* @see ZF-1412
*
* @return void
* @group ZF-1412
*/
public function testSuccessfulRpcMethodCallWithMixedDateParameters()
{
Expand Down Expand Up @@ -647,16 +645,16 @@ public function testCustomHttpClientUserAgentIsNotOverridden()
$this->assertTrue($this->xmlrpcClient->call('method'));
$this->assertSame($expectedUserAgent, $this->httpClient->getHeader('user-agent'));
}

/**
* @group ZF-8478
*/
public function testPythonSimpleXMLRPCServerWithUnsupportedMethodSignatures()
{
$introspector = new Client\ServerIntrospection(
$introspector = new Client\ServerIntrospection(
new TestClient('http://localhost/')
);

$this->setExpectedException('Zend\XmlRpc\Client\Exception\IntrospectException', 'Invalid signature for method "add"');
$signature = $introspector->getMethodSignature('add');
}
Expand Down Expand Up @@ -727,9 +725,9 @@ public function __call($method, $args) {
/** related to ZF-8478 */
class TestClient extends Client {
public function getProxy($namespace = '') {
if (empty($this->_proxyCache[$namespace])) {
$this->_proxyCache[$namespace] = new PythonSimpleXMLRPCServerWithUnsupportedIntrospection($this, $namespace);
}
if (empty($this->_proxyCache[$namespace])) {
$this->_proxyCache[$namespace] = new PythonSimpleXMLRPCServerWithUnsupportedIntrospection($this, $namespace);
}
return parent::getProxy($namespace);
}
}
18 changes: 9 additions & 9 deletions test/ServerTest.php
Expand Up @@ -96,7 +96,7 @@ public function suppressNotFoundWarnings($errno, $errstr)
*/
public function testAddFunction()
{

$this->_server->addFunction('ZendTest\\XmlRpc\\testFunction', 'zsr');

$methods = $this->_server->listMethods();
Expand All @@ -106,13 +106,13 @@ public function testAddFunction()
$this->assertTrue(in_array('zsr.ZendTest\\XmlRpc\\testFunction', $methods));
$this->assertTrue(in_array('zsr.ZendTest\\XmlRpc\\testFunction2', $methods));
}

public function testAddFunctionThrowsExceptionOnInvalidInput()
{
$this->setExpectedException('Zend\XmlRpc\Server\Exception\InvalidArgumentException', 'Unable to attach function; invalid');
$this->_server->addFunction('nosuchfunction');
}

public function testAddFunctionThrowsExceptionOnInvalidArrayInput()
{
//$this->setExpectedException('XXX', 'xxx');
Expand All @@ -124,7 +124,7 @@ public function testAddFunctionThrowsExceptionOnInvalidArrayInput()
'zsr'
);
}

/**
* get/loadFunctions() test
*/
Expand Down Expand Up @@ -446,7 +446,7 @@ public function testLoadFunctionsThrowsExceptionWithBadData()
$this->setExpectedException('Zend\XmlRpc\Server\Exception\InvalidArgumentException', 'Unable to load server definition; must be an array or Zend_Server_Definition, received stdClass');
$this->_server->loadFunctions($o);
}

public function testLoadFunctionsThrowsExceptionsWithBadData2()
{
$this->setExpectedException('Zend\XmlRpc\Server\Exception\InvalidArgumentException', 'Unable to load server definition; must be an array or Zend_Server_Definition, received string');
Expand All @@ -457,11 +457,11 @@ public function testLoadFunctionsThrowsExceptionsWithBadData3()
{
$o = new \stdClass();
$o = array($o);

$this->setExpectedException('Zend\Server\Exception\InvalidArgumentException', 'Invalid method provided');
$this->_server->loadFunctions($o);
}

public function testLoadFunctionsReadsMethodsFromServerDefinitionObjects()
{
$mockedMethod = $this->getMock('Zend\\Server\\Method\\Definition', array(), array(), '', false,
Expand Down Expand Up @@ -494,7 +494,7 @@ public function testSetRequestThrowsExceptionOnBadClassName()
$this->setExpectedException('Zend\XmlRpc\Server\Exception\InvalidArgumentException', 'Invalid request object');
$this->_server->setRequest('ZendTest\\XmlRpc\\TestRequest2');
}

public function testSetRequestThrowsExceptionOnBadObject()
{
$this->setExpectedException('Zend\XmlRpc\Server\Exception\InvalidArgumentException', 'Invalid request object');
Expand Down Expand Up @@ -585,7 +585,7 @@ public function testMulticallReturnsFaultsWithBadData()
}

/**
* @see ZF-2872
* @group ZF-2872
*/
public function testCanMarshalBase64Requests()
{
Expand Down
1 change: 0 additions & 1 deletion tools/phptools
Submodule phptools deleted from d232cb

0 comments on commit 0e2a882

Please sign in to comment.