Skip to content

Commit 5f5de4b

Browse files
author
Ivan Gavryshko
committed
MAGETWO-38838: Create composer management library and reuse it in both updater and setup wizard
- Changed COMPOSER env to --working-dir
1 parent e0a5a54 commit 5f5de4b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/code/Magento/Composer/MagentoComposerApplication.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public function setConfig($pathToComposerHome, $pathToComposerJson)
7171
$this->composerHome = $pathToComposerHome;
7272

7373
putenv('COMPOSER_HOME=' . $pathToComposerHome);
74-
putenv('COMPOSER=' . $pathToComposerJson);
7574

7675
$this->consoleApplication->setAutoExit(false);
7776
$this->configIsSet = true;
@@ -110,6 +109,8 @@ public function runComposerCommand(array $commandParams)
110109

111110
$this->consoleApplication->resetComposer();
112111

112+
$commandParams['--working-dir'] = dirname($this->composerJson);
113+
113114
$input = $this->consoleArrayInputFactory->create($commandParams);
114115

115116
$exitCode = $this->consoleApplication->run($input, $this->consoleOutput);

dev/tests/unit/MagentoComposerApplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function testWrongExitCode()
7878

7979
function testRunCommand()
8080
{
81-
$inputData = ['command'=>'update'];
81+
$inputData = ['command'=>'update', '--working-dir' => '.'];
8282

8383
$this->application->setConfig('path1', 'path2');
8484
$this->composerApplication->expects($this->once())->method('resetComposer');

0 commit comments

Comments
 (0)