Skip to content

Commit

Permalink
Merge pull request #702 from magento-extensibility/MAGETWO-43268-n98-…
Browse files Browse the repository at this point in the history
…prefix-mb

MAGETWO-43268: n98 prefix cannot be used in resources defintion
  • Loading branch information
He, Joan(johe) committed Oct 8, 2015
2 parents b990179 + 22982cd commit dbdbfe0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,30 @@
["Element 'resource': The attribute 'name' is required but missing."],
],
'resource_name_attribute_invalid_value' => [
'<?xml version="1.0"?><config><resource name="testinvalidname1" /></config>',
'<?xml version="1.0"?><config><resource name="testinvalidname$" /></config>',
[
"Element 'resource', attribute 'name': [facet 'pattern'] The value 'testinvalidname1' is not accepted" .
" by the pattern '[A-Za-z_]+'.",
"Element 'resource', attribute 'name': 'testinvalidname1' is not a valid value of the atomic " .
"Element 'resource', attribute 'name': [facet 'pattern'] The value 'testinvalidname$' is not accepted" .
" by the pattern '[A-Za-z_0-9]+'.",
"Element 'resource', attribute 'name': 'testinvalidname$' is not a valid value of the atomic " .
"type 'nameIdentifier'.",
"Element 'resource', attribute 'name': Warning: No precomputed value available, the value was either " .
"invalid or something strange happend."
],
],
'resource_extends_attribute_invalid_value' => [
'<?xml version="1.0"?><config><resource name="test_name" extends="test1"/></config>',
'<?xml version="1.0"?><config><resource name="test_name" extends="test@"/></config>',
[
"Element 'resource', attribute 'extends': [facet 'pattern'] The value 'test1' is not accepted " .
"by the pattern '[A-Za-z_]+'.",
"Element 'resource', attribute 'extends': 'test1' is not a valid value of the atomic type 'nameIdentifier'."
"Element 'resource', attribute 'extends': [facet 'pattern'] The value 'test@' is not accepted " .
"by the pattern '[A-Za-z_0-9]+'.",
"Element 'resource', attribute 'extends': 'test@' is not a valid value of the atomic type 'nameIdentifier'."
],
],
'resource_connection_attribute_invalid_value' => [
'<?xml version="1.0"?><config><resource name="test_name" connection="test1"/></config>',
'<?xml version="1.0"?><config><resource name="test_name" connection="test#"/></config>',
[
"Element 'resource', attribute 'connection': [facet 'pattern'] The value 'test1' is not accepted " .
"by the pattern '[A-Za-z_]+'.",
"Element 'resource', attribute 'connection': 'test1' is not a valid value of the atomic" .
"Element 'resource', attribute 'connection': [facet 'pattern'] The value 'test#' is not accepted " .
"by the pattern '[A-Za-z_0-9]+'.",
"Element 'resource', attribute 'connection': 'test#' is not a valid value of the atomic" .
" type 'nameIdentifier'."
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../lib/internal/Magento/Framework/App/etc/resources.xsd">
<resource name="test_name" extends="test_extends" connection="test_connection" />
<resource name="test_name1" extends="test_extends1" connection="test_connection1" />
<resource name="test_name_two" />
</config>
4 changes: 2 additions & 2 deletions lib/internal/Magento/Framework/App/etc/resources.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
<xs:simpleType name="nameIdentifier">
<xs:annotation>
<xs:documentation>
Name identifier can contain only [A-Za-z_].
Name identifier can contain only [A-Za-z_0-9].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z_]+" />
<xs:pattern value="[A-Za-z_0-9]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>

0 comments on commit dbdbfe0

Please sign in to comment.