public function testLoadFunctionsReadsMethodsFromServerDefinitionObjects() { $mockedMethod = $this->getMock('Zend\\Server\\Method\\Definition', array(), array(), '', false, false); $mockedDefinition = $this->getMock('Zend\\Server\\Definition', array(), array(), '', false, false); $mockedDefinition->expects($this->once())->method('getMethods')->will($this->returnValue(array('bar' => $mockedMethod))); $this->_server->loadFunctions($mockedDefinition); }
/** * get/loadFunctions() test */ public function testFunctions() { $expected = $this->_server->listMethods(); $functions = $this->_server->getFunctions(); $server = new Server(); $server->loadFunctions($functions); $actual = $server->listMethods(); $this->assertSame($expected, $actual); }
/** * get/loadFunctions() test */ public function testFunctions() { try { $this->_server->addFunction(array('ZendTest\\XmlRpc\\testFunction', 'ZendTest\\XmlRpc\\testFunction2'), 'zsr'); } catch (XmlRpc\Exception $e) { $this->fail('Error attaching functions: ' . $e->getMessage()); } $expected = $this->_server->listMethods(); $functions = $this->_server->getFunctions(); $server = new Server(); $server->loadFunctions($functions); $actual = $server->listMethods(); $this->assertSame($expected, $actual); }