/** * Tests functionality of both get() and save() */ public function testGetSave() { if (!is_writeable('./')) { throw new PHPUnit_Framework_IncompleteTestError('Directory not writeable'); } $this->assertTrue(Zend_XmlRpc_Server_Cache::save($this->_file, $this->_server)); $expected = $this->_server->listMethods(); $server = new Zend_XmlRpc_Server(); $this->assertTrue(Zend_XmlRpc_Server_Cache::get($this->_file, $server)); $actual = $server->listMethods(); $this->assertSame($expected, $actual); }
public function testShouldReturnFalseWithInvalidCache() { if (!is_writeable('./')) { $this->markTestIncomplete('Directory no writable'); } file_put_contents($this->_file, 'blahblahblah'); $server = new Zend_XmlRpc_Server(); $this->assertFalse(Zend_XmlRpc_Server_Cache::get($this->_file, $server)); }
/** * XMLRPC server */ public function xmlrpcAction() { $cacheFile = ROOT_PATH . '/var/cache/xmlrpc.cache'; $server = new Zend_XmlRpc_Server(); if( !Zend_XmlRpc_Server_Cache::get( $cacheFile, $server )){ $server->setClass( 'User_Service_User', 'user' ); Zend_XmlRpc_Server_Cache::save( $cacheFile, $server); } echo $server->handle(); }