Skip to content

Commit 5827290

Browse files
author
Sergii Kovalenko
committed
MAGETWO-62855: Copyright Year Update 2017
--fix ModuleDbChanged test
1 parent d710721 commit 5827290

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

dev/tests/static/testsuite/Magento/Test/Legacy/ModuleDBChangeTest.php

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
3+
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
66

@@ -15,7 +15,12 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase
1515
/**
1616
* @var string
1717
*/
18-
protected static $changedFilesPattern = __DIR__ . '/../_files/changed_files*';
18+
private static $branchesFilesPattern = __DIR__ . '/../_files/branches*';
19+
20+
/**
21+
* @var string
22+
*/
23+
private static $changedFilesPattern = __DIR__ . '/../_files/changed_files*';
1924

2025
/**
2126
* @var string
@@ -32,6 +37,24 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase
3237
*/
3338
public static function setUpBeforeClass()
3439
{
40+
foreach (glob(self::$branchesFilesPattern) as $branchesFile) {
41+
//get the current branchname from the first line
42+
$branchName = trim(file($branchesFile)[0]);
43+
if ($branchName === 'develop') {
44+
self::$actualBranch = true;
45+
} else {
46+
//get current minor branch name
47+
preg_match('|^(\d+\.\d+)|', $branchName, $minorBranch);
48+
$branchName = $minorBranch[0];
49+
50+
//get all version branches
51+
preg_match_all('|^(\d+\.\d+)|m', file_get_contents($branchesFile), $matches);
52+
53+
//check is this a latest release branch
54+
self::$actualBranch = ($branchName == max($matches[0]));
55+
}
56+
}
57+
3558
foreach (glob(self::$changedFilesPattern) as $changedFile) {
3659
self::$changedFileList .= file_get_contents($changedFile) . PHP_EOL;
3760
}

0 commit comments

Comments
 (0)