Skip to content

Commit 9344a8d

Browse files
author
Sergii Kovalenko
committed
MAGETWO-87190: Test coverage for critical logic
1 parent ad04af9 commit 9344a8d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/registration.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66

77
use Magento\Framework\Component\ComponentRegistrar;
88

9-
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule1', __DIR__);
9+
$registrar = new ComponentRegistrar();
10+
if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule1') === null) {
11+
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestSetupDeclarationModule1', __DIR__);
12+
}

dev/tests/setup-integration/framework/Magento/TestFramework/Annotation/CopyModules.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace Magento\TestFramework\Annotation;
88

9-
use Magento\Framework\Filesystem\Io\File;
109
use Magento\TestFramework\Deploy\CliCommand;
1110
use Magento\TestFramework\Deploy\TestModuleManager;
1211

@@ -45,7 +44,10 @@ public function startTest(\PHPUnit\Framework\TestCase $test)
4544
$annotations = $test->getAnnotations();
4645
//This annotation can be declared only on method level
4746
if (isset($annotations['method']['moduleName'])) {
48-
$this->cliCommand->introduceModule($annotations['method']['moduleName'][0]);
47+
$moduleName = $annotations['method']['moduleName'][0];
48+
$this->cliCommand->introduceModule($moduleName);
49+
$path = MAGENTO_MODULES_PATH . explode("_", $moduleName)[1] . '/registration.php';
50+
include_once $path;
4951
}
5052
}
5153
}

dev/tests/setup-integration/framework/bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
$application,
7474
new \Magento\TestFramework\Bootstrap\MemoryFactory($shell)
7575
);
76+
//remove test modules files
77+
include_once __DIR__ . '/../../setup-integration/framework/removeTestModules.php';
7678
$bootstrap->runBootstrap();
7779
$application->createInstallDir();
7880
//We do not want to install anything

0 commit comments

Comments
 (0)