/**
  * @return SchemaContainer
  */
 public static function instance()
 {
     $schemaContainer = new SchemaContainer(self::getBingGeneratorInstance());
     $schemaContainer->add(new Schema(self::getBingGeneratorInstance(), self::SCHEMA_BING, file_get_contents(self::wsdlBingPath())));
     $schemaContainer->add(new Schema(self::getBingGeneratorInstance(), self::SCHEMA_EBAY, file_get_contents(self::wsdlEbayPath())));
     return $schemaContainer;
 }
 /**
  *
  */
 public function testGetExternalSchemasScd()
 {
     // import tag must be parsed first
     $tagIncludeParser = self::instanceScd();
     $tagIncludeParser->parse();
     $schemaContainer = new SchemaContainer($tagIncludeParser->getGenerator());
     $schema1Path = realpath(__DIR__ . '/../../resources/docdatapayments/1_3.1.xsd');
     $schema1 = new Schema($tagIncludeParser->getGenerator(), $schema1Path, file_get_contents($schema1Path));
     $schema1->getContent()->setCurrentTag(WsdlDocument::TAG_INCLUDE);
     $schemaContainer->add($schema1);
     $schema2Path = realpath(__DIR__ . '/../../resources/docdatapayments/1_3.2.xsd');
     $schema2 = new Schema($tagIncludeParser->getGenerator(), $schema2Path, file_get_contents($schema2Path));
     $schema2->getContent()->setCurrentTag(WsdlDocument::TAG_INCLUDE);
     $schemaContainer->add($schema2);
     $tagIncludeParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas()->rewind();
     $this->assertEquals($schemaContainer, $tagIncludeParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas());
 }
 /**
  *
  */
 public function testGetExternalSchemas()
 {
     $tagIncludeParser = self::instance();
     $tagIncludeParser->parse();
     $schemas = array('availableImagesRequest.xsd', 'availableImagesResponse.xsd', 'imagesRequest.xsd', 'imagesResponse.xsd', 'imageViewCommon.xsd');
     $schemaContainer = new SchemaContainer($tagIncludeParser->getGenerator());
     foreach ($schemas as $schemaPath) {
         $schemaPath = realpath(sprintf(__DIR__ . '/../../resources/image/%s', $schemaPath));
         $schema = new Schema($tagIncludeParser->getGenerator(), $schemaPath, file_get_contents($schemaPath));
         $schema->getContent()->setCurrentTag('include');
         $schemaContainer->add($schema);
     }
     $tagIncludeParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas()->rewind();
     $this->assertEquals($schemaContainer, $tagIncludeParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas());
 }
Esempio n. 4
0
 /**
  * @param Model $schema
  * @return \WsdlToPhp\PackageGenerator\DomHandler\Wsdl\Wsdl
  */
 public function addExternalSchema(Model $schema)
 {
     $this->externalSchemas->add($schema);
     return $this;
 }
 /**
  *
  */
 public function testGetExternalSchemasFourth()
 {
     $tagImportParser = self::instanceFourth();
     $tagImportParser->parse();
     $schemaContainer = new SchemaContainer($tagImportParser->getGenerator());
     $schemaPath = realpath(__DIR__ . '/../../resources/docdatapayments/1_3.1.xsd');
     $schema = new Schema($tagImportParser->getGenerator(), $schemaPath, file_get_contents($schemaPath));
     $schema->getContent()->setCurrentTag('import');
     $schemaContainer->add($schema);
     $schemaPath = realpath(__DIR__ . '/../../resources/docdatapayments/1_3.2.xsd');
     $schema = new Schema($tagImportParser->getGenerator(), $schemaPath, file_get_contents($schemaPath));
     $schema->getContent()->setCurrentTag('import');
     $schemaContainer->add($schema);
     $tagImportParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas()->rewind();
     $this->assertEquals($schemaContainer, $tagImportParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas());
 }
Esempio n. 6
0
 /**
  *
  */
 public function testGetExternalSchemasThird()
 {
     $tagImportParser = self::instanceThird();
     $tagImportParser->parse();
     $schemaContainer = new SchemaContainer($tagImportParser->getGenerator());
     for ($i = 0; $i < 19; $i++) {
         $schemaPath = realpath(sprintf(__DIR__ . '/../../resources/partner/PartnerService.%d.xsd', $i));
         $schema = new Schema($tagImportParser->getGenerator(), $schemaPath, file_get_contents($schemaPath));
         $schema->getContent()->setCurrentTag('import');
         $schemaContainer->add($schema);
     }
     $tagImportParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas()->rewind();
     $this->assertEquals($schemaContainer, $tagImportParser->getGenerator()->getWsdl()->getContent()->getExternalSchemas());
 }