Skip to content

Commit c100f06

Browse files
author
Alexander Paliarush
committed
MAGETWO-53003: System Upgrade Test does not support RC version
1 parent b366da3 commit c100f06

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

dev/tests/functional/tests/app/Magento/Upgrade/Test/TestCase/UpgradeSystemTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,19 @@ public function test(
7373
);
7474
$version = $upgrade['upgradeVersion'];
7575

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)) {
7784
$version = array_shift($out);
85+
} else {
86+
$this->fail(
87+
"Provided version format does not comply with semantic versioning specification. Got '{$version}'"
88+
);
7889
}
7990

8091
// Authenticate in admin area

0 commit comments

Comments
 (0)