Ejemplo n.º 1
0
 public function renderWSDLService()
 {
     $headers = apache_request_headers();
     if (empty($headers['Content-Type']) || !preg_match('#xml#i', $headers['Content-Type'])) {
         $service = new Service($this->_class, $this->_classParser->getMethods(), $this->_namespace);
         $service->render();
     }
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function shouldNotParseMagicMethods()
 {
     //given
     $classParser = new ClassParser('\\Mocks\\MockClass');
     //when
     $classParser->parse();
     //then
     $this->assertCount(6, $classParser->getMethods());
 }
Ejemplo n.º 3
0
 public function renderWSDLService()
 {
     $headers = apache_request_headers();
     if (empty($headers['Content-Type']) || !preg_match('#xml#i', $headers['Content-Type'])) {
         $newService = new Service($this->_location, $this->getWsdlLocation(), $this->_classParser->getMethods());
         $newService->render($this->_class, $this->getNamespaceWithSanitizedClass());
     }
 }
Ejemplo n.º 4
0
 public function renderWSDLService()
 {
     if (function_exists('apache_request_headers')) {
         $headers = apache_request_headers();
     } else {
         $headers = [];
         foreach ($_SERVER as $name => $value) {
             if (substr($name, 0, 5) == 'HTTP_') {
                 $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
             }
         }
     }
     if (empty($headers['Content-Type']) || !preg_match('#xml#i', $headers['Content-Type'])) {
         $newService = new Service($this->_location, $this->getWsdlLocation(), $this->_classParser->getMethods());
         $newService->render($this->_class, $this->getNamespaceWithSanitizedClass());
     }
 }
Ejemplo n.º 5
0
 /**
  * @test
  */
 public function shouldCorrectCreateWsdlWithMultipleWrappersForDocumentLiteralWrapped()
 {
     //given
     XMLGenerator::$alreadyGeneratedComplexTypes = array();
     $classParser = new ClassParser('\\Mocks\\MockMultipleWrappers');
     $classParser->parse();
     $xml = new XMLGenerator('\\Mocks\\MockMultipleWrappers', $this->_namespace, $this->_location);
     $xml->setWSDLMethods($classParser->getMethods())->setBindingStyle(new DocumentLiteralWrapped())->generate();
     //when
     $wsdl = $xml->getGeneratedXML();
     //then
     $file = Path::join(__DIR__, 'xml_file_asserts', 'multiple_wrappers.wsdl');
     $this->assertXmlStringEqualsXmlFile($file, $wsdl);
 }