18 private static $branchesFilesPattern =
__DIR__ .
'/../_files/branches*';
23 private static $changedFilesPattern =
__DIR__ .
'/../_files/changed_files*';
28 private static $changedFileList =
'';
33 private static $actualBranch =
false;
40 foreach (glob(self::$branchesFilesPattern) as $branchesFile) {
42 $branchName = trim(file($branchesFile)[0]);
43 if ($branchName ===
'develop') {
44 self::$actualBranch =
true;
47 preg_match(
'|^(\d+\.\d+)|', $branchName, $minorBranch);
48 $branchName = $minorBranch[0];
54 self::$actualBranch = ($branchName == max($matches[0]));
58 foreach (glob(self::$changedFilesPattern) as $changedFile) {
68 if (!self::$actualBranch) {
69 preg_match_all(
'|etc/module\.xml$|mi', self::$changedFileList, $matches);
72 'module.xml changes for patch releases in non-actual branches are not allowed:' . PHP_EOL .
73 implode(PHP_EOL, array_values(reset($matches)))
83 if (!self::$actualBranch) {
84 preg_match_all(
'|app/code/Magento/[^/]+/Setup/[^/]+$|mi', self::$changedFileList, $matches);
87 'Code with changes for DB schema or data in non-actual branches are not allowed:' . PHP_EOL .
88 implode(PHP_EOL, array_values(reset($matches)))
defined('TESTS_BP')||define('TESTS_BP' __DIR__
static setUpBeforeClass()