From 9c997189a033a0bfbdd578d7e3d7222a3665e77a Mon Sep 17 00:00:00 2001
From: Eddie Lau
Date: Mon, 31 Aug 2015 12:00:27 -0500
Subject: [PATCH 01/23] MAGETWO-41553: [Github] Not all required PHP extensions
are checked in setup
- added required extension to composer.json
---
composer.json | 1 +
composer.lock | 39 ++++++++++++++++++++-------------------
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/composer.json b/composer.json
index e447e81b3a0d0..da35322abddd9 100644
--- a/composer.json
+++ b/composer.json
@@ -61,6 +61,7 @@
"ext-intl": "*",
"ext-xsl": "*",
"ext-mbstring": "*",
+ "ext-pdo_mysql": "*",
"sjparkinson/static-review": "~4.1",
"fabpot/php-cs-fixer": "~1.2",
"lusitanian/oauth": "~0.3"
diff --git a/composer.lock b/composer.lock
index d2fd58a42d594..def69720ed766 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "b06fa6ec127580416633b88e4ea6a6d0",
+ "hash": "a47eff2843a02e74591f5c458fd55060",
"packages": [
{
"name": "braintree/braintree_php",
@@ -94,7 +94,7 @@
"Composer": "src/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -223,7 +223,7 @@
"MagentoHackathon\\Composer\\Magento": "src/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"OSL-3.0"
],
@@ -293,7 +293,7 @@
"Zend_": "library/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"include-path": [
"library/"
],
@@ -409,7 +409,7 @@
"lessc.inc.php"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
@@ -613,7 +613,7 @@
"Psr\\Log\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -657,7 +657,7 @@
"Seld\\JsonLint\\": "src/Seld/JsonLint/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -902,7 +902,7 @@
"cssmin.php"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -2552,7 +2552,7 @@
"League\\CLImate\\": "src/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2613,7 +2613,7 @@
"OAuth\\Unit": "tests"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2668,7 +2668,7 @@
"PDepend\\": "src/main/php/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -2709,7 +2709,7 @@
"PHPMD\\": "src/main/php"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -2822,7 +2822,7 @@
"File/"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
@@ -3025,7 +3025,7 @@
"src/"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"include-path": [
"",
"../../symfony/yaml/"
@@ -3200,7 +3200,7 @@
"src/"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -3464,7 +3464,7 @@
"StaticReview\\": "src/"
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -3535,7 +3535,7 @@
"CodeSniffer/Standards/Zend/Sniffs/"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
@@ -3893,6 +3893,7 @@
"ext-iconv": "*",
"ext-intl": "*",
"ext-xsl": "*",
- "ext-mbstring": "*"
+ "ext-mbstring": "*",
+ "ext-pdo_mysql": "*"
}
}
From 8c5660afde75df680843847e2a24d2f2e7532d3e Mon Sep 17 00:00:00 2001
From: Safwan Khan
Date: Mon, 31 Aug 2015 17:21:06 -0500
Subject: [PATCH 02/23] MAGETWO-30737: [Usability] UI installer wording
improvements
- Changed the wording.
---
setup/view/magento/setup/landing.phtml | 4 ++--
setup/view/magento/setup/web-configuration.phtml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/setup/view/magento/setup/landing.phtml b/setup/view/magento/setup/landing.phtml
index 1c02d8970ddd0..07ce620501372 100644
--- a/setup/view/magento/setup/landing.phtml
+++ b/setup/view/magento/setup/landing.phtml
@@ -13,9 +13,9 @@
version; ?>
- Welcome to Magento Admin, your online store headquarters.
+ Welcome to the Magento Admin, your online store headquarters.
- Click 'Agree and Set Up Magento' or read Getting Started to learn more.
+ Click 'Agree and Set Up Magento' to continue or read Getting Started to learn more.
- Use Web Server Apache Rewrites
+ Use Apache Web Server Rewrites
From 03e71282539f741f29ed785d4ae104895a1e1b54 Mon Sep 17 00:00:00 2001
From: Eddie Lau
Date: Fri, 11 Sep 2015 10:44:07 -0500
Subject: [PATCH 03/23] MAGETWO-42770: Use sample data checkbox disabled even
if Sample Data codebase is present
- fixed sample data checkbox disabled
---
.../src/Magento/Setup/Controller/CustomizeYourStore.php | 9 ++++-----
.../Test/Unit/Controller/CustomizeYourStoreTest.php | 4 ++--
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/setup/src/Magento/Setup/Controller/CustomizeYourStore.php b/setup/src/Magento/Setup/Controller/CustomizeYourStore.php
index fe24ddcd5e586..5712a25dbfbb9 100644
--- a/setup/src/Magento/Setup/Controller/CustomizeYourStore.php
+++ b/setup/src/Magento/Setup/Controller/CustomizeYourStore.php
@@ -5,9 +5,8 @@
*/
namespace Magento\Setup\Controller;
-use Magento\Framework\App\Filesystem\DirectoryList;
use Magento\Framework\Filesystem;
-use Magento\Framework\Module\ModuleList;
+use Magento\Framework\Module\FullModuleList;
use Magento\Framework\Setup\Lists;
use Magento\Setup\Model\ObjectManagerProvider;
use Zend\Mvc\Controller\AbstractActionController;
@@ -17,7 +16,7 @@
class CustomizeYourStore extends AbstractActionController
{
/**
- * @var ModuleList
+ * @var FullModuleList
*/
protected $moduleList;
@@ -32,11 +31,11 @@ class CustomizeYourStore extends AbstractActionController
protected $objectManagerProvider;
/**
- * @param ModuleList $moduleList
+ * @param FullModuleList $moduleList
* @param Lists $list
* @param ObjectManagerProvider $objectManagerProvider
*/
- public function __construct(ModuleList $moduleList, Lists $list, ObjectManagerProvider $objectManagerProvider)
+ public function __construct(FullModuleList $moduleList, Lists $list, ObjectManagerProvider $objectManagerProvider)
{
$this->moduleList = $moduleList;
$this->list = $list;
diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/CustomizeYourStoreTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/CustomizeYourStoreTest.php
index 84a69a4f67a3e..bbefdd16a94cd 100644
--- a/setup/src/Magento/Setup/Test/Unit/Controller/CustomizeYourStoreTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Controller/CustomizeYourStoreTest.php
@@ -31,7 +31,7 @@ class CustomizeYourStoreTest extends \PHPUnit_Framework_TestCase
private $objectManager;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Module\ModuleList
+ * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Module\FullModuleList
*/
private $moduleList;
@@ -48,7 +48,7 @@ public function setup()
false
);
$this->lists = $this->getMock('\Magento\Framework\Setup\Lists', [], [], '', false);
- $this->moduleList = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
+ $this->moduleList = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
$this->controller = new CustomizeYourStore($this->moduleList, $this->lists, $objectManagerProvider);
}
From 8cb8b50e7904f7397f9948902858e0ab7fb48c1e Mon Sep 17 00:00:00 2001
From: Eddie Lau
Date: Fri, 11 Sep 2015 12:44:23 -0500
Subject: [PATCH 04/23] MAGETWO-42770: Use sample data checkbox disabled even
if Sample Data codebase is present
- make checkbox disabled when unselect Sample Data module in advanced settings
---
setup/pub/magento/setup/customize-your-store.js | 17 ++++++++++++++++-
.../magento/setup/customize-your-store.phtml | 2 +-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/setup/pub/magento/setup/customize-your-store.js b/setup/pub/magento/setup/customize-your-store.js
index ef4721f703ab7..fd3ae0b4b7156 100644
--- a/setup/pub/magento/setup/customize-your-store.js
+++ b/setup/pub/magento/setup/customize-your-store.js
@@ -24,7 +24,8 @@ angular.module('customize-your-store', ['ngStorage', 'ngSanitize'])
force: false,
advanced: {
expanded: false
- }
+ },
+ sampleDataModuleSelected: true
};
$scope.loading = false;
@@ -190,5 +191,19 @@ angular.module('customize-your-store', ['ngStorage', 'ngSanitize'])
$scope.customizeStore.submitted = false;
}
});
+
+ $scope.$watch(
+ function() { return $scope.store.selectedModules.indexOf('Magento_SampleData') > -1; },
+ function(selected) {
+ if ($scope.store.loadedAllModules) {
+ if (selected) {
+ $scope.store.sampleDataModuleSelected = true;
+ } else {
+ $scope.store.useSampleData = false;
+ $scope.store.sampleDataModuleSelected = false;
+ }
+ }
+ }
+ );
}])
;
diff --git a/setup/view/magento/setup/customize-your-store.phtml b/setup/view/magento/setup/customize-your-store.phtml
index e392296753f3f..e9d05fe9a1e7b 100644
--- a/setup/view/magento/setup/customize-your-store.phtml
+++ b/setup/view/magento/setup/customize-your-store.phtml
@@ -38,7 +38,7 @@
class="form-el-checkbox"
type="checkbox"
ng-model="store.useSampleData"
- isSampledataEnabled ? '' : 'disabled' ?>
+ ng-disabled="isSampledataEnabled ? 'false' : 'true' ?> || !store.sampleDataModuleSelected"
>
Use Sample Data
From 53821b70c2ed6ebf49a8ab57c84dfe8e6fa65261 Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Tue, 15 Sep 2015 18:31:27 -0500
Subject: [PATCH 05/23] MAGETWO-42856: Make cleanup of var/generation optional
- add keep-generated option
- skip cleanup of var/generation and OM reset if keep-generated is set
---
.../Setup/Console/Command/UpgradeCommand.php | 33 +++++++++++---
setup/src/Magento/Setup/Model/Installer.php | 44 +++++++++++++------
.../Setup/Test/Unit/Model/InstallerTest.php | 42 +++++++++++++++++-
3 files changed, 97 insertions(+), 22 deletions(-)
diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
index e5605051d48d7..d5d73d7ed141e 100644
--- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
+++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
@@ -5,16 +5,23 @@
*/
namespace Magento\Setup\Console\Command;
+use Magento\Framework\Setup\ConsoleLogger;
+use Magento\Setup\Model\InstallerFactory;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Magento\Setup\Model\InstallerFactory;
-use Magento\Framework\Setup\ConsoleLogger;
/**
* Command for updating installed application after the code base has changed
*/
class UpgradeCommand extends AbstractSetupCommand
{
+
+ /**
+ * Option to skip deletion of var/generation directory
+ */
+ const INPUT_KEY_KEEP_GENERATED = 'keep-generated';
+
/**
* Installer service factory
*
@@ -38,10 +45,19 @@ public function __construct(InstallerFactory $installerFactory)
*/
protected function configure()
{
+ $options = [
+ new InputOption(
+ self::INPUT_KEY_KEEP_GENERATED,
+ null,
+ InputOption::VALUE_NONE,
+ 'Prevents generated code from being deleted. ' . PHP_EOL .
+ 'We discourage using this option except when deploying to production. ' . PHP_EOL .
+ 'Consult your system integrator or administrator for more information.'
+ )
+ ];
$this->setName('setup:upgrade')
- ->setDescription(
- 'Upgrades the Magento application, DB data, and schema'
- );
+ ->setDescription('Upgrades the Magento application, DB data, and schema')
+ ->setDefinition($options);
parent::configure();
}
@@ -50,10 +66,13 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
+ $keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED);
$installer = $this->installerFactory->create(new ConsoleLogger($output));
- $installer->updateModulesSequence();
+ $installer->updateModulesSequence($keepGenerated);
$installer->installSchema();
$installer->installDataFixtures();
- $output->writeln('Please re-run Magento compile command ');
+ if (!$keepGenerated) {
+ $output->writeln('Please re-run Magento compile command ');
+ }
}
}
diff --git a/setup/src/Magento/Setup/Model/Installer.php b/setup/src/Magento/Setup/Model/Installer.php
index 51692aebce752..e6608fd00256d 100644
--- a/setup/src/Magento/Setup/Model/Installer.php
+++ b/setup/src/Magento/Setup/Model/Installer.php
@@ -912,27 +912,17 @@ public function installAdminUser($data)
/**
* Updates modules in deployment configuration
*
+ * @param bool $keepGeneratedCode Cleanup var/generation and reset ObjectManager
* @return void
*/
- public function updateModulesSequence()
+ public function updateModulesSequence($keepGeneratedCode = false)
{
$this->assertDeploymentConfigExists();
$this->clearCache();
- $this->log->log('File system cleanup:');
- $messages = $this->cleanupFiles->clearCodeGeneratedClasses();
- // unload Magento autoloader because it may be using compiled definition
- foreach (spl_autoload_functions() as $autoloader) {
- if ($autoloader[0] instanceof \Magento\Framework\Code\Generator\Autoloader) {
- spl_autoload_unregister([$autoloader[0], $autoloader[1]]);
- break;
- }
- }
- // Corrected Magento autoloader will be loaded upon next get() call on $this->objectManagerProvider
- $this->objectManagerProvider->reset();
- foreach ($messages as $message) {
- $this->log->log($message);
+ if (!$keepGeneratedCode) {
+ $this->cleanupGeneratedCode();
}
$this->log->log('Updating modules:');
$this->createModulesConfig([]);
@@ -1209,4 +1199,30 @@ private function generateListOfModuleContext($resource, $type)
}
return $moduleContextList;
}
+
+ /**
+ * Clear var/generation and reset object manager
+ *
+ * @return void
+ */
+ private function cleanupGeneratedCode()
+ {
+ $this->log->log('File system cleanup:');
+ $messages = $this->cleanupFiles->clearCodeGeneratedClasses();
+
+ // unload Magento autoloader because it may be using compiled definition
+ foreach (spl_autoload_functions() as $autoloader) {
+ if ($autoloader[0] instanceof \Magento\Framework\Code\Generator\Autoloader) {
+ spl_autoload_unregister([$autoloader[0], $autoloader[1]]);
+ break;
+ }
+ }
+
+ // Corrected Magento autoloader will be loaded upon next get() call on $this->objectManagerProvider
+ $this->objectManagerProvider->reset();
+
+ foreach ($messages as $message) {
+ $this->log->log($message);
+ }
+ }
}
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
index ac7907be62fbf..c9cb8176c15eb 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
@@ -363,7 +363,47 @@ public function testUpdateModulesSequence()
$this->logger->expects($this->at(2))->method('log')
->with('The directory \'/generation\' doesn\'t exist - skipping cleanup');
$this->logger->expects($this->at(3))->method('log')->with('Updating modules:');
- $newObject->updateModulesSequence();
+ $newObject->updateModulesSequence(false);
+ }
+
+ public function testUpdateModulesSequenceKeepGenerated()
+ {
+ $allModules = [
+ 'Foo_One' => [],
+ 'Bar_Two' => [],
+ 'New_Module' => [],
+ ];
+ $this->cleanupFiles->expects($this->never())->method('clearCodeGeneratedClasses');
+
+ $cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
+ $cache->expects($this->once())->method('clean');
+ $this->objectManager->expects($this->once())
+ ->method('create')
+ ->will($this->returnValueMap([
+ ['Magento\Framework\App\Cache', [], $cache],
+ ]));
+
+ $this->moduleLoader->expects($this->once())->method('load')->willReturn($allModules);
+
+ $expectedModules = [
+ ConfigFilePool::APP_CONFIG => [
+ 'modules' => [
+ 'Bar_Two' => 0,
+ 'Foo_One' => 1,
+ 'New_Module' => 1
+ ]
+ ]
+ ];
+
+ $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
+
+ $newObject = $this->createObject(false, false);
+ $this->configReader->expects($this->once())->method('load')
+ ->willReturn(['modules' => ['Bar_Two' => 0, 'Foo_One' => 1, 'Old_Module' => 0] ]);
+ $this->configWriter->expects($this->once())->method('saveConfig')->with($expectedModules);
+ $this->logger->expects($this->at(0))->method('log')->with('Cache cleared successfully');
+ $this->logger->expects($this->at(1))->method('log')->with('Updating modules:');
+ $newObject->updateModulesSequence(true);
}
public function testUninstall()
From e4fbdf26d8cdf1b45382152b8790d5d383a8ab03 Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Wed, 16 Sep 2015 10:31:20 -0500
Subject: [PATCH 06/23] MAGETWO-42856: Make cleanup of var/generation optional
- remove blank line
---
setup/src/Magento/Setup/Console/Command/UpgradeCommand.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
index d5d73d7ed141e..508b68e952812 100644
--- a/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
+++ b/setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
@@ -16,7 +16,6 @@
*/
class UpgradeCommand extends AbstractSetupCommand
{
-
/**
* Option to skip deletion of var/generation directory
*/
From e85b8956108956c42ab8cb2b254d27c0f7c15132 Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Wed, 16 Sep 2015 11:45:43 -0500
Subject: [PATCH 07/23] MAGETWO-42856: Make cleanup of var/generation optional
- Refactor code for reuse within test
---
.../Setup/Test/Unit/Model/InstallerTest.php | 111 ++++++++----------
1 file changed, 48 insertions(+), 63 deletions(-)
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
index c9cb8176c15eb..7a3a638b70846 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
@@ -319,11 +319,6 @@ public function testCheckApplicationFilePermissions()
public function testUpdateModulesSequence()
{
- $allModules = [
- 'Foo_One' => [],
- 'Bar_Two' => [],
- 'New_Module' => [],
- ];
$this->cleanupFiles->expects($this->once())->method('clearCodeGeneratedClasses')->will(
$this->returnValue(
[
@@ -331,81 +326,28 @@ public function testUpdateModulesSequence()
]
)
);
+ $installer = $this->prepareForUpdateModulesTests();
- $cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
- $cache->expects($this->once())->method('clean');
- $this->objectManager->expects($this->once())
- ->method('create')
- ->will($this->returnValueMap([
- ['Magento\Framework\App\Cache', [], $cache],
- ]));
-
- $this->moduleLoader->expects($this->once())->method('load')->willReturn($allModules);
-
- $expectedModules = [
- ConfigFilePool::APP_CONFIG => [
- 'modules' => [
- 'Bar_Two' => 0,
- 'Foo_One' => 1,
- 'New_Module' => 1
- ]
- ]
- ];
-
- $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
-
- $newObject = $this->createObject(false, false);
- $this->configReader->expects($this->once())->method('load')
- ->willReturn(['modules' => ['Bar_Two' => 0, 'Foo_One' => 1, 'Old_Module' => 0] ]);
- $this->configWriter->expects($this->once())->method('saveConfig')->with($expectedModules);
$this->logger->expects($this->at(0))->method('log')->with('Cache cleared successfully');
$this->logger->expects($this->at(1))->method('log')->with('File system cleanup:');
$this->logger->expects($this->at(2))->method('log')
->with('The directory \'/generation\' doesn\'t exist - skipping cleanup');
$this->logger->expects($this->at(3))->method('log')->with('Updating modules:');
- $newObject->updateModulesSequence(false);
+ $installer->updateModulesSequence(false);
}
public function testUpdateModulesSequenceKeepGenerated()
{
- $allModules = [
- 'Foo_One' => [],
- 'Bar_Two' => [],
- 'New_Module' => [],
- ];
$this->cleanupFiles->expects($this->never())->method('clearCodeGeneratedClasses');
- $cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
- $cache->expects($this->once())->method('clean');
- $this->objectManager->expects($this->once())
- ->method('create')
- ->will($this->returnValueMap([
- ['Magento\Framework\App\Cache', [], $cache],
- ]));
-
- $this->moduleLoader->expects($this->once())->method('load')->willReturn($allModules);
+ $installer = $this->prepareForUpdateModulesTests();
- $expectedModules = [
- ConfigFilePool::APP_CONFIG => [
- 'modules' => [
- 'Bar_Two' => 0,
- 'Foo_One' => 1,
- 'New_Module' => 1
- ]
- ]
- ];
-
- $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
-
- $newObject = $this->createObject(false, false);
- $this->configReader->expects($this->once())->method('load')
- ->willReturn(['modules' => ['Bar_Two' => 0, 'Foo_One' => 1, 'Old_Module' => 0] ]);
- $this->configWriter->expects($this->once())->method('saveConfig')->with($expectedModules);
$this->logger->expects($this->at(0))->method('log')->with('Cache cleared successfully');
$this->logger->expects($this->at(1))->method('log')->with('Updating modules:');
- $newObject->updateModulesSequence(true);
+ $installer->updateModulesSequence(true);
}
+
public function testUninstall()
{
$this->config->expects($this->once())->method('isAvailable')->willReturn(false);
@@ -484,4 +426,47 @@ public function testCleanupDb()
$this->logger->expects($this->once())->method('log')->with('Cleaning up database `magento`');
$this->object->cleanupDb();
}
+
+ /**
+ * Prepare mocks for update modules tests and returns the installer to use
+ *
+ * @return Installer
+ */
+ private function prepareForUpdateModulesTests()
+ {
+ $allModules = [
+ 'Foo_One' => [],
+ 'Bar_Two' => [],
+ 'New_Module' => [],
+ ];
+
+ $cache = $this->getMock('Magento\Framework\App\Cache', [], [], '', false);
+ $cache->expects($this->once())->method('clean');
+ $this->objectManager->expects($this->once())
+ ->method('create')
+ ->will(
+ $this->returnValueMap(
+ [
+ ['Magento\Framework\App\Cache', [], $cache],
+ ]
+ )
+ );
+ $this->moduleLoader->expects($this->once())->method('load')->willReturn($allModules);
+ $expectedModules = [
+ ConfigFilePool::APP_CONFIG => [
+ 'modules' => [
+ 'Bar_Two' => 0,
+ 'Foo_One' => 1,
+ 'New_Module' => 1
+ ]
+ ]
+ ];
+ $this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
+ $newObject = $this->createObject(false, false);
+ $this->configReader->expects($this->once())->method('load')
+ ->willReturn(['modules' => ['Bar_Two' => 0, 'Foo_One' => 1, 'Old_Module' => 0] ]);
+ $this->configWriter->expects($this->once())->method('saveConfig')->with($expectedModules);
+
+ return $newObject;
+ }
}
From 3e2589d2b1f88b00efb92cd6cf6da9a1fba9bc13 Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai
Date: Wed, 16 Sep 2015 12:10:40 -0500
Subject: [PATCH 08/23] MAGETWO-42899: Resolve mock issue with ComponentGrid
- fixing integration test
---
.../Setup/Controller/ComponentGridTest.php | 56 ++++++++++++++++---
.../Setup/Controller/ComponentGrid.php | 3 +-
2 files changed, 48 insertions(+), 11 deletions(-)
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
index 7fe1f34ec5c00..455dd8db2a158 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
+++ b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
@@ -46,13 +46,13 @@ class ComponentGridTest extends \PHPUnit_Framework_TestCase
*/
private $lastSyncData = [];
- public function __construct()
+ public function setUp()
{
$this->lastSyncData = [
"lastSyncDate" => "2015/08/10 21:05:34",
"packages" => [
- 'magento/sample-module1' => [
- 'name' => 'magento/sample-module1',
+ 'magento/sample-module-one' => [
+ 'name' => 'magento/sample-module-one',
'type' => 'magento2-module',
'version' => '1.0.0'
]
@@ -60,12 +60,22 @@ public function __construct()
];
$this->componentData = [
- 'magento/sample-module1' => [
- 'name' => 'magento/sample-module1',
+ 'magento/sample-module-one' => [
+ 'name' => 'magento/sample-module-one',
'type' => 'magento2-module',
'version' => '1.0.0'
]
];
+
+ $allComponentData = [
+ 'magento/sample-module-two' => [
+ 'name' => 'magento/sample-module-two',
+ 'type' => 'magento2-module',
+ 'version' => '1.0.0'
+ ]
+ ];
+
+ $allComponentData = array_merge($allComponentData, $this->componentData);
$this->composerInformationMock = $this->getMock(
'Magento\Framework\Composer\ComposerInformation',
[],
@@ -97,9 +107,29 @@ public function __construct()
'',
false
);
- $objectManager->expects($this->once())
+ $enabledModuleList = $this->getMock(
+ 'Magento\Framework\Module\ModuleList',
+ [],
+ [],
+ '',
+ false
+ );
+ $enabledModuleList->expects($this->any())->method('has')->willReturn(true);
+ $fullModuleList = $this->getMock(
+ 'Magento\Framework\Module\FullModuleList',
+ [],
+ [],
+ '',
+ false
+ );
+ $fullModuleList->expects($this->any())->method('getNames')->willReturn($allComponentData);
+ $objectManager->expects($this->exactly(3))
->method('get')
- ->willReturn($packageInfoFactory);
+ ->willReturnMap([
+ ['Magento\Framework\Module\PackageInfoFactory', $packageInfoFactory],
+ ['Magento\Framework\Module\FullModuleList', $fullModuleList],
+ ['Magento\Framework\Module\ModuleList', $enabledModuleList]
+ ]);
$this->packageInfo = $this->getMock(
'Magento\Framework\Module\PackageInfo',
[],
@@ -137,6 +167,12 @@ public function testComponentsAction()
$this->packageInfo->expects($this->once())
->method('getModuleName')
->willReturn('Sample_Module');
+ $this->packageInfo->expects($this->exactly(2))
+ ->method('getPackageName')
+ ->willReturn($this->componentData['magento/sample-module-one']['name']);
+ $this->packageInfo->expects($this->exactly(2))
+ ->method('getVersion')
+ ->willReturn($this->componentData['magento/sample-module-one']['version']);
$this->composerInformationMock->expects($this->once())
->method('getInstalledMagentoPackages')
->willReturn($this->componentData);
@@ -152,13 +188,15 @@ public function testComponentsAction()
$this->assertArrayHasKey('success', $variables);
$this->assertTrue($variables['success']);
$expected = [[
- 'name' => 'magento/sample-module1',
+ 'name' => 'magento/sample-module-one',
'type' => 'magento2-module',
'version' => '1.0.0',
'update' => false,
'uninstall' => true,
'vendor' => 'magento',
- 'moduleName' => 'Sample_Module'
+ 'moduleName' => 'Sample_Module',
+ 'enable' => true,
+ 'disable' => false
]];
$this->assertEquals($expected, $variables['components']);
$this->assertArrayHasKey('total', $variables);
diff --git a/setup/src/Magento/Setup/Controller/ComponentGrid.php b/setup/src/Magento/Setup/Controller/ComponentGrid.php
index cb68dc558aaa1..b451362ee6cf6 100644
--- a/setup/src/Magento/Setup/Controller/ComponentGrid.php
+++ b/setup/src/Magento/Setup/Controller/ComponentGrid.php
@@ -66,8 +66,7 @@ public function __construct(
$objectManager = $objectManagerProvider->get();
$this->enabledModuleList = $objectManager->get('Magento\Framework\Module\ModuleList');
$this->fullModuleList = $objectManager->get('Magento\Framework\Module\FullModuleList');
- $this->packageInfo = $objectManagerProvider->get()
- ->get('Magento\Framework\Module\PackageInfoFactory')->create();
+ $this->packageInfo = $objectManager->get('Magento\Framework\Module\PackageInfoFactory')->create();
$this->updatePackagesCache = $updatePackagesCache;
}
From 9b96980adebc20c7861c01a0b301fe19915bb82c Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Wed, 16 Sep 2015 12:11:58 -0500
Subject: [PATCH 09/23] MAGETWO-42856: Make cleanup of var/generation optional
- Removed an unnecessary blank line
---
setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
index 7a3a638b70846..6a125b3e0e392 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
@@ -347,7 +347,6 @@ public function testUpdateModulesSequenceKeepGenerated()
$installer->updateModulesSequence(true);
}
-
public function testUninstall()
{
$this->config->expects($this->once())->method('isAvailable')->willReturn(false);
From f5a5320881518b50d9b174e31ac43060935ac439 Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai
Date: Wed, 16 Sep 2015 13:42:12 -0500
Subject: [PATCH 10/23] MAGETWO-42899: Resolve mock issue with ComponentGrid
- phpmd fix
---
.../Setup/Controller/ComponentGridTest.php | 64 +++----------------
1 file changed, 8 insertions(+), 56 deletions(-)
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
index 455dd8db2a158..864c8b2e40ef9 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
+++ b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
@@ -58,7 +58,6 @@ public function setUp()
]
]
];
-
$this->componentData = [
'magento/sample-module-one' => [
'name' => 'magento/sample-module-one',
@@ -66,7 +65,6 @@ public function setUp()
'version' => '1.0.0'
]
];
-
$allComponentData = [
'magento/sample-module-two' => [
'name' => 'magento/sample-module-two',
@@ -74,7 +72,6 @@ public function setUp()
'version' => '1.0.0'
]
];
-
$allComponentData = array_merge($allComponentData, $this->componentData);
$this->composerInformationMock = $this->getMock(
'Magento\Framework\Composer\ComposerInformation',
@@ -83,45 +80,15 @@ public function setUp()
'',
false
);
- $objectManagerProvider = $this->getMock(
- 'Magento\Setup\Model\ObjectManagerProvider',
- [],
- [],
- '',
- false
- );
- $objectManager = $this->getMock(
- 'Magento\Framework\ObjectManagerInterface',
- [],
- [],
- '',
- false
- );
+ $objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
+ $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface', [], [], '', false);
$objectManagerProvider->expects($this->once())
->method('get')
->willReturn($objectManager);
- $packageInfoFactory = $this->getMock(
- 'Magento\Framework\Module\PackageInfoFactory',
- [],
- [],
- '',
- false
- );
- $enabledModuleList = $this->getMock(
- 'Magento\Framework\Module\ModuleList',
- [],
- [],
- '',
- false
- );
+ $packageInfoFactory = $this->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
+ $enabledModuleList = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
$enabledModuleList->expects($this->any())->method('has')->willReturn(true);
- $fullModuleList = $this->getMock(
- 'Magento\Framework\Module\FullModuleList',
- [],
- [],
- '',
- false
- );
+ $fullModuleList = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
$fullModuleList->expects($this->any())->method('getNames')->willReturn($allComponentData);
$objectManager->expects($this->exactly(3))
->method('get')
@@ -130,24 +97,9 @@ public function setUp()
['Magento\Framework\Module\FullModuleList', $fullModuleList],
['Magento\Framework\Module\ModuleList', $enabledModuleList]
]);
- $this->packageInfo = $this->getMock(
- 'Magento\Framework\Module\PackageInfo',
- [],
- [],
- '',
- false
- );
- $this->updatePackagesCacheMock = $this->getMock(
- 'Magento\Setup\Model\UpdatePackagesCache',
- [],
- [],
- '',
- false
- );
-
- $packageInfoFactory->expects($this->once())
- ->method('create')
- ->willReturn($this->packageInfo);
+ $this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
+ $this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
+ $packageInfoFactory->expects($this->once())->method('create')->willReturn($this->packageInfo);
$this->controller = new ComponentGrid(
$this->composerInformationMock,
$objectManagerProvider,
From f913c86c0beef91aecbc6aac175ba8a33e2f382e Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai
Date: Thu, 17 Sep 2015 10:44:46 -0500
Subject: [PATCH 11/23] MAGETWO-42909: Setup unit tests fails on PHP7
- fixing broken test on php 7
---
setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php
index c0eac84d87aa3..b544d1e068fc4 100644
--- a/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php
@@ -69,7 +69,7 @@ public function testIndexAction()
public function testNoHasUninstallAction()
{
- $this->request->expects($this->any())->method('getContent')->willReturn('');
+ $this->request->expects($this->any())->method('getContent')->willReturn('{}');
$this->controller->setEvent($this->mvcEvent);
$this->controller->dispatch($this->request, $this->response);
$this->uninstallCollector->expects($this->never())->method('collectUninstall')->with(["some_module"]);
From e3463d2178070ccc8a9f86364cb9fd21b870ca54 Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai
Date: Thu, 17 Sep 2015 12:25:33 -0500
Subject: [PATCH 12/23] MAGETWO-42909: Setup unit tests fails on PHP7
- fixing backup action items test
---
.../Unit/Controller/BackupActionItemsTest.php | 24 ++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php
index bc30f60a37e42..82ce8f31941ae 100644
--- a/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php
@@ -48,8 +48,8 @@ public function setUp()
$this->directoryList = $this->getMock('Magento\Framework\App\Filesystem\DirectoryList', [], [], '', false);
$this->objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
$this->backupRollback = $this->getMock(
- 'Magento\\Setup\Model\\BackupRollback',
- [],
+ 'Magento\Setup\Model\BackupRollback',
+ ['getDBDiskSpace','dbBackup'],
[],
'',
false
@@ -59,16 +59,33 @@ public function setUp()
$this->objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
$this->log = $this->getMock('Magento\Setup\Model\WebLogger', [], [], '', false);
$this->filesystem = $this->getMock('Magento\Framework\Backup\Filesystem', [], [], '', false);
+
$this->controller = new BackupActionItems(
$this->objectManagerProvider,
$this->log,
$this->directoryList,
$this->filesystem
);
+
+ $request = $this->getMock('\Zend\Http\PhpEnvironment\Request', [], [], '', false);
+ $response = $this->getMock('\Zend\Http\PhpEnvironment\Response', [], [], '', false);
+ $routeMatch = $this->getMock('\Zend\Mvc\Router\RouteMatch', [], [], '', false);
+
+ $mvcEvent = $this->getMock('\Zend\Mvc\MvcEvent', [], [], '', false);
+ $mvcEvent->expects($this->any())->method('setRequest')->with($request)->willReturn($mvcEvent);
+ $mvcEvent->expects($this->any())->method('setResponse')->with($response)->willReturn($mvcEvent);
+ $mvcEvent->expects($this->any())->method('setTarget')->with($this->controller)->willReturn($mvcEvent);
+ $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch);
+ $contentArray = '{"options":{"code":false,"media":false,"db":true}}';
+ $request->expects($this->any())->method('getContent')->willReturn($contentArray);
+
+ $this->controller->setEvent($mvcEvent);
+ $this->controller->dispatch($request, $response);
}
public function testCheckAction()
{
+ $this->backupRollback->expects($this->once())->method('getDBDiskSpace')->willReturn(500);
$this->directoryList->expects($this->once())->method('getPath')->willReturn(__DIR__);
$this->filesystem->expects($this->once())->method('validateAvailableDiscSpace');
$jsonModel = $this->controller->checkAction();
@@ -97,12 +114,13 @@ public function testCheckActionWithError()
public function testCreateAction()
{
+ $this->backupRollback->expects($this->once())->method('dbBackup')->willReturn('backup/path/');
$jsonModel = $this->controller->createAction();
$this->assertInstanceOf('Zend\View\Model\JsonModel', $jsonModel);
$variables = $jsonModel->getVariables();
$this->assertArrayHasKey('responseType', $variables);
$this->assertEquals(ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, $variables['responseType']);
$this->assertArrayHasKey('files', $variables);
- $this->assertEquals([], $variables['files']);
+ $this->assertEquals(['backup/path/'], $variables['files']);
}
}
From 67ce266c97fd7d5bd0538ba5391646949b0002db Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai
Date: Thu, 17 Sep 2015 12:45:52 -0500
Subject: [PATCH 13/23] MAGETWO-42909: Setup unit tests fails on PHP7
- phpcs fix
---
.../Setup/Test/Unit/Controller/BackupActionItemsTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php
index 82ce8f31941ae..a22a3f96de6e1 100644
--- a/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php
@@ -49,7 +49,7 @@ public function setUp()
$this->objectManagerProvider = $this->getMock('Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
$this->backupRollback = $this->getMock(
'Magento\Setup\Model\BackupRollback',
- ['getDBDiskSpace','dbBackup'],
+ ['getDBDiskSpace', 'dbBackup'],
[],
'',
false
From a4a49ea7e6b7c65a32b6aebbc3cf39229d694b93 Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Thu, 17 Sep 2015 14:51:51 -0500
Subject: [PATCH 14/23] MAGETWO-42856: Make cleanup of var/generation optional
- Removed an unnecessary blank
---
setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
index 6a125b3e0e392..217de7d32fb28 100644
--- a/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
+++ b/setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php
@@ -463,7 +463,7 @@ private function prepareForUpdateModulesTests()
$this->config->expects($this->atLeastOnce())->method('isAvailable')->willReturn(true);
$newObject = $this->createObject(false, false);
$this->configReader->expects($this->once())->method('load')
- ->willReturn(['modules' => ['Bar_Two' => 0, 'Foo_One' => 1, 'Old_Module' => 0] ]);
+ ->willReturn(['modules' => ['Bar_Two' => 0, 'Foo_One' => 1, 'Old_Module' => 0]]);
$this->configWriter->expects($this->once())->method('saveConfig')->with($expectedModules);
return $newObject;
From 208e3d8e322e25876da54da55b20b6e38b00e82a Mon Sep 17 00:00:00 2001
From: Eddie Lau
Date: Tue, 29 Sep 2015 15:45:40 -0500
Subject: [PATCH 15/23] MAGETWO-43385: Too low timeout for readiness check
stage
- increased timeout from 3 seconds to 1 minute
---
setup/pub/magento/setup/readiness-check.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup/pub/magento/setup/readiness-check.js b/setup/pub/magento/setup/readiness-check.js
index fbbbdf1540e6d..459b5025d2281 100644
--- a/setup/pub/magento/setup/readiness-check.js
+++ b/setup/pub/magento/setup/readiness-check.js
@@ -289,7 +289,7 @@ angular.module('readiness-check', [])
item.fail();
});
}
- return $http.get(item.url, {timeout: 3000})
+ return $http.get(item.url, {timeout: 60000})
.success(function(data) { item.process(data) })
.error(function(data, status) {
item.fail();
From a830a712f8c825b3f9b2c86bcf09d142989144c4 Mon Sep 17 00:00:00 2001
From: Eddie Lau
Date: Wed, 30 Sep 2015 19:44:21 -0500
Subject: [PATCH 16/23] MAGETWO-42638: Travis Build Fail
- restore error handler before test
---
.../Magento/Framework/DB/Adapter/Pdo/MysqlTest.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php
index 6b29591a6ae5d..41644a3023ffe 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php
+++ b/dev/tests/integration/testsuite/Magento/Framework/DB/Adapter/Pdo/MysqlTest.php
@@ -22,6 +22,16 @@ class MysqlTest extends \PHPUnit_Framework_TestCase
*/
protected $_connection = null;
+ public function setUp()
+ {
+ set_error_handler(null);
+ }
+
+ public function tearDown()
+ {
+ restore_error_handler();
+ }
+
/**
* Test lost connection re-initializing
*
From 804b60a0f4778647a22b70616a52ada257e664d0 Mon Sep 17 00:00:00 2001
From: Eddie Lau
Date: Thu, 1 Oct 2015 10:47:49 -0500
Subject: [PATCH 17/23] MAGETWO-43385: Too low timeout for readiness check
stage
- added comment
---
setup/pub/magento/setup/readiness-check.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/setup/pub/magento/setup/readiness-check.js b/setup/pub/magento/setup/readiness-check.js
index 459b5025d2281..b13627bcd527a 100644
--- a/setup/pub/magento/setup/readiness-check.js
+++ b/setup/pub/magento/setup/readiness-check.js
@@ -289,6 +289,7 @@ angular.module('readiness-check', [])
item.fail();
});
}
+ // setting 1 minute timeout to prevent system from timing out
return $http.get(item.url, {timeout: 60000})
.success(function(data) { item.process(data) })
.error(function(data, status) {
From 4605a2b1a791c09684322dcab0cac02deae7e2a1 Mon Sep 17 00:00:00 2001
From: Maddy Chellathurai
Date: Fri, 2 Oct 2015 11:43:47 -0500
Subject: [PATCH 18/23] MAGETWO-43604: "Back" button doesn't work on Setup
Wizard 1st step
- fixing typo
---
setup/pub/magento/setup/main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup/pub/magento/setup/main.js b/setup/pub/magento/setup/main.js
index ef6b4b8c79f2f..e53eea082b67e 100644
--- a/setup/pub/magento/setup/main.js
+++ b/setup/pub/magento/setup/main.js
@@ -77,7 +77,7 @@ main.controller('navigationController',
}
$scope.goToStart = function() {
- if ($state.current.type === 'install') {
+ if ($state.current.type === 'installer') {
$state.go('root.landing-installer');
} else if ($state.current.type === 'upgrade') {
$state.go('root.upgrade');
From d9b56a9ec62e0d593f7e6550f6bdee5afb7f35a2 Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Fri, 2 Oct 2015 17:14:39 -0500
Subject: [PATCH 19/23] MAGETWO-43454: Contribute Ogre Sprint 38 Bugs and Tasks
- Merge from MAGETWO-30737, remove unwanted commented out code
---
setup/view/magento/setup/landing.phtml | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/setup/view/magento/setup/landing.phtml b/setup/view/magento/setup/landing.phtml
index 1c02d8970ddd0..f8fa886f73bc3 100644
--- a/setup/view/magento/setup/landing.phtml
+++ b/setup/view/magento/setup/landing.phtml
@@ -17,16 +17,6 @@
Click 'Agree and Set Up Magento' or read Getting Started to learn more.
- translate('Choose a language:'); ?>
-
- languages as $code => $title): ?>
-
-
-
- */
- ?>
Terms & Agreement
From d894c4393112e913866681adc0c2f01a6248a05e Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Wed, 7 Oct 2015 14:22:15 -0500
Subject: [PATCH 20/23] MAGETWO-43454: Contribute Ogre Sprint 38 Bugs and Tasks
- Fix integration test ComponentGridTest
---
.../Setup/Controller/ComponentGridTest.php | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
index 1df3c28804fa3..e62ef2df8f2f3 100644
--- a/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
+++ b/dev/tests/integration/testsuite/Magento/Setup/Controller/ComponentGridTest.php
@@ -111,22 +111,23 @@ public function setUp()
$objectManagerProvider->expects($this->once())
->method('get')
->willReturn($objectManager);
- $packageInfoFactory = $this->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
- $enabledModuleList = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
- $enabledModuleList->expects($this->any())->method('has')->willReturn(true);
- $fullModuleList = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
- $fullModuleList->expects($this->any())->method('getNames')->willReturn($allComponentData);
+ $this->packageInfoFactoryMock = $this
+ ->getMock('Magento\Framework\Module\PackageInfoFactory', [], [], '', false);
+ $this->enabledModuleListMock = $this->getMock('Magento\Framework\Module\ModuleList', [], [], '', false);
+ $this->enabledModuleListMock->expects($this->any())->method('has')->willReturn(true);
+ $this->fullModuleListMock = $this->getMock('Magento\Framework\Module\FullModuleList', [], [], '', false);
+ $this->fullModuleListMock->expects($this->any())->method('getNames')->willReturn($allComponentData);
$objectManager->expects($this->exactly(3))
->method('get')
->willReturnMap([
- ['Magento\Framework\Module\PackageInfoFactory', $packageInfoFactory],
- ['Magento\Framework\Module\FullModuleList', $fullModuleList],
- ['Magento\Framework\Module\ModuleList', $enabledModuleList]
+ ['Magento\Framework\Module\PackageInfoFactory', $this->packageInfoFactoryMock],
+ ['Magento\Framework\Module\FullModuleList', $this->fullModuleListMock],
+ ['Magento\Framework\Module\ModuleList', $this->enabledModuleListMock]
]);
$this->packageInfo = $this->getMock('Magento\Framework\Module\PackageInfo', [], [], '', false);
$this->updatePackagesCacheMock = $this->getMock('Magento\Setup\Model\UpdatePackagesCache', [], [], '', false);
$this->connectManagerMock = $this->getMock('Magento\Setup\Model\ConnectManager', [], [], '', false);
- $packageInfoFactory->expects($this->once())->method('create')->willReturn($this->packageInfo);
+ $this->packageInfoFactoryMock->expects($this->once())->method('create')->willReturn($this->packageInfo);
$this->controller = new ComponentGrid(
$this->composerInformationMock,
$objectManagerProvider,
From 601178956d36db2604e34f680c8a7aee13d98eda Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Wed, 7 Oct 2015 16:48:26 -0500
Subject: [PATCH 21/23] MAGETWO-43454: Contribute Ogre Sprint 38 Bugs and Tasks
- revert change made for sample data, not needed with new sample data code
---
setup/pub/magento/setup/customize-your-store.js | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/setup/pub/magento/setup/customize-your-store.js b/setup/pub/magento/setup/customize-your-store.js
index fd3ae0b4b7156..ef4721f703ab7 100644
--- a/setup/pub/magento/setup/customize-your-store.js
+++ b/setup/pub/magento/setup/customize-your-store.js
@@ -24,8 +24,7 @@ angular.module('customize-your-store', ['ngStorage', 'ngSanitize'])
force: false,
advanced: {
expanded: false
- },
- sampleDataModuleSelected: true
+ }
};
$scope.loading = false;
@@ -191,19 +190,5 @@ angular.module('customize-your-store', ['ngStorage', 'ngSanitize'])
$scope.customizeStore.submitted = false;
}
});
-
- $scope.$watch(
- function() { return $scope.store.selectedModules.indexOf('Magento_SampleData') > -1; },
- function(selected) {
- if ($scope.store.loadedAllModules) {
- if (selected) {
- $scope.store.sampleDataModuleSelected = true;
- } else {
- $scope.store.useSampleData = false;
- $scope.store.sampleDataModuleSelected = false;
- }
- }
- }
- );
}])
;
From ab13480b346ecd42dc43b991cc3a51f7d35d5a6b Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Thu, 8 Oct 2015 08:19:07 -0500
Subject: [PATCH 22/23] MAGETWO-43454: Contribute Ogre Sprint 38 Bugs and Tasks
- removed unused use statements
---
setup/src/Magento/Setup/Controller/ComponentGrid.php | 2 --
1 file changed, 2 deletions(-)
diff --git a/setup/src/Magento/Setup/Controller/ComponentGrid.php b/setup/src/Magento/Setup/Controller/ComponentGrid.php
index 2c95a5521f0c1..c8e21266320e0 100644
--- a/setup/src/Magento/Setup/Controller/ComponentGrid.php
+++ b/setup/src/Magento/Setup/Controller/ComponentGrid.php
@@ -7,9 +7,7 @@
namespace Magento\Setup\Controller;
use Magento\Framework\Composer\ComposerInformation;
-use Magento\Framework\Module\FullModuleList;
use Magento\Framework\Module\ModuleList;
-use Magento\Framework\Module\PackageInfo;
use Magento\Setup\Model\ObjectManagerProvider;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\JsonModel;
From 0c99de0705247596cc620268966937156ade0156 Mon Sep 17 00:00:00 2001
From: Paul Lewis
Date: Thu, 8 Oct 2015 12:10:05 -0500
Subject: [PATCH 23/23] MAGETWO-43454: Contribute Ogre Sprint 38 Bugs and Tasks
- fully qualify class names to prevent static error
---
.../Setup/Controller/ComponentGrid.php | 47 ++++++++-----------
1 file changed, 19 insertions(+), 28 deletions(-)
diff --git a/setup/src/Magento/Setup/Controller/ComponentGrid.php b/setup/src/Magento/Setup/Controller/ComponentGrid.php
index c8e21266320e0..128f3335cc770 100644
--- a/setup/src/Magento/Setup/Controller/ComponentGrid.php
+++ b/setup/src/Magento/Setup/Controller/ComponentGrid.php
@@ -6,19 +6,10 @@
namespace Magento\Setup\Controller;
-use Magento\Framework\Composer\ComposerInformation;
-use Magento\Framework\Module\ModuleList;
-use Magento\Setup\Model\ObjectManagerProvider;
-use Zend\Mvc\Controller\AbstractActionController;
-use Zend\View\Model\JsonModel;
-use Zend\View\Model\ViewModel;
-use Magento\Setup\Model\ConnectManager;
-use Magento\Setup\Model\UpdatePackagesCache;
-
/**
* Controller for component grid tasks
*/
-class ComponentGrid extends AbstractActionController
+class ComponentGrid extends \Zend\Mvc\Controller\AbstractActionController
{
/**
* @var \Magento\Framework\Composer\ComposerInformation
@@ -33,7 +24,7 @@ class ComponentGrid extends AbstractActionController
private $packageInfo;
/**
- * @var ConnectManager
+ * @var \Magento\Setup\Model\ConnectManager
*/
private $connectManager;
@@ -55,16 +46,16 @@ class ComponentGrid extends AbstractActionController
private $updatePackagesCache;
/**
- * @param ComposerInformation $composerInformation
- * @param ObjectManagerProvider $objectManagerProvider
- * @param ConnectManager $connectManager
- * @param UpdatePackagesCache $updatePackagesCache
+ * @param \Magento\Framework\Composer\ComposerInformation $composerInformation
+ * @param \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider
+ * @param \Magento\Setup\Model\ConnectManager $connectManager
+ * @param \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache
*/
public function __construct(
- ComposerInformation $composerInformation,
- ObjectManagerProvider $objectManagerProvider,
- UpdatePackagesCache $updatePackagesCache,
- ConnectManager $connectManager
+ \Magento\Framework\Composer\ComposerInformation $composerInformation,
+ \Magento\Setup\Model\ObjectManagerProvider $objectManagerProvider,
+ \Magento\Setup\Model\UpdatePackagesCache $updatePackagesCache,
+ \Magento\Setup\Model\ConnectManager $connectManager
) {
$this->composerInformation = $composerInformation;
$objectManager = $objectManagerProvider->get();
@@ -78,11 +69,11 @@ public function __construct(
/**
* Index page action
*
- * @return ViewModel
+ * @return \Zend\View\Model\ViewModel
*/
public function indexAction()
{
- $view = new ViewModel();
+ $view = new \Zend\View\Model\ViewModel();
$view->setTerminal(true);
return $view;
}
@@ -90,7 +81,7 @@ public function indexAction()
/**
* Get Components info action
*
- * @return JsonModel
+ * @return \Zend\View\Model\JsonModel
* @throws \RuntimeException
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
@@ -105,7 +96,7 @@ public function componentsAction()
$components[$component['name']]['uninstall'] = false;
$components[$component['name']]['moduleName'] = $this->packageInfo->getModuleName($component['name']);
if ($this->composerInformation->isPackageInComposerJson($component['name'])
- && ($component['type'] !== ComposerInformation::METAPACKAGE_PACKAGE_TYPE)) {
+ && ($component['type'] !== \Magento\Framework\Composer\ComposerInformation::METAPACKAGE_PACKAGE_TYPE)) {
$components[$component['name']]['uninstall'] = true;
if (isset($lastSyncData['packages'][$component['name']]['latestVersion'])
&& version_compare(
@@ -116,7 +107,7 @@ public function componentsAction()
$components[$component['name']]['update'] = true;
}
}
- if ($component['type'] === ComposerInformation::MODULE_PACKAGE_TYPE) {
+ if ($component['type'] === \Magento\Framework\Composer\ComposerInformation::MODULE_PACKAGE_TYPE) {
$components[$component['name']]['enable'] =
$this->enabledModuleList->has($components[$component['name']]['moduleName']);
$components[$component['name']]['disable'] = !$components[$component['name']]['enable'];
@@ -134,7 +125,7 @@ public function componentsAction()
isset($packagesForInstall['packages']) ? count($packagesForInstall['packages']) : 0;
$lastSyncData['countOfUpdate'] = isset($lastSyncData['packages']) ? count($lastSyncData['packages']) : 0;
- return new JsonModel(
+ return new \Zend\View\Model\JsonModel(
[
'success' => true,
'components' => array_values($components),
@@ -147,7 +138,7 @@ public function componentsAction()
/**
* Sync action
*
- * @return JsonModel
+ * @return \Zend\View\Model\JsonModel
*/
public function syncAction()
{
@@ -162,7 +153,7 @@ public function syncAction()
$lastSyncData['countOfUpdate'] = isset($lastSyncData['packages']) ? count($lastSyncData['packages']) : 0;
- return new JsonModel(
+ return new \Zend\View\Model\JsonModel(
[
'success' => true,
'lastSyncData' => $lastSyncData
@@ -182,7 +173,7 @@ private function getAllModules()
foreach ($allModules as $module) {
$moduleName = $this->packageInfo->getPackageName($module);
$modules[$moduleName]['name'] = $moduleName;
- $modules[$moduleName]['type'] = ComposerInformation::MODULE_PACKAGE_TYPE;
+ $modules[$moduleName]['type'] = \Magento\Framework\Composer\ComposerInformation::MODULE_PACKAGE_TYPE;
$modules[$moduleName]['version'] = $this->packageInfo->getVersion($module);
}
return $modules;