diff -r 877f952ae2bd -r 6b6c2214f778 web/lib/Zend/Mobile/Push/Test/ApnsProxy.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Mobile/Push/Test/ApnsProxy.php Thu Mar 21 19:52:38 2013 +0100 @@ -0,0 +1,103 @@ +_readResponse = $str; + } + + /** + * Set the write response + * + * @param mixed $resp + * @return void + */ + public function setWriteResponse($resp) + { + $this->_writeResponse = $resp; + } + + /** + * Connect + * + * @return true + */ + protected function _connect($uri) { + return true; + } + + /** + * Return Response + * + * @param string $length + * @return string + */ + protected function _read($length) { + $ret = substr($this->_readResponse, 0, $length); + $this->_readResponse = null; + return $ret; + } + + /** + * Write and Return Length + * + * @param string $payload + * @return int + */ + protected function _write($payload) { + $ret = $this->_writeResponse; + $this->_writeResponse = null; + return (null === $ret) ? strlen($payload) : $ret; + } +}