Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }
Exemplo n.º 3
0
 /**
  * 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);
 }