Skip to content

Commit 293f222

Browse files
committed
Merge branch 'MAGETWO-84100' of github.com:magento-trigger/magento2ce into MAGETWO-84100
2 parents 8dcda12 + 9344a8d commit 293f222

File tree

9 files changed

+32
-13
lines changed

9 files changed

+32
-13
lines changed

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,16 +451,26 @@ public function run()
451451
}
452452

453453
/**
454-
* Cleanup both the database and the file system
454+
* Create install dir for integration framework
455455
*
456456
* @return void
457457
*/
458-
public function cleanup()
458+
public function createInstallDir()
459459
{
460460
$this->_ensureDirExists($this->installDir);
461461
$this->_ensureDirExists($this->_configDir);
462462

463463
$this->copyAppConfigFiles();
464+
}
465+
466+
/**
467+
* Cleanup both the database and the file system
468+
*
469+
* @return void
470+
*/
471+
public function cleanup()
472+
{
473+
$this->createInstallDir();
464474
/**
465475
* @see \Magento\Setup\Mvc\Bootstrap\InitParamListener::BOOTSTRAP_PARAM
466476
*/

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/Magento/TestFramework/Annotation/ReinstallInstance.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public function __construct(\Magento\TestFramework\Application $application)
3333
*/
3434
public function endTest()
3535
{
36-
if ($this->application->isInstalled()) {
37-
$this->application->cleanup();
38-
}
36+
$this->application->cleanup();
3937
}
4038
}

dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/TestModuleManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function updateRevision($moduleName, $revisionName, $fileName, $fileDir)
7878

7979
if (file_exists($oldFile) && file_exists($revisionFile)) {
8080
unlink($oldFile);
81-
rename($revisionFile, $oldFile);
81+
copy($revisionFile, $oldFile);
8282
} else {
8383
throw new \InvalidArgumentException("Old File or revision files paths are invalid");
8484
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
$application,
7474
new \Magento\TestFramework\Bootstrap\MemoryFactory($shell)
7575
);
76-
$bootstrap->runBootstrap();
77-
$application->cleanup();
7876
//remove test modules files
7977
include_once __DIR__ . '/../../setup-integration/framework/removeTestModules.php';
78+
$bootstrap->runBootstrap();
79+
$application->createInstallDir();
8080
//We do not want to install anything
8181
$application->initialize([]);
8282

dev/tests/setup-integration/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
3838
<const name="TESTS_CLEANUP" value="{{tests_cleanup}}"/>
3939
<const name="TESTS_MAGENTO_MODE" value="{{app_mode}}"/>
40-
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="-1"/>
40+
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="1"/>
4141
</php>
4242
<!-- Test listeners -->
4343
<listeners>

dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeSchemaBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class DeclarativeSchemaBuilderTest extends SetupTestCase
3838
public function setUp()
3939
{
4040
$objectManager = Bootstrap::getObjectManager();
41-
$this->schemaConfig = $objectManager->create(SchemaConfig::class);
41+
$this->schemaConfig = $objectManager->get(SchemaConfig::class);
4242
$this->moduleManager = $objectManager->get(TestModuleManager::class);
4343
$this->cliCommad = $objectManager->get(CliCommand::class);
4444
}

lib/internal/Magento/Framework/Shell.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function execute($command, array $arguments = [])
5757
exec($command, $output, $exitCode);
5858
$output = implode(PHP_EOL, $output);
5959
$this->log($output);
60+
6061
if ($exitCode) {
6162
$commandError = new \Exception($output, $exitCode);
6263
throw new Exception\LocalizedException(

setup/src/Magento/Setup/Model/Declaration/Schema/Declaration/ReaderComposite.php

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

77
namespace Magento\Setup\Model\Declaration\Schema\Declaration;
88

9+
use Magento\Framework\App\DeploymentConfig;
910
use Magento\Framework\Config\ReaderInterface;
1011

1112
/**
@@ -20,14 +21,21 @@ class ReaderComposite implements ReaderInterface
2021
*/
2122
private $readers;
2223

24+
/**
25+
* @var DeploymentConfig
26+
*/
27+
private $deploymentConfig;
28+
2329
/**
2430
* Constructor.
2531
*
32+
* @param DeploymentConfig $deploymentConfig
2633
* @param ReaderInterface[] $readers
2734
*/
28-
public function __construct(array $readers = [])
35+
public function __construct(DeploymentConfig $deploymentConfig, array $readers = [])
2936
{
3037
$this->readers = $readers;
38+
$this->deploymentConfig = $deploymentConfig;
3139
}
3240

3341
/**

0 commit comments

Comments
 (0)