Skip to content

Commit 166c317

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-59304' into troll_bugfix
2 parents 77d700f + f619f37 commit 166c317

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ class ModuleDBChangeTest extends \PHPUnit_Framework_TestCase
2222
*/
2323
protected static $changedFileList = '';
2424

25+
/**
26+
* @var string Path for Magento's composer.json
27+
*/
28+
protected static $composerFilePath = BP . '/composer.json';
29+
30+
/**
31+
* @var bool Is tests executes on develop branch
32+
*/
33+
protected static $isOnDevVersion = false;
34+
2535
/**
2636
* Set changed files paths and list for all projects
2737
*/
@@ -30,13 +40,23 @@ public static function setUpBeforeClass()
3040
foreach (glob(self::$changedFilesPattern) as $changedFile) {
3141
self::$changedFileList .= file_get_contents($changedFile) . PHP_EOL;
3242
}
43+
44+
if (file_exists(self::$composerFilePath)) {
45+
$jsonData = json_decode(file_get_contents(self::$composerFilePath));
46+
if (substr((string) $jsonData->version, -4) == '-dev') {
47+
self::$isOnDevVersion = true;
48+
}
49+
}
3350
}
3451

3552
/**
3653
* Test changes for module.xml files
3754
*/
3855
public function testModuleXmlFiles()
3956
{
57+
if (self::$isOnDevVersion) {
58+
$this->markTestSkipped('This test isn\'t applicable to the developer version of Magento');
59+
}
4060
preg_match_all('|etc/module\.xml$|mi', self::$changedFileList, $matches);
4161
$this->assertEmpty(
4262
reset($matches),
@@ -50,6 +70,9 @@ public function testModuleXmlFiles()
5070
*/
5171
public function testModuleSetupFiles()
5272
{
73+
if (self::$isOnDevVersion) {
74+
$this->markTestSkipped('This test isn\'t applicable to the developer version of Magento');
75+
}
5376
preg_match_all('|app/code/Magento/[^/]+/Setup/[^/]+$|mi', self::$changedFileList, $matches);
5477
$this->assertEmpty(
5578
reset($matches),

0 commit comments

Comments
 (0)