|
@@ 34-55 (lines=22) @@
|
| 31 |
|
$this->assertEquals($type, "xs:" . $elements[0]->getType()->getName()); |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
public function testAnonymousTypes() |
| 35 |
|
{ |
| 36 |
|
$schema = $this->reader->readString( |
| 37 |
|
' |
| 38 |
|
<xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
| 39 |
|
<xs:complexType name="complexType"> |
| 40 |
|
<xs:sequence> |
| 41 |
|
<xs:element name="el1"></xs:element> |
| 42 |
|
</xs:sequence> |
| 43 |
|
<xs:attribute name="att1"></xs:attribute> |
| 44 |
|
</xs:complexType> |
| 45 |
|
</xs:schema>'); |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
$complex = $schema->findType('complexType', 'http://www.example.com'); |
| 49 |
|
$attrs = $complex->getAttributes(); |
| 50 |
|
$elements = $complex->getElements(); |
| 51 |
|
|
| 52 |
|
$this->assertEquals("anyType", $attrs[0]->getType()->getName()); |
| 53 |
|
$this->assertEquals("anyType", $elements[0]->getType()->getName()); |
| 54 |
|
|
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
public function testAttrAttr() |
| 58 |
|
{ |
|
@@ 57-75 (lines=19) @@
|
| 54 |
|
|
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
public function testAttrAttr() |
| 58 |
|
{ |
| 59 |
|
$schema = $this->reader->readString( |
| 60 |
|
' |
| 61 |
|
<xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
| 62 |
|
<xs:complexType name="complexType"> |
| 63 |
|
<xs:sequence> |
| 64 |
|
<xs:element name="el1" nillable="true" type="xs:string" form="qualified"></xs:element> |
| 65 |
|
</xs:sequence> |
| 66 |
|
<xs:attribute name="att1" nillable="true" form="qualified" use="required" type="xs:string"></xs:attribute> |
| 67 |
|
</xs:complexType> |
| 68 |
|
</xs:schema>'); |
| 69 |
|
|
| 70 |
|
$complex = $schema->findType('complexType', 'http://www.example.com'); |
| 71 |
|
$attrs = $complex->getAttributes(); |
| 72 |
|
$this->assertTrue($attrs[0]->isNil()); |
| 73 |
|
$this->assertTrue($attrs[0]->isQualified()); |
| 74 |
|
$this->assertEquals('required', $attrs[0]->getUse()); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
public function testSequenceAll() |
| 78 |
|
{ |