| Total Complexity | 1 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 4 | class ImportTest extends BaseTest |
||
| 5 | { |
||
| 6 | |||
| 7 | |||
| 8 | public function testBase() |
||
| 9 | { |
||
| 10 | $remoteSchema = $this->reader->readString( |
||
| 11 | ' |
||
| 12 | <xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||
| 13 | <xs:attribute name="myAttribute" type="xs:string"></xs:attribute> |
||
| 14 | </xs:schema>', 'http://www.example.com/xsd.xsd'); |
||
| 15 | |||
| 16 | |||
| 17 | $schema = $this->reader->readString( |
||
| 18 | ' |
||
| 19 | <xs:schema targetNamespace="http://www.user.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ex="http://www.example.com"> |
||
| 20 | <xs:import schemaLocation="http://www.example.com/xsd.xsd" namespace="http://www.example.com"></xs:import> |
||
| 21 | |||
| 22 | <xs:attributeGroup name="myAttributeGroup"> |
||
| 23 | <xs:attribute ref="ex:myAttribute"></xs:attribute> |
||
| 24 | </xs:attributeGroup> |
||
| 25 | |||
| 26 | </xs:schema>'); |
||
| 27 | |||
| 28 | $this->assertContains($remoteSchema, $schema->getSchemas(), false, true); |
||
| 29 | |||
| 30 | $remoteAttr = $remoteSchema->findAttribute("myAttribute", "http://www.example.com"); |
||
| 31 | $localAttr = $schema->findAttribute("myAttribute", "http://www.example.com"); |
||
| 32 | |||
| 33 | $this->assertSame($remoteAttr, $localAttr); |
||
| 34 | |||
| 35 | $localAttrGroup = $schema->findAttributeGroup("myAttributeGroup", "http://www.user.com"); |
||
| 36 | $localAttrs = $localAttrGroup->getAttributes(); |
||
| 37 | |||
| 38 | $this->assertSame($remoteAttr, $localAttrs[0]); |
||
| 39 | } |
||
| 41 |