/** * Replace WSDL xml encoding from config, if present, else default to UTF-8 and set it to the response object. * * @param string $responseBody * @return $this */ protected function _setResponseBody($responseBody) { $this->_response->setBody(preg_replace('/<\\?xml version="([^\\"]+)"([^\\>]+)>/i', '<?xml version="$1" encoding="' . $this->_soapServer->getApiCharset() . '"?>', $responseBody)); return $this; }
/** * Test getApiCharset method with default encoding. */ public function testGetApiCharsetDefaultEncoding() { $this->_scopeConfig->expects($this->once())->method('getValue')->will($this->returnValue(null)); $this->assertEquals(\Magento\Webapi\Model\Soap\Server::SOAP_DEFAULT_ENCODING, $this->_soapServer->getApiCharset(), 'Default API charset encoding getting is invalid.'); }