Skip to content

Commit 6fc80f3

Browse files
author
Karpenko, Oleksandr
committed
Merge branch 'MAGETWO-55279' of github.com:magento-frontend/magento2ce into PR
2 parents cc90c55 + 1d8a601 commit 6fc80f3

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

lib/internal/Magento/Framework/Config/Test/Unit/XsdTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ public function testInvalidXmlFile($xsdFile, $invalidXmlFile, $expectedErrorsQty
3838
*/
3939
public function invalidXmlFileDataProvider()
4040
{
41-
return [['view.xsd', 'view_invalid.xml', 1], ['theme.xsd', 'theme_invalid.xml', 1]];
41+
return [['view.xsd', 'view_invalid.xml', 8], ['theme.xsd', 'theme_invalid.xml', 1]];
4242
}
4343
}

lib/internal/Magento/Framework/Config/Test/Unit/_files/view_invalid.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,21 @@
1010
<var name="var1">Value1</var>
1111
<var name="var1">Value1</var><!-- duplicate var name -->
1212
</vars>
13+
<media>
14+
<images module="Magento_Catalog">
15+
<!-- Valid image type values -->
16+
<image id="test" type="valid"/>
17+
<image id="test" type="valid_image"/>
18+
<image id="test" type="valid_image_type"/>
19+
<!-- Invalid image type values -->
20+
<image id="test" type="_invalid_image_type"/>
21+
<image id="test" type="invalid-image"/>
22+
<image id="test" type="Invalid"/>
23+
<image id="test" type="invalid_"/>
24+
<image id="test" type="invalid__image"/>
25+
<image id="test" type="i"/>
26+
<image id="test" type="?invalid"/>
27+
<image id="test" type="123"/>
28+
</images>
29+
</media>
1330
</view>

lib/internal/Magento/Framework/Config/etc/view.xsd

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,22 @@
6666
<xs:attribute name="id" type="xs:string" use="required"/>
6767
<xs:attribute name="type">
6868
<xs:simpleType>
69-
<xs:restriction base="xs:string">
70-
<xs:enumeration value="thumbnail"/>
71-
<xs:enumeration value="small_image"/>
72-
<xs:enumeration value="image"/>
73-
<xs:enumeration value="swatch_image"/>
74-
<xs:enumeration value="swatch_thumb"/>
75-
</xs:restriction>
69+
<xs:union>
70+
<xs:simpleType>
71+
<xs:restriction base="xs:string">
72+
<xs:enumeration value="thumbnail"/>
73+
<xs:enumeration value="small_image"/>
74+
<xs:enumeration value="image"/>
75+
<xs:enumeration value="swatch_image"/>
76+
<xs:enumeration value="swatch_thumb"/>
77+
</xs:restriction>
78+
</xs:simpleType>
79+
<xs:simpleType>
80+
<xs:restriction base="xs:string">
81+
<xs:pattern value="[a-z]+(_?[a-z])+"/>
82+
</xs:restriction>
83+
</xs:simpleType>
84+
</xs:union>
7685
</xs:simpleType>
7786
</xs:attribute>
7887
</xs:complexType>

0 commit comments

Comments
 (0)