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