Exemplo n.º 1
0
 /**
  * Tests functionality of both get() and save()
  */
 public function testGetSave()
 {
     if (!is_writeable('./')) {
         $this->markTestIncomplete('Directory no writable');
     }
     $this->assertTrue(Server\Cache::save($this->_file, $this->_server));
     $expected = $this->_server->listMethods();
     $server = new Server();
     $this->assertTrue(Server\Cache::get($this->_file, $server));
     $actual = $server->listMethods();
     $this->assertSame($expected, $actual);
 }
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
 public function testAddFunctionWithExtraArgs()
 {
     $this->_server->addFunction('ZendTest\\XmlRpc\\testFunction', 'test', 'arg1');
     $methods = $this->_server->listMethods();
     $this->assertContains('test.ZendTest\\XmlRpc\\testFunction', $methods);
 }
Exemplo n.º 4
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);
 }