/** * Destroys a class instance. */ public function __destruct() { parent::__destruct(); if (is_resource($this->server)) { xmlrpc_server_destroy($this->server); } }
/** * Checks server response. * * @param string $test */ private function checkServerOutput($test) { // Prepares the server require_once $this->getFilePath('TestPhpInputStream.php'); \TestPhpInputStream::register(); \TestPhpInputStream::setContent(file_get_contents($this->getFilePath($test . '.' . $this->getFileExtension()))); // We need to capture the output ob_start(); // On purpose @ because of the "headers already sent" warning @$this->rpc->process(); $output = ob_get_clean(); $this->assertStringEqualsFile($this->getFilePath($test . '-expected.' . $this->getFileExtension()), $output); // Server cleanup \TestPhpInputStream::unregister(); }