File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,20 @@ public function test(
73
73
);
74
74
$ version = $ upgrade ['upgradeVersion ' ];
75
75
76
- if (preg_match ('/^[0-9].[0-9].[0-9]/ ' , $ version , $ out )) {
76
+ $ suffix = "( (CE|EE))$ " ;
77
+ $ normalVersion = '(0|[1-9]\d*) ' ;
78
+ $ preReleaseVersion = "((0(?! \\d+( \\.| \\+| {$ suffix }))|[1-9A-Za-z])[0-9A-Za-z-]*) " ;
79
+ $ buildVersion = '([0-9A-Za-z][0-9A-Za-z-]*) ' ;
80
+ $ versionPattern = "/^ {$ normalVersion }( \\. {$ normalVersion }){2} "
81
+ . "(- {$ preReleaseVersion }( \\. {$ preReleaseVersion })*)? "
82
+ . "( \\+ {$ buildVersion }( \\. {$ buildVersion })*)? {$ suffix }/ " ;
83
+
84
+ if (preg_match ($ versionPattern , $ version , $ out )) {
77
85
$ version = array_shift ($ out );
86
+ } else {
87
+ $ this ->fail (
88
+ "Provided version format does not comply with semantic versioning specification. Got ' {$ version }' "
89
+ );
78
90
}
79
91
80
92
// Authenticate in admin area
You can’t perform that action at this time.
0 commit comments