/** * Logs the SOAP XML to the Logger::$SOAP_XML_LOG log after the request has * transformed by PrepareRequest() and both the request and response have * been sanitized by RemoveSensitiveInfo(). * @param string $level the log level to use * @see PrepareRequest() * @see RemoveSensitiveInfo() */ private function LogSoapXml($level) { $message = sprintf("%s\n\n%s\n\n%s\n\n%s\n", trim($this->__getLastRequestHeaders()), XmlUtils::PrettyPrint($this->lastRequest), trim($this->__getLastResponseHeaders()), XmlUtils::PrettyPrint($this->lastResponse)); Logger::log(Logger::$SOAP_XML_LOG, $message, $level); }
/** * @covers XmlSerializer::ConvertObjectToXml * @covers XmlSerializer::ConvertObjectToElement * @covers XmlSerializer::ConvertObjectToNodeValue */ public function testConvertObjectToXmlReportDefinition() { $serializer = new XmlSerializer(); $result = $serializer->ConvertObjectToXml(XmlTestHelper::$REPORT_DEFINITION_OBJECT, 'reportDefinition', false); $this->assertEquals(XmlTestHelper::$REPORT_DEFINITION_XML, XmlUtils::PrettyPrint($result)); }
/** * Test pretty printing an XML string. * @param string $xml the XML string to pretty print * @param string $expected the expected result of pretty printing the XML * @covers XmlUtils::PrettyPrint * @dataProvider PrettyXmlProvider */ public function testPrettyPrint($xml, $expected) { $result = XmlUtils::PrettyPrint($xml); $this->assertEquals($expected, $result); }
/** * @covers XmlSerializer::ConvertObjectToXml * @covers XmlSerializer::ConvertObjectToElement * @covers XmlSerializer::ConvertObjectToNodeValue */ public function testConvertObjectToXmlReportDownloadErrorFormatted() { $serializer = new XmlSerializer(); $result = $serializer->ConvertObjectToXml(XmlTestHelper::$REPORT_DOWNLOAD_ERROR_OBJECT, 'reportDownloadError', false); $this->assertEquals(XmlTestHelper::$REPORT_DOWNLOAD_ERROR_FORMATTED_XML, XmlUtils::PrettyPrint($result)); }