Skip to content

Commit 28d288b

Browse files
committed
MAGETWO-37710: Setup wizard fails in readiness check when magento is deployed by composer create-project
- Get version from AppInterface - fix code formatting
1 parent 81d96d1 commit 28d288b

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

dev/tests/integration/testsuite/Magento/Setup/Model/ComposerInformationTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testGetRequiredExtensions($composerDir)
8181
$expectedExtensions = ['ctype', 'gd', 'spl', 'dom', 'simplexml', 'mcrypt', 'hash', 'curl', 'iconv', 'intl'];
8282

8383
$actualRequiredExtensions = $composerInfo->getRequiredExtensions();
84-
foreach($expectedExtensions as $expectedExtension) {
84+
foreach ($expectedExtensions as $expectedExtension) {
8585
$this->assertContains($expectedExtension, $actualRequiredExtensions);
8686
}
8787
}
@@ -104,7 +104,8 @@ public function getRequiredPhpVersionDataProvider()
104104
* @expectedException \Exception
105105
* @expectedExceptionMessage Composer file not found:
106106
*/
107-
public function testNoLock() {
107+
public function testNoLock()
108+
{
108109
$this->setupDirectoryMock('notARealDirectory');
109110
new ComposerInformation($this->filesystemMock, $this->ioMock);
110111
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<?php
22
/**
3-
* Path to Composer vendor directory
4-
*/
5-
return './vendor';
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/**
8+
* Path to Composer vendor directory
9+
*/
10+
return './vendor';

setup/src/Magento/Setup/Controller/Landing.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,15 @@
66

77
namespace Magento\Setup\Controller;
88

9-
use Composer\Json\JsonFile;
10-
use Magento\Framework\App\Filesystem\DirectoryList;
9+
use Magento\Framework\AppInterface;
1110
use Zend\Mvc\Controller\AbstractActionController;
1211
use Zend\View\Model\ViewModel;
1312

13+
/**
14+
* Controller for Setup Landing page
15+
*/
1416
class Landing extends AbstractActionController
1517
{
16-
/**
17-
* @var array
18-
*/
19-
protected $composerJson;
20-
21-
/**
22-
* @param DirectoryList $directoryList
23-
*/
24-
public function __construct(
25-
DirectoryList $directoryList
26-
) {
27-
$jsonFile = new JsonFile($directoryList->getRoot() . '/composer.json');
28-
$this->composerJson = $jsonFile->read();
29-
}
30-
3118
/**
3219
* @return array|ViewModel
3320
*/
@@ -37,7 +24,7 @@ public function indexAction()
3724
$view->setTerminal(true);
3825
$view->setVariable('languages', $this->serviceLocator->get('config')['languages']);
3926
$view->setVariable('location', 'en_US');
40-
$view->setVariable('version', $this->composerJson['version']);
27+
$view->setVariable('version', AppInterface::VERSION);
4128
return $view;
4229
}
4330
}

0 commit comments

Comments
 (0)