From 2056e4bc854fae5f19b1d6d2909caab0e0c38d67 Mon Sep 17 00:00:00 2001 From: Facundo Capua Date: Wed, 23 Sep 2015 09:49:00 -0300 Subject: [PATCH 01/46] Added 'target' attribute to the allowed attributes array for link block --- lib/internal/Magento/Framework/View/Element/Html/Link.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/internal/Magento/Framework/View/Element/Html/Link.php b/lib/internal/Magento/Framework/View/Element/Html/Link.php index c4e5460c7de0b..e6f22f14784e0 100644 --- a/lib/internal/Magento/Framework/View/Element/Html/Link.php +++ b/lib/internal/Magento/Framework/View/Element/Html/Link.php @@ -22,6 +22,7 @@ class Link extends \Magento\Framework\View\Element\Template 'title', 'charset', 'name', + 'target', 'hreflang', 'rel', 'rev', From 1d663b2a8030f8a253e719d5186eb59083dcaa84 Mon Sep 17 00:00:00 2001 From: Maddesto Date: Thu, 19 May 2016 10:58:04 +0300 Subject: [PATCH 02/46] Update Container.php get block group from data array --- app/code/Magento/Backend/Block/Widget/Form/Container.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/code/Magento/Backend/Block/Widget/Form/Container.php b/app/code/Magento/Backend/Block/Widget/Form/Container.php index 52c5525db17eb..d697795424dd3 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Container.php @@ -37,6 +37,11 @@ class Container extends \Magento\Backend\Block\Widget\Container * @var string */ protected $_blockGroup = 'Magento_Backend'; + + /** + * @var string + * / + const PARAM_BLOCK_GROUP = 'block_group'; /** * @var string @@ -49,6 +54,10 @@ class Container extends \Magento\Backend\Block\Widget\Container protected function _construct() { parent::_construct(); + + if ($this->hasData(self::PARAM_BLOCK_GROUP)) { + $this->_blockGroup = $this->_getData(self::PARAM_BLOCK_GROUP); + } $this->addButton( 'back', From 75f5eaa96de8ccd30cf303490b21565da5f6b5d7 Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Thu, 2 Jun 2016 17:21:16 +0300 Subject: [PATCH 03/46] MAGETWO-53017: [Product Video] Product Video not played automatically if base --- .../view/frontend/web/js/fotorama-add-video-events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js index 0b149e37a0716..43a0292270a3f 100644 --- a/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js +++ b/app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js @@ -432,7 +432,7 @@ define([ for (t = 0; t < thumbs.length; t++) { this._setThumbsIcon(thumbs.eq(t), t); - this._checkForVideo(e, fotorama, t); + this._checkForVideo(e, fotorama, t + 1); } this.fotoramaItem.on('fotorama:showend', $.proxy(function (evt, fotoramaData) { From c60a251661c1fafbe165356caec8c7e50f0d929e Mon Sep 17 00:00:00 2001 From: Marvin Caspar Date: Fri, 3 Jun 2016 10:20:56 +0200 Subject: [PATCH 04/46] Set return code for SetModeCommand In case of running the `bin/magento deploy:mode:set production` command in a shell script this will return an error code 129 and all other commands after this will not be executed. --- app/code/Magento/Deploy/Console/Command/SetModeCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Deploy/Console/Command/SetModeCommand.php b/app/code/Magento/Deploy/Console/Command/SetModeCommand.php index 17c9da2d07ffb..85148917e3546 100644 --- a/app/code/Magento/Deploy/Console/Command/SetModeCommand.php +++ b/app/code/Magento/Deploy/Console/Command/SetModeCommand.php @@ -104,6 +104,8 @@ protected function execute(InputInterface $input, OutputInterface $output) throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode)); } $output->writeln('Enabled ' . $toMode . ' mode.'); + + return \Magento\Framework\Console\Cli::RETURN_SUCCESS; } catch (\Exception $e) { $output->writeln('' . $e->getMessage() . ''); if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) { From f93a4d56eb00045c6d7515426098ad9c1af5913c Mon Sep 17 00:00:00 2001 From: bchatard Date: Fri, 27 May 2016 10:04:35 +0100 Subject: [PATCH 05/46] Escape Js Quote for layout updates --- .../Instance/Edit/Chooser/DesignAbstraction.php | 12 ++++++++++++ .../Widget/Instance/Edit/Chooser/Layout.php | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php index 93573402d18d2..0889b39e8e36f 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php @@ -48,6 +48,18 @@ public function __construct( parent::__construct($context, $data); } + /** + * {@inheritdoc} + * + * Add escapeJsQuote on $label + */ + public function addOption($value, $label, $params = []) + { + $label = $this->escapeJsQuote($label); + + return parent::addOption($value, $label, $params); + } + /** * Add necessary options * diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index f458e2ab3a94a..a27537f131fb4 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -32,6 +32,18 @@ public function __construct( parent::__construct($context, $data); } + /** + * {@inheritdoc} + * + * Add escapeJsQuote on $label + */ + public function addOption($value, $label, $params = []) + { + $label = $this->escapeJsQuote($label); + + return parent::addOption($value, $label, $params); + } + /** * Add necessary options * From 24535a143ba1c83bb4f561b95d675a5eea460510 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 1 Aug 2016 17:36:51 -0500 Subject: [PATCH 06/46] MAGETWO-55416: Reviewed and updated variations and constraints. --- .../TestCase/FlushAdditionalCachesTest.php | 1 + .../TestCase/FlushAdditionalCachesTest.xml | 3 +++ ...shStaticFilesCacheButtonVisibilityTest.php | 3 ++- ...shStaticFilesCacheButtonVisibilityTest.xml | 1 + .../app/Magento/PageCache/Test/etc/di.xml | 24 +++++++++++++++++++ 5 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 dev/tests/functional/tests/app/Magento/PageCache/Test/etc/di.xml diff --git a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.php b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.php index af7cdfc69979a..2621b57388d7a 100644 --- a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.php +++ b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.php @@ -23,6 +23,7 @@ class FlushAdditionalCachesTest extends Injectable /* tags */ const MVP = 'yes'; const DOMAIN = 'PS'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.xml b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.xml index 65a9b2d17a262..b57fb31733978 100644 --- a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.xml +++ b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushAdditionalCachesTest.xml @@ -8,16 +8,19 @@ + severity:S2 Flush Catalog Images Cache The image cache was cleaned. + severity:S2 Flush JavaScript/CSS Cache The JavaScript/CSS cache has been cleaned. + severity:S2 Flush Static Files Cache The static files cache has been cleaned. diff --git a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.php b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.php index f07546b100640..0c7cb20d54849 100644 --- a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.php +++ b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.php @@ -20,8 +20,9 @@ class FlushStaticFilesCacheButtonVisibilityTest extends Injectable { /* tags */ - const MVP = 'no'; + const MVP = 'yes'; const DOMAIN = 'PS'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.xml b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.xml index 670c46b3214a3..ae6605b28a088 100644 --- a/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.xml +++ b/dev/tests/functional/tests/app/Magento/PageCache/Test/TestCase/FlushStaticFilesCacheButtonVisibilityTest.xml @@ -8,6 +8,7 @@ + severity:S3 diff --git a/dev/tests/functional/tests/app/Magento/PageCache/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/PageCache/Test/etc/di.xml new file mode 100644 index 0000000000000..70b7881a3558d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/PageCache/Test/etc/di.xml @@ -0,0 +1,24 @@ + + + + + + S2 + + + + + S2 + + + + + S3 + + + From d329f2566b69e876a9089dde5d25e7fa263702a5 Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Mon, 5 Sep 2016 13:27:10 +0300 Subject: [PATCH 07/46] MAGETWO-57279: User lose configurable product data when the Interface Locale changed to Chinese --- .../Form/Modifier/Data/AssociatedProducts.php | 2 +- .../Modifier/Data/AssociatedProductsTest.php | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php diff --git a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php index da7a0d7a3d9da..ac1b8b981ea3d 100644 --- a/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php +++ b/app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php @@ -284,7 +284,7 @@ protected function prepareVariations() 'sku' => $product->getSku(), 'name' => $product->getName(), 'qty' => $this->getProductStockQty($product), - 'price' => $currency->toCurrency(sprintf("%f", $price), ['display' => false]), + 'price' => $price, 'price_string' => $currency->toCurrency(sprintf("%f", $price)), 'price_currency' => $this->locator->getStore()->getBaseCurrency()->getCurrencySymbol(), 'configurable_attribute' => $this->getJsonConfigurableAttributes($variationOptions), diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php new file mode 100644 index 0000000000000..a536a82f7641c --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php @@ -0,0 +1,79 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->registry = $this->objectManager->get(\Magento\Framework\Registry::class); + + } + + /** + * @dataProvider getProductMatrixDataProvider + * @param string $interfaceLocale + * @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php + * @magentoAppArea adminhtml + */ + public function testGetProductMatrix($interfaceLocale) + { + $productSku = 'configurable'; + $associatedProductsData = [ + [10 => '10.000'], + [20 => '20.000'] + ]; + /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ + $productRepository = $this->objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); + $this->registry->register('current_product', $productRepository->get($productSku)); + /** @var $store \Magento\Store\Model\Store */ + $store = $this->objectManager->create(\Magento\Store\Model\Store::class); + $store->load('admin'); + $this->registry->register('current_store', $store); + /** @var \Magento\Framework\Locale\ResolverInterface|\PHPUnit_Framework_MockObject_MockObject $localeResolver */ + $localeResolver = $this->getMockBuilder(\Magento\Framework\Locale\ResolverInterface::class) + ->setMethods(['getLocale']) + ->getMockForAbstractClass(); + $localeResolver->expects($this->any())->method('getLocale')->willReturn($interfaceLocale); + $localeCurrency = $this->objectManager->create( + \Magento\Framework\Locale\CurrencyInterface::class, + ['localeResolver' => $localeResolver] + ); + $associatedProducts = $this->objectManager->create( + AssociatedProducts::class, + ['localeCurrency' => $localeCurrency] + ); + foreach($associatedProducts->getProductMatrix() as $productMatrixId => $productMatrixData) { + $this->assertEquals( + $associatedProductsData[$productMatrixId][$productMatrixData['id']], + $productMatrixData['price'] + ); + } + } + + /** + * @return array + */ + public function getProductMatrixDataProvider() + { + return [ + ['en_US'], + ['zh_Hans_CN'] + ]; + } +} From 1733df10397004c90f9189cb059f8cbec1063360 Mon Sep 17 00:00:00 2001 From: Leonid Poluyanov Date: Mon, 5 Sep 2016 14:01:51 +0300 Subject: [PATCH 08/46] MAGETWO-57279: User lose configurable product data when the Interface Locale changed to Chinese --- .../Product/Form/Modifier/Data/AssociatedProductsTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php index a536a82f7641c..0639c7353d55e 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProductsTest.php @@ -17,7 +17,6 @@ class AssociatedProductsTest extends \PHPUnit_Framework_TestCase */ private $registry; - public function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -58,7 +57,7 @@ public function testGetProductMatrix($interfaceLocale) AssociatedProducts::class, ['localeCurrency' => $localeCurrency] ); - foreach($associatedProducts->getProductMatrix() as $productMatrixId => $productMatrixData) { + foreach ($associatedProducts->getProductMatrix() as $productMatrixId => $productMatrixData) { $this->assertEquals( $associatedProductsData[$productMatrixId][$productMatrixData['id']], $productMatrixData['price'] From cc5cd5606745e6050de5074b21b7d3a7bae79e02 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 5 Sep 2016 18:14:59 +0300 Subject: [PATCH 09/46] MAGETWO-57820: [GITHUB] php bin/magento i18n:pack creates unwanted dir #6260 --- .../src/Magento/Setup/Module/I18n/Context.php | 6 ++++ .../I18n/Pack/Writer/File/AbstractFile.php | 3 ++ .../I18n/UnregisteredComponentException.php | 13 +++++++ .../Test/Unit/Module/I18n/ContextTest.php | 34 +++++++++++++------ 4 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php diff --git a/setup/src/Magento/Setup/Module/I18n/Context.php b/setup/src/Magento/Setup/Module/I18n/Context.php index 9db97153972cb..0dbdbb0248607 100644 --- a/setup/src/Magento/Setup/Module/I18n/Context.php +++ b/setup/src/Magento/Setup/Module/I18n/Context.php @@ -95,6 +95,7 @@ private function getComponentName($componentType, $path) * @param array $value * @return string * @throws \InvalidArgumentException + * @throws UnregisteredComponentException */ public function buildPathToLocaleDirectoryByContext($type, $value) { @@ -111,6 +112,11 @@ public function buildPathToLocaleDirectoryByContext($type, $value) default: throw new \InvalidArgumentException(sprintf('Invalid context given: "%s".', $type)); } + + if (null === $path) { + throw new UnregisteredComponentException(); + } + return $path . '/' . self::LOCALE_DIRECTORY . '/'; } } diff --git a/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php b/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php index 00a1361c3c761..817e783999a33 100644 --- a/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php +++ b/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php @@ -10,6 +10,7 @@ use Magento\Setup\Module\I18n\Factory; use Magento\Setup\Module\I18n\Locale; use Magento\Setup\Module\I18n\Pack\WriterInterface; +use Magento\Setup\Module\I18n\UnregisteredComponentException; /** * Abstract pack writer @@ -120,6 +121,8 @@ protected function _buildPackFilesData(Dictionary $dictionary) $path = $this->_context->buildPathToLocaleDirectoryByContext($phrase->getContextType(), $context); } catch (\InvalidArgumentException $e) { throw new \InvalidArgumentException($e->getMessage() . ' Row #' . ($key + 1) . '.'); + } catch (UnregisteredComponentException $e) { + continue; } $filename = $path . $this->_locale . '.' . $this->_getFileExtension(); $files[$filename][$phrase->getPhrase()] = $phrase; diff --git a/setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php b/setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php new file mode 100644 index 0000000000000..ff47e683476e1 --- /dev/null +++ b/setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php @@ -0,0 +1,13 @@ +componentRegistrar->expects($this->any()) ->method('getPaths') - ->will($this->returnValueMap($pathValues)); + ->willReturnMap($pathValues); $this->context = new Context($this->componentRegistrar); $this->assertEquals($context, $this->context->getContextByPath($path)); } @@ -108,10 +108,8 @@ public function testBuildPathToLocaleDirectoryByContext($path, $context, $regist $paths[$module[1]] = $module[2]; } $this->componentRegistrar->expects($this->any()) - ->method('getPaths') - ->with(ComponentRegistrar::MODULE) - ->willReturn($paths); - $this->componentRegistrar->expects($this->any())->method('getPath')->will($this->returnValueMap($registrar)); + ->method('getPath') + ->willReturnMap($registrar); $this->context = new Context($this->componentRegistrar); $this->assertEquals($path, $this->context->buildPathToLocaleDirectoryByContext($context[0], $context[1])); } @@ -127,7 +125,11 @@ public function dataProviderPathToLocaleDirectoryByContext() [Context::CONTEXT_TYPE_MODULE, 'Magento_Module'], [[ComponentRegistrar::MODULE, 'Magento_Module', BP . '/app/code/Magento/Module']] ], - ['/i18n/', [Context::CONTEXT_TYPE_THEME, 'theme/test.phtml'], []], + [ + BP . '/app/design/frontend/Magento/luma/i18n/', + [Context::CONTEXT_TYPE_THEME, 'rontend/Magento/luma'], + [[ComponentRegistrar::THEME, 'rontend/Magento/luma', BP . '/app/design/frontend/Magento/luma']] + ], [BP . '/lib/web/i18n/', [Context::CONTEXT_TYPE_LIB, 'lib/web/module/test.phtml'], []], ]; } @@ -138,11 +140,23 @@ public function dataProviderPathToLocaleDirectoryByContext() */ public function testBuildPathToLocaleDirectoryByContextWithInvalidType() { - $this->componentRegistrar->expects($this->any()) - ->method('getPaths') - ->with(ComponentRegistrar::MODULE) - ->willReturn(['module' => '/path/to/module']); + $this->componentRegistrar->expects($this->never()) + ->method('getPath'); $this->context = new Context($this->componentRegistrar); $this->context->buildPathToLocaleDirectoryByContext('invalid_type', 'Magento_Module'); } + + /** + * @expectedException \Magento\Setup\Module\I18n\UnregisteredComponentException + */ + public function testBuildPathToLocaleDirectoryByContextWithUnregisteredComponent() + { + $moduleName = 'Magento_Module'; + $this->componentRegistrar->expects($this->once()) + ->method('getPath') + ->with(ComponentRegistrar::MODULE, $moduleName) + ->willReturn(null); + $this->context = new Context($this->componentRegistrar); + $this->context->buildPathToLocaleDirectoryByContext(ComponentRegistrar::MODULE, $moduleName); + } } From 3a5c5c2616e250a3d123ed83ad0fca781f2876f3 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 6 Sep 2016 12:05:06 +0300 Subject: [PATCH 10/46] MAGETWO-57820: [GITHUB] php bin/magento i18n:pack creates unwanted dir #6260 --- .../Pack/Writer/File/AbstractFileTest.php | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php new file mode 100644 index 0000000000000..10ce56838b361 --- /dev/null +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php @@ -0,0 +1,203 @@ +contextMock = $this->getMock(Context::class, [], [], '', false, false); + $this->localeMock = $this->getMock(Locale::class, [], [], '', false, false); + $this->dictionaryMock = $this->getMock(Dictionary::class, [], [], '', false, false); + $this->phraseMock = $this->getMock(Phrase::class, [], [], '', false, false); + + $constructorArguments = $objectManagerHelper->getConstructArguments( + AbstractFile::class, + ['context' => $this->contextMock] + ); + $this->object = $this->getMockBuilder(AbstractFile::class) + ->setMethods(['_createDirectoryIfNotExist', '_writeFile']) + ->setConstructorArgs($constructorArguments) + ->getMockForAbstractClass(); + } + + /** + * @param string $contextType + * @param array $contextValue + * @dataProvider writeDictionaryWithRuntimeExceptionDataProvider + * @expectedException \RuntimeException + * @return void + */ + public function testWriteDictionaryWithRuntimeException($contextType, $contextValue) + { + $this->configureGeneralPhrasesMock($contextType, $contextValue); + + $this->object->expects($this->never()) + ->method('_createDirectoryIfNotExist'); + $this->object->expects($this->never()) + ->method('_writeFile'); + + $this->object->writeDictionary($this->dictionaryMock, $this->localeMock); + } + + /** + * @return array + */ + public function writeDictionaryWithRuntimeExceptionDataProvider() + { + return [ + ['', []], + ['module', []], + ['', ['Magento_Module']] + ]; + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Some error. Row #1. + * @return void + */ + public function testWriteDictionaryWithInvalidArgumentException() + { + $contextType = 'module'; + $contextValue = 'Magento_Module'; + + $this->configureGeneralPhrasesMock($contextType, [$contextValue]); + + $this->object->expects($this->never()) + ->method('_createDirectoryIfNotExist'); + $this->object->expects($this->never()) + ->method('_writeFile'); + + $this->contextMock->expects($this->once()) + ->method('buildPathToLocaleDirectoryByContext') + ->with($contextType, $contextValue) + ->willThrowException(new \InvalidArgumentException('Some error.')); + + $this->object->writeDictionary($this->dictionaryMock, $this->localeMock); + } + + /** + * @return void + */ + public function testWriteDictionaryWithUnregisteredComponentException() + { + $contextType = 'module'; + $contextValue = 'Magento_Module'; + + $this->configureGeneralPhrasesMock($contextType, [$contextValue]); + + $this->object->expects($this->never()) + ->method('_createDirectoryIfNotExist'); + $this->object->expects($this->never()) + ->method('_writeFile'); + + $this->contextMock->expects($this->once()) + ->method('buildPathToLocaleDirectoryByContext') + ->with($contextType, $contextValue) + ->willThrowException(new UnregisteredComponentException); + + $this->object->writeDictionary($this->dictionaryMock, $this->localeMock); + } + + /** + * @return void + */ + public function testWriteDictionary() + { + $contextType = 'module'; + $contextValue = 'Magento_Module'; + $path = '/some/path/'; + $phrase = 'Phrase'; + $locale = 'en_EN'; + $fileExtension = 'csv'; + $file = $path . $locale . '.' . $fileExtension; + + $this->configureGeneralPhrasesMock($contextType, [$contextValue]); + + $this->phraseMock->expects($this->once()) + ->method('getPhrase') + ->willReturn($phrase); + $this->localeMock->expects($this->once()) + ->method('__toString') + ->willReturn($locale); + + $this->object->expects($this->once()) + ->method('_getFileExtension') + ->willReturn($fileExtension); + $this->object->expects($this->once()) + ->method('_createDirectoryIfNotExist') + ->with(dirname($file)); + $this->object->expects($this->once()) + ->method('_writeFile') + ->with($file, [$phrase => $this->phraseMock]); + + $this->contextMock->expects($this->once()) + ->method('buildPathToLocaleDirectoryByContext') + ->with($contextType, $contextValue) + ->willReturn($path); + + $this->object->writeDictionary($this->dictionaryMock, $this->localeMock); + } + + /** + * @param string $contextType + * @param array $contextValue + * @return void + */ + protected function configureGeneralPhrasesMock($contextType, $contextValue) + { + $this->phraseMock->expects($this->any()) + ->method('getContextType') + ->willReturn($contextType); + $this->phraseMock->expects($this->any()) + ->method('getContextValue') + ->willReturn($contextValue); + + $this->dictionaryMock->expects($this->once()) + ->method('getPhrases') + ->willReturn([$this->phraseMock]); + } +} From 4bb62f8dc0e09697f95dd1206254983f5c436edb Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Mon, 1 Aug 2016 17:32:56 -0500 Subject: [PATCH 11/46] MAGETWO-55066: Reviewed and updated variations and constraints. (cherry picked from commit ed2db92) --- .../Test/TestCase/CreateWidgetEntityTest.php | 1 + .../Test/TestCase/CreateWidgetEntityTest.xml | 6 ++ .../Test/TestCase/DeleteWidgetEntityTest.php | 1 + .../Test/TestCase/DeleteWidgetEntityTest.xml | 1 + .../Widget/Test/TestCase/NavigateMenuTest.xml | 1 + .../tests/app/Magento/Widget/Test/etc/di.xml | 64 +++++++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php index edd021713f892..6358ac8821f26 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.php @@ -26,6 +26,7 @@ class CreateWidgetEntityTest extends AbstractCreateWidgetEntityTest /* tags */ const MVP = 'yes'; const TEST_TYPE = 'extended_acceptance_test'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml index 42d81d2f16c81..0363600f86c93 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 CMS Static Block Magento Luma Title_%isolation% @@ -19,6 +20,7 @@ + severity:S1 test_type:extended_acceptance_test CMS Page Link Magento Luma @@ -31,6 +33,7 @@ + severity:S1 Recently Viewed Products Magento Luma Title_%isolation% @@ -42,6 +45,7 @@ + severity:S1 Recently Compared Products Magento Luma Title_%isolation% @@ -53,6 +57,7 @@ + severity:S1 Catalog Category Link Magento Luma Title_%isolation% @@ -64,6 +69,7 @@ + severity:S1 test_type:extended_acceptance_test Catalog Product Link Magento Luma diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.php b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.php index ba89d591e3640..f80389d64acff 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.php @@ -29,6 +29,7 @@ class DeleteWidgetEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.xml index fc63d3f5c2660..c30eda8810f22 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/DeleteWidgetEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 default diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml index 99c383d8748ee..02201d6fb4a3b 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml @@ -8,6 +8,7 @@ + severity:S2 Content > Widgets Widgets diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml new file mode 100644 index 0000000000000..eb3c2031c995a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml @@ -0,0 +1,64 @@ + + + + + + S2 + + + + + S1 + + + + + S1 + + + + + S2 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + From f3d48ba71016f3c6d7d38c972486bd2c20e1c6a7 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 6 Sep 2016 11:54:10 -0500 Subject: [PATCH 12/46] MAGETWO-55066: Reviewed and updated variations and constraints. (cherry picked from commit 85a0dde) --- .../TestCase/CreateCmsBlockEntityTest.php | 1 + .../TestCase/CreateCmsBlockEntityTest.xml | 3 +- .../Test/TestCase/CreateCmsPageEntityTest.php | 1 + .../Test/TestCase/CreateCmsPageEntityTest.xml | 10 ++-- .../CreateCmsPageRewriteEntityTest.php | 1 + .../CreateCmsPageRewriteEntityTest.xml | 4 ++ .../CreateCustomUrlRewriteEntityTest.xml | 4 +- .../TestCase/DeleteCmsBlockEntityTest.php | 1 + .../TestCase/DeleteCmsBlockEntityTest.xml | 1 + .../Test/TestCase/DeleteCmsPageEntityTest.php | 1 + .../Test/TestCase/DeleteCmsPageEntityTest.xml | 1 + .../DeleteCmsPageUrlRewriteEntityTest.php | 1 + .../DeleteCmsPageUrlRewriteEntityTest.xml | 5 +- .../Cms/Test/TestCase/GridFilteringTest.xml | 2 + .../Test/TestCase/GridFullTextSearchTest.xml | 2 + .../Cms/Test/TestCase/GridSortingTest.xml | 2 + .../Cms/Test/TestCase/NavigateMenuTest.xml | 2 + .../TestCase/UpdateCmsBlockEntityTest.php | 1 + .../TestCase/UpdateCmsBlockEntityTest.xml | 3 +- .../Test/TestCase/UpdateCmsPageEntityTest.php | 1 + .../Test/TestCase/UpdateCmsPageEntityTest.xml | 4 +- .../UpdateCmsPageRewriteEntityTest.php | 1 + .../UpdateCmsPageRewriteEntityTest.xml | 3 ++ .../Test/TestCase/CreateSitemapEntityTest.php | 1 + .../Test/TestCase/CreateSitemapEntityTest.xml | 3 ++ .../Test/TestCase/DeleteSitemapEntityTest.php | 1 + .../Test/TestCase/DeleteSitemapEntityTest.xml | 1 + .../Test/TestCase/NavigateMenuTest.xml | 1 + .../tests/app/Magento/Sitemap/Test/etc/di.xml | 54 +++++++++++++++++++ .../Test/TestCase/CreateWidgetEntityTest.xml | 8 ++- .../tests/app/Magento/Widget/Test/etc/di.xml | 5 ++ 31 files changed, 112 insertions(+), 17 deletions(-) create mode 100644 dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/di.xml diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php index 7e3c3f0ebb3c9..79da8791af2be 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php @@ -27,6 +27,7 @@ class CreateCmsBlockEntityTest extends AbstractCmsBlockEntityTest /* tags */ const MVP = 'yes'; const TEST_TYPE = 'extended_acceptance_test'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml index a2bbdb817961d..7a07dc4ad7c68 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 test_type:extended_acceptance_test block_%isolation% identifier_%isolation% @@ -19,13 +20,13 @@ + severity:S2 block_%isolation% identifier_%isolation% default No description_%isolation% - diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php index f5035a2eaf76d..250c55ff00d44 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php @@ -29,6 +29,7 @@ class CreateCmsPageEntityTest extends Injectable /* tags */ const MVP = 'yes'; const TEST_TYPE = 'acceptance_test, extended_acceptance_test'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 60b440fc0868b..7990b64f97df8 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -8,18 +8,20 @@ + severity:S1 + test_type:acceptance_test, test_type:extended_acceptance_test cmsPage Yes NewCmsPage%isolation% identifier-%isolation% All Store Views cms_page_text_content%isolation% - test_type:acceptance_test, test_type:extended_acceptance_test + severity:S1 cmsPage Yes NewCmsPage%isolation% @@ -30,6 +32,7 @@ + severity:S1 cmsPage Yes NewCmsPage%isolation% @@ -39,11 +42,10 @@ default General Contact Name - - + severity:S3 cmsPage NewCmsPage%isolation% identifier-%isolation% @@ -51,8 +53,6 @@ No cms_page_text_content%isolation% - - diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php index 296525540073f..42796d8fbb726 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.php @@ -33,6 +33,7 @@ class CreateCmsPageRewriteEntityTest extends Injectable /* tags */ const MVP = 'yes'; const TEST_TYPE = 'extended_acceptance_test'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml index 19b5053fc4097..a00bea4a3126d 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 test_type:extended_acceptance_test For CMS page cms/page/view/page_id/%cmsPage::default% @@ -19,6 +20,7 @@ + severity:S1 For CMS page cms/page/view/page_id/%cmsPage::default% request_path%isolation%.html @@ -29,6 +31,7 @@ + severity:S1 For CMS page cms/page/view/page_id/%cmsPage::default% request_path%isolation%.htm @@ -39,6 +42,7 @@ + severity:S1 For CMS page cms/page/view/page_id/%cmsPage::default% request_path%isolation%.aspx diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCustomUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCustomUrlRewriteEntityTest.xml index 9f14cefa8147d..90f40a55e8f64 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCustomUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCustomUrlRewriteEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 Custom Main Website/Main Website Store/Default Store View cms/page/view/page_id/%cmsPage::default% @@ -15,10 +16,10 @@ No test description_full path - + severity:S1 Custom Main Website/Main Website Store/Default Store View cms/page/view/page_id/%cmsPage::default% @@ -26,7 +27,6 @@ Temporary (302) test description_full path - diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php index ad2ae5689c985..62c703960e727 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php @@ -31,6 +31,7 @@ class DeleteCmsBlockEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml index d9c52aba53d52..fc043effe5a77 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php index 25225917014fc..d893bdbe2d13e 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php @@ -29,6 +29,7 @@ class DeleteCmsPageEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml index 5c476928ca6ee..2a85425890e8e 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 default diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php index 68d0ae541253d..a07303875a54b 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.php @@ -30,6 +30,7 @@ class DeleteCmsPageUrlRewriteEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml index a065c37513ac5..77e54edfb85f9 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageUrlRewriteEntityTest.xml @@ -8,21 +8,22 @@ + severity:S2 cms_default_no_redirect + severity:S2 cms_default_permanent_redirect - + severity:S2 cms_default_temporary_redirect - diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFilteringTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFilteringTest.xml index af26b1f11f177..715190039162b 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFilteringTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFilteringTest.xml @@ -8,6 +8,7 @@ + severity:S2 Verify cms page grid filtering 2 cmsPage @@ -28,6 +29,7 @@ + severity:S2 Verify cms block grid filtering 2 cmsBlock diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFullTextSearchTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFullTextSearchTest.xml index 21a0dd32a56b2..893cfc2f0dacc 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFullTextSearchTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridFullTextSearchTest.xml @@ -8,6 +8,7 @@ + severity:S2 Verify cms page grid full text search 2 cmsPage @@ -19,6 +20,7 @@ + severity:S2 Verify cms blocks grid full text search 2 cmsBlock diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridSortingTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridSortingTest.xml index 595277423b39c..d6467a53e1565 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridSortingTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/GridSortingTest.xml @@ -8,6 +8,7 @@ + severity:S2 Verify cms page grid sorting ID @@ -18,6 +19,7 @@ + severity:S2 Verify cms blocks grid sorting - diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml index 38c9e8cf8f21d..127c85f840102 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml @@ -8,11 +8,13 @@ + severity:S2 Content > Pages Pages + severity:S2 Content > Blocks Blocks diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php index 8fa92fba59f8e..6272eff0cf699 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php @@ -27,6 +27,7 @@ class UpdateCmsBlockEntityTest extends AbstractCmsBlockEntityTest { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml index 652166b0fe00d..a2cd59dd89db8 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 block_updated_%isolation% identifier_updated_%isolation% all_store_views @@ -18,13 +19,13 @@ + severity:S3 block_updated_%isolation% identifier_updated_%isolation% default No description_updated_%isolation% - diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php index b16f4384f27d5..a9a98e8dd21c0 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php @@ -31,6 +31,7 @@ class UpdateCmsPageEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml index a24fe83e503ce..75f8cf63f645e 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml @@ -8,19 +8,21 @@ + severity:S3 CmsPageEdited%isolation% No cms_page_text_content_after_edit - + severity:S1 CmsPageEdited%isolation% cms_page_url_edited_%isolation% Content Heading TextEdited cms_page_text_content_after_edit + diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php index 43fd7e69ac359..bfa992dd81c8d 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php @@ -35,6 +35,7 @@ class UpdateCmsPageRewriteEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml index e8a1a637f7ef9..40664ee7c1313 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.xml @@ -8,6 +8,7 @@ + severity:S2 cms_default_no_redirect Main Website/Main Website Store/%default% request_path%isolation% @@ -17,6 +18,7 @@ + severity:S2 cms_default_temporary_redirect Main Website/Main Website Store/Default Store View request_path%isolation%.html @@ -26,6 +28,7 @@ + severity:S2 cms_default_permanent_redirect Main Website/Main Website Store/Default Store View request_path%isolation%.htm diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.php index f820e92f9a526..1329fab583d88 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.php @@ -30,6 +30,7 @@ class CreateSitemapEntityTest extends Injectable /* tags */ const MVP = 'yes'; const TEST_TYPE = 'extended_acceptance_test'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml index 36a9708cd3da5..b9d589db0ac8f 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml @@ -8,6 +8,7 @@ + severity:S1 test_type:extended_acceptance_test sitemap.xml / @@ -15,11 +16,13 @@ + severity:S3 %isolation% / + severity:S3 sitemap.xml /%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.php index e8f24bfccc056..5ea826345da84 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.php @@ -31,6 +31,7 @@ class DeleteSitemapEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml index 432f7a9026670..b0c30897fc7e8 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/DeleteSitemapEntityTest.xml @@ -8,6 +8,7 @@ + severity:S2 default diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml index cc5de2a32735d..67d70772a0c18 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml @@ -8,6 +8,7 @@ + severity:S2 Marketing > Site Map Site Map diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/di.xml new file mode 100644 index 0000000000000..546ef7f8d4ee3 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/di.xml @@ -0,0 +1,54 @@ + + + + + + S2 + + + + + S3 + + + + + S3 + + + + + S2 + + + + + S3 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml index 0363600f86c93..520d1ce2d3db3 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml @@ -16,7 +16,6 @@ on_category cmsStaticBlock - @@ -41,7 +40,6 @@ for_viewed_products recentlyViewedProducts - @@ -53,7 +51,6 @@ for_compared_products recentlyComparedProducts - @@ -65,7 +62,6 @@ for_category_link catalogCategoryLink - @@ -78,11 +74,11 @@ on_product_link catalogProductLink - + severity:S2 Disabled CMS Static Block Magento Luma @@ -97,6 +93,7 @@ + severity:S3 Invalidated Catalog Category Link Magento Luma @@ -111,6 +108,7 @@ + severity:S1 Catalog New Products List Magento Luma Title_%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml index eb3c2031c995a..122a9659cf2b6 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/di.xml @@ -16,6 +16,11 @@ S1 + + + S1 + + S1 From 205d73737d421d3a458a5672064db60032b1fa5e Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 6 Sep 2016 15:53:16 -0500 Subject: [PATCH 13/46] MAGETWO-55412: Reviewed and updated variations and constraints. --- .../Test/TestCase/CreateCurrencyRateTest.php | 1 + .../Test/TestCase/CreateCurrencyRateTest.xml | 1 + .../app/Magento/Directory/Test/etc/di.xml | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/Directory/Test/etc/di.xml diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php index 4d397bde28bf6..bc40a2ab98f6d 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.php @@ -31,6 +31,7 @@ class CreateCurrencyRateTest extends Injectable { /* tags */ const TEST_TYPE = 'acceptance_test, extended_acceptance_test'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml index e3eb961bcfe9d..1e87903d068e1 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml @@ -8,6 +8,7 @@ + severity:S1 test_type:acceptance_test, test_type:extended_acceptance_test USD EUR diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/etc/di.xml new file mode 100644 index 0000000000000..d85076bd922cd --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/etc/di.xml @@ -0,0 +1,19 @@ + + + + + + S1 + + + + + S1 + + + From cd5bb2dece341552e0ee41b358d4baedcc9e37f6 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 7 Sep 2016 12:12:19 +0300 Subject: [PATCH 14/46] MAGETWO-57820: [GITHUB] php bin/magento i18n:pack creates unwanted dir #6260 --- .../src/Magento/Setup/Module/I18n/Context.php | 9 ++---- .../I18n/Pack/Writer/File/AbstractFile.php | 6 ++-- .../I18n/UnregisteredComponentException.php | 13 --------- .../Test/Unit/Module/I18n/ContextTest.php | 29 +++++++++---------- .../Pack/Writer/File/AbstractFileTest.php | 5 ++-- 5 files changed, 21 insertions(+), 41 deletions(-) delete mode 100644 setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php diff --git a/setup/src/Magento/Setup/Module/I18n/Context.php b/setup/src/Magento/Setup/Module/I18n/Context.php index 0dbdbb0248607..a2137e3d9bd00 100644 --- a/setup/src/Magento/Setup/Module/I18n/Context.php +++ b/setup/src/Magento/Setup/Module/I18n/Context.php @@ -93,9 +93,8 @@ private function getComponentName($componentType, $path) * * @param string $type * @param array $value - * @return string + * @return string|null * @throws \InvalidArgumentException - * @throws UnregisteredComponentException */ public function buildPathToLocaleDirectoryByContext($type, $value) { @@ -113,10 +112,6 @@ public function buildPathToLocaleDirectoryByContext($type, $value) throw new \InvalidArgumentException(sprintf('Invalid context given: "%s".', $type)); } - if (null === $path) { - throw new UnregisteredComponentException(); - } - - return $path . '/' . self::LOCALE_DIRECTORY . '/'; + return (null === $path) ? null : $path . '/' . self::LOCALE_DIRECTORY . '/'; } } diff --git a/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php b/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php index 817e783999a33..2495a9209e235 100644 --- a/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php +++ b/setup/src/Magento/Setup/Module/I18n/Pack/Writer/File/AbstractFile.php @@ -10,7 +10,6 @@ use Magento\Setup\Module\I18n\Factory; use Magento\Setup\Module\I18n\Locale; use Magento\Setup\Module\I18n\Pack\WriterInterface; -use Magento\Setup\Module\I18n\UnregisteredComponentException; /** * Abstract pack writer @@ -121,9 +120,12 @@ protected function _buildPackFilesData(Dictionary $dictionary) $path = $this->_context->buildPathToLocaleDirectoryByContext($phrase->getContextType(), $context); } catch (\InvalidArgumentException $e) { throw new \InvalidArgumentException($e->getMessage() . ' Row #' . ($key + 1) . '.'); - } catch (UnregisteredComponentException $e) { + } + + if (null === $path) { continue; } + $filename = $path . $this->_locale . '.' . $this->_getFileExtension(); $files[$filename][$phrase->getPhrase()] = $phrase; } diff --git a/setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php b/setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php deleted file mode 100644 index ff47e683476e1..0000000000000 --- a/setup/src/Magento/Setup/Module/I18n/UnregisteredComponentException.php +++ /dev/null @@ -1,13 +0,0 @@ -context = new Context($this->componentRegistrar); $this->context->buildPathToLocaleDirectoryByContext('invalid_type', 'Magento_Module'); } - - /** - * @expectedException \Magento\Setup\Module\I18n\UnregisteredComponentException - */ - public function testBuildPathToLocaleDirectoryByContextWithUnregisteredComponent() - { - $moduleName = 'Magento_Module'; - $this->componentRegistrar->expects($this->once()) - ->method('getPath') - ->with(ComponentRegistrar::MODULE, $moduleName) - ->willReturn(null); - $this->context = new Context($this->componentRegistrar); - $this->context->buildPathToLocaleDirectoryByContext(ComponentRegistrar::MODULE, $moduleName); - } } diff --git a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php index 10ce56838b361..bc52fe38321da 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/I18n/Pack/Writer/File/AbstractFileTest.php @@ -10,7 +10,6 @@ use Magento\Setup\Module\I18n\Dictionary; use Magento\Setup\Module\I18n\Dictionary\Phrase; use Magento\Setup\Module\I18n\Pack\Writer\File\AbstractFile; -use Magento\Setup\Module\I18n\UnregisteredComponentException; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; class AbstractFileTest extends \PHPUnit_Framework_TestCase @@ -122,7 +121,7 @@ public function testWriteDictionaryWithInvalidArgumentException() /** * @return void */ - public function testWriteDictionaryWithUnregisteredComponentException() + public function testWriteDictionaryWherePathIsNull() { $contextType = 'module'; $contextValue = 'Magento_Module'; @@ -137,7 +136,7 @@ public function testWriteDictionaryWithUnregisteredComponentException() $this->contextMock->expects($this->once()) ->method('buildPathToLocaleDirectoryByContext') ->with($contextType, $contextValue) - ->willThrowException(new UnregisteredComponentException); + ->willReturn(null); $this->object->writeDictionary($this->dictionaryMock, $this->localeMock); } From e144dc337311865c4f7dcd676ec00cfd165f4d3d Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 8 Sep 2016 09:51:42 -0500 Subject: [PATCH 15/46] MAGETWO-55412: Reviewed and updated variations and constraints. --- .../Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml index 1e87903d068e1..dd42950c18a78 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/TestCase/CreateCurrencyRateTest.xml @@ -8,8 +8,7 @@ - severity:S1 - test_type:acceptance_test, test_type:extended_acceptance_test + test_type:acceptance_test, test_type:extended_acceptance_test, severity:S1 USD EUR 0.8 From e3cf96130548c2836ed51511437de74cc98efbff Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 8 Sep 2016 10:09:37 -0500 Subject: [PATCH 16/46] MAGETWO-55066: Reviewed and updated variations and constraints. --- .../Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml | 3 +-- .../Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml | 3 +-- .../Sitemap/Test/TestCase/CreateSitemapEntityTest.xml | 3 +-- .../Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml | 6 ++---- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml index 7990b64f97df8..67b4421182848 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.xml @@ -8,8 +8,7 @@ - severity:S1 - test_type:acceptance_test, test_type:extended_acceptance_test + test_type:acceptance_test, test_type:extended_acceptance_test, severity:S1 cmsPage Yes NewCmsPage%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml index a00bea4a3126d..3f413f78331d2 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageRewriteEntityTest.xml @@ -8,8 +8,7 @@ - severity:S1 - test_type:extended_acceptance_test + test_type:extended_acceptance_test, severity:S1 For CMS page cms/page/view/page_id/%cmsPage::default% request_path%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml index b9d589db0ac8f..cd948084a3bef 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml @@ -8,8 +8,7 @@ - severity:S1 - test_type:extended_acceptance_test + test_type:extended_acceptance_test, severity:S1 sitemap.xml / diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml index 520d1ce2d3db3..f533e115253ed 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest.xml @@ -19,8 +19,7 @@ - severity:S1 - test_type:extended_acceptance_test + test_type:extended_acceptance_test, severity:S1 CMS Page Link Magento Luma Title_%isolation% @@ -65,8 +64,7 @@ - severity:S1 - test_type:extended_acceptance_test + test_type:extended_acceptance_test, severity:S1 Catalog Product Link Magento Luma Title_%isolation% From e3989d290d47a4640b18e065a7a60d0ce81efeac Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 8 Sep 2016 10:18:24 -0500 Subject: [PATCH 17/46] MAGETWO-55066: Reviewed and updated variations and constraints. --- .../app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml index 7a07dc4ad7c68..51c0853a24dbc 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml @@ -8,8 +8,7 @@ - severity:S1 - test_type:extended_acceptance_test + test_type:extended_acceptance_test, severity:S1 block_%isolation% identifier_%isolation% All Store Views From 476b927255ef90700698b030e32fd4d7c190c5b2 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 8 Sep 2016 10:59:25 -0500 Subject: [PATCH 18/46] MAGETWO-55417: Reviewed and updated variations and constraints. --- ...dminUserWhenCreatingNewIntegrationTest.php | 1 + ...dminUserWhenCreatingNewIntegrationTest.xml | 1 + .../LockAdminUserWhenCreatingNewRoleTest.php | 1 + .../LockAdminUserWhenCreatingNewRoleTest.xml | 1 + .../TestCase/LockCustomerOnEditPageTest.php | 1 + .../TestCase/LockCustomerOnEditPageTest.xml | 1 + .../TestCase/LockCustomerOnLoginPageTest.php | 1 + .../TestCase/LockCustomerOnLoginPageTest.xml | 1 + .../NewCustomerPasswordComplexityTest.php | 1 + .../NewCustomerPasswordComplexityTest.xml | 2 + .../ResetCustomerPasswordFailedTest.php | 1 + .../ResetCustomerPasswordFailedTest.xml | 1 + .../TestCase/ResetUserPasswordFailedTest.php | 1 + .../TestCase/ResetUserPasswordFailedTest.xml | 1 + .../app/Magento/Security/Test/etc/di.xml | 39 +++++++++++++++++++ 15 files changed, 54 insertions(+) create mode 100644 dev/tests/functional/tests/app/Magento/Security/Test/etc/di.xml diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php index cc75c27949c0e..b977a8f098f49 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.php @@ -33,6 +33,7 @@ class LockAdminUserWhenCreatingNewIntegrationTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml index 87f109ac81bcf..aed87c9db7730 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml @@ -8,6 +8,7 @@ + severity:S2 user_lockout_failures custom_admin_with_default_role Integration%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php index 23a43100de854..7c76e4c4d43b8 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.php @@ -33,6 +33,7 @@ class LockAdminUserWhenCreatingNewRoleTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S2'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.xml index 3b9b5fd6295ee..7e5c44696d832 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewRoleTest.xml @@ -8,6 +8,7 @@ + severity:S2 user_lockout_failures custom_admin_with_default_role AdminRole%isolation% diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php index c5b910c124707..df1f872006561 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.php @@ -35,6 +35,7 @@ class LockCustomerOnEditPageTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.xml index 3e53235c075a6..89435ba2fb7f8 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnEditPageTest.xml @@ -8,6 +8,7 @@ + severity:S1 customer_max_login_failures_number default incorrect password diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php index 1612f1dac24e4..795a8531512c6 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.php @@ -29,6 +29,7 @@ class LockCustomerOnLoginPageTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.xml index 21318c5f3f0d5..a5376d73685ba 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockCustomerOnLoginPageTest.xml @@ -8,6 +8,7 @@ + severity:S1 customer_max_login_failures_number default incorrect password diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.php index 8fdab9165db03..3c77248a0debc 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.php @@ -25,6 +25,7 @@ class NewCustomerPasswordComplexityTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml index 925b8145f59ad..579c7fcfc05cb 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/NewCustomerPasswordComplexityTest.xml @@ -8,6 +8,7 @@ + severity:S1 john doe johndoe%isolation%@example.com @@ -17,6 +18,7 @@ + severity:S1 john doe johndoe%isolation%@example.com diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.php index d3b7a3ccb1304..71bd5e562c6dc 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.php @@ -27,6 +27,7 @@ class ResetCustomerPasswordFailedTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.xml index 88be6fae63d9b..92ce965b8bc4e 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetCustomerPasswordFailedTest.xml @@ -8,6 +8,7 @@ + severity:S1 customer_US 2 diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.php b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.php index 0bf600a7042f9..cc7683f251bef 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.php +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.php @@ -27,6 +27,7 @@ class ResetUserPasswordFailedTest extends Injectable { /* tags */ const MVP = 'yes'; + const SEVERITY = 'S1'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.xml index 3301cd8624a7c..644f494844a5b 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/ResetUserPasswordFailedTest.xml @@ -8,6 +8,7 @@ + severity:S1 custom_admin_with_default_role 2 diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Security/Test/etc/di.xml new file mode 100644 index 0000000000000..7e29aefb0475d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Security/Test/etc/di.xml @@ -0,0 +1,39 @@ + + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S1 + + + + + S2 + + + + + S1 + + + From c4a37c95631d82ba18efc9f85dbe9e6126bed5df Mon Sep 17 00:00:00 2001 From: Alex Bomko Date: Thu, 8 Sep 2016 20:34:43 +0300 Subject: [PATCH 19/46] MAGETWO-52446: Currency switcher is not working for home page widgets --- .../Block/Product/ProductsList.php | 24 +++++++++++++++++-- .../Unit/Block/Product/ProductsListTest.php | 10 ++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index a547fb862acac..0f665984b0e04 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -4,12 +4,11 @@ * See COPYING.txt for license details. */ -// @codingStandardsIgnoreFile - namespace Magento\CatalogWidget\Block\Product; use Magento\Framework\DataObject\IdentityInterface; use Magento\Widget\Block\BlockInterface; +use Magento\Framework\Pricing\PriceCurrencyInterface; /** * Catalog Products List widget block @@ -81,6 +80,11 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem */ protected $conditionsHelper; + /** + * @var PriceCurrencyInterface + */ + private $priceCurrency; + /** * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory @@ -144,6 +148,7 @@ public function getCacheKeyInfo() return [ 'CATALOG_PRODUCTS_LIST_WIDGET', + $this->getPriceCurrency()->getCurrencySymbol(), $this->_storeManager->getStore()->getId(), $this->_design->getDesignTheme()->getId(), $this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_GROUP), @@ -351,4 +356,19 @@ public function getTitle() { return $this->getData('title'); } + + /** + * @return PriceCurrencyInterface + * + * @deprecated + */ + private function getPriceCurrency() + { + if ($this->priceCurrency === null) { + $this->priceCurrency = \Magento\Framework\App\ObjectManager::getInstance() + ->get(PriceCurrencyInterface::class); + } + return $this->priceCurrency; + + } } diff --git a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php index fd4ae990a754d..c2410cea1d9bf 100644 --- a/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php +++ b/app/code/Magento/CatalogWidget/Test/Unit/Block/Product/ProductsListTest.php @@ -10,6 +10,7 @@ use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper; use Magento\Catalog\Model\Product\Visibility; +use Magento\Framework\Pricing\PriceCurrencyInterface; /** * Class ProductsListTest @@ -72,6 +73,11 @@ class ProductsListTest extends \PHPUnit_Framework_TestCase */ protected $layout; + /** + * @var PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $priceCurrency; + protected function setUp() { $this->collectionFactory = @@ -105,11 +111,13 @@ protected function setUp() ); $this->request = $arguments['context']->getRequest(); $this->layout = $arguments['context']->getLayout(); + $this->priceCurrency = $this->getMock(PriceCurrencyInterface::class); $this->productsList = $objectManagerHelper->getObject( \Magento\CatalogWidget\Block\Product\ProductsList::class, $arguments ); + $objectManagerHelper->setBackwardCompatibleProperty($this->productsList, 'priceCurrency', $this->priceCurrency); } public function testGetCacheKeyInfo() @@ -130,9 +138,11 @@ public function testGetCacheKeyInfo() $this->request->expects($this->once())->method('getParam')->with('page_number')->willReturn(1); $this->request->expects($this->once())->method('getParams')->willReturn('request_params'); + $this->priceCurrency->expects($this->once())->method('getCurrencySymbol')->willReturn('$'); $cacheKey = [ 'CATALOG_PRODUCTS_LIST_WIDGET', + '$', 1, 'blank', 'context_group', From 9d9ee76c011c32ae5c0521034b9858847f235d1f Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Fri, 9 Sep 2016 20:02:45 +0300 Subject: [PATCH 20/46] MAGETWO-56947: [API] Can not link simple product to configurable one - mainline --- .../ConfigurableProduct/Model/LinkManagement.php | 2 +- .../Test/Unit/Model/LinkManagementTest.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php index cd205746a9bce..8474991291104 100644 --- a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php +++ b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php @@ -103,7 +103,7 @@ public function addChild($sku, $childSku) } $childrenIds[] = $child->getId(); - $product->setAssociatedProductIds($childrenIds); + $product->getExtensionAttributes()->setConfigurableProductLinks($childrenIds); $product->save(); return true; } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php index 84d3ac72c187e..a5725f8f805de 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php @@ -7,6 +7,7 @@ namespace Magento\ConfigurableProduct\Test\Unit\Model; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\ConfigurableProduct\Test\Unit\Model\Product\ProductExtensionAttributes; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -162,7 +163,15 @@ public function testAddChild() ->will( $this->returnValue([0 => [1, 2, 3]]) ); - $configurable->expects($this->once())->method('__call')->with('setAssociatedProductIds', [[1, 2, 3, 999]]); + + $extensionAttributes = $this->getMockBuilder(ProductExtensionAttributes::class) + ->setMethods(['setConfigurableProductLinks']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $configurable->expects($this->once())->method('getExtensionAttributes')->willReturn($extensionAttributes); + $extensionAttributes->expects($this->once())->method('setConfigurableProductLinks')->willReturnSelf(); + $configurable->expects($this->once())->method('save'); $this->assertTrue(true, $this->object->addChild($productSku, $childSku)); From 512ad279ef0f049ef0ad2db201f396e187147ef0 Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Tue, 13 Sep 2016 01:14:52 +0300 Subject: [PATCH 21/46] =?UTF-8?q?MAGETWO-58134:=20[GitHub]=20Products=20be?= =?UTF-8?q?came=20=E2=80=9Cout=20of=20stock=E2=80=9D=20after=20update=20fr?= =?UTF-8?q?om=202.0.7=20to=202.1.0=20#5222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CatalogInventory/Setup/UpgradeData.php | 67 +++++++++++++++++++ .../Magento/CatalogInventory/etc/module.xml | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/CatalogInventory/Setup/UpgradeData.php diff --git a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php new file mode 100644 index 0000000000000..69affa03898c3 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php @@ -0,0 +1,67 @@ +configuration = $configuration; + $this->stockIndexerProcessor = $stockIndexerProcessor; + } + + /** + * {@inheritdoc} + */ + public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + $setup->startSetup(); + if (version_compare($context->getVersion(), '2.0.2') < 0) + { + $this->upgradeCatalogInventoryStockItem($setup); + } + $setup->endSetup(); + } + + /** + * @param ModuleDataSetupInterface $setup + * @return void + */ + private function upgradeCatalogInventoryStockItem($setup) + { + $setup->getConnection()->update( + $setup->getTable('cataloginventory_stock_item'), + ['website_id' => $this->configuration->getDefaultScopeId()] + ); + $this->stockIndexerProcessor->getIndexer()->reindexAll(); + } +} diff --git a/app/code/Magento/CatalogInventory/etc/module.xml b/app/code/Magento/CatalogInventory/etc/module.xml index 2224da524fccc..711d18bead9c9 100644 --- a/app/code/Magento/CatalogInventory/etc/module.xml +++ b/app/code/Magento/CatalogInventory/etc/module.xml @@ -6,7 +6,7 @@ */ --> - + From 4c5c1f90382b7d2d217d801f036f642c1cdeca18 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Tue, 13 Sep 2016 09:48:45 +0300 Subject: [PATCH 22/46] MAGETWO-58132: [GitHub] module:uninstall can remove code it uses itself #5797 --- .../Magento/Framework/Composer/RemoveTest.php | 37 ++++++++++--------- .../Magento/Framework/Composer/Remove.php | 3 +- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php b/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php index 3ec88e7ed4f0c..df3f75e0a90cf 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php @@ -5,31 +5,32 @@ */ namespace Magento\Framework\Composer; -use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Composer\MagentoComposerApplication; class RemoveTest extends \PHPUnit_Framework_TestCase { public function testRemove() { - $composerAppFactory = $this->getMock( - \Magento\Framework\Composer\MagentoComposerApplicationFactory::class, - [], - [], - '', - false - ); + $composerAppFactory = $this->getMockBuilder(MagentoComposerApplicationFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $composerApp = $this->getMockBuilder(MagentoComposerApplication::class) + ->disableOriginalConstructor() + ->getMock(); - $composerApp = $this->getMock( - \Magento\Composer\MagentoComposerApplication::class, - [], - [], - '', - false - ); + $composerApp->expects($this->once()) + ->method('runComposerCommand') + ->with( + [ + 'command' => 'remove', + 'packages' => ['magento/package-a', 'magento/package-b'], + '--no-update' => true, + ] - $composerApp->expects($this->once())->method('runComposerCommand'); - - $composerAppFactory->expects($this->once())->method('create')->willReturn($composerApp); + ); + $composerAppFactory->expects($this->once()) + ->method('create') + ->willReturn($composerApp); $remove = new Remove($composerAppFactory); $remove->remove(['magento/package-a', 'magento/package-b']); diff --git a/lib/internal/Magento/Framework/Composer/Remove.php b/lib/internal/Magento/Framework/Composer/Remove.php index 66e0063302bf4..6a2f8c3da00a5 100644 --- a/lib/internal/Magento/Framework/Composer/Remove.php +++ b/lib/internal/Magento/Framework/Composer/Remove.php @@ -45,7 +45,8 @@ public function remove(array $packages) return $composerApplication->runComposerCommand( [ 'command' => 'remove', - 'packages' => $packages + 'packages' => $packages, + '--no-update' => true, ] ); } From 9ce15d5a5be953096f06ed8a588cda616455775b Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Tue, 13 Sep 2016 10:01:17 +0300 Subject: [PATCH 23/46] MAGETWO-58132: [GitHub] module:uninstall can remove code it uses itself #5797 --- .../testsuite/Magento/Framework/Composer/RemoveTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php b/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php index df3f75e0a90cf..e852eea2ae449 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php @@ -26,7 +26,6 @@ public function testRemove() 'packages' => ['magento/package-a', 'magento/package-b'], '--no-update' => true, ] - ); $composerAppFactory->expects($this->once()) ->method('create') From ebc946a7672a3160d1fd0fd79fbb9a518b286a3c Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Tue, 13 Sep 2016 15:38:45 +0300 Subject: [PATCH 24/46] MAGETWO-58289: [Github] Product URL Key not automatically generating during import #5128 --- app/code/Magento/CatalogImportExport/Model/Import/Product.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 21c12bf0a8b1a..6df82623b1dd5 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1473,6 +1473,10 @@ protected function _saveProducts() } $rowScope = $this->getRowScope($rowData); + if (empty($rowData[self::URL_KEY])) { + $rowData[self::URL_KEY] = $this->getUrlKey($rowData); + } + $rowSku = $rowData[self::COL_SKU]; if (null === $rowSku) { From 30c372f534500c04623b3b5b96aa7f98a472d03e Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Tue, 13 Sep 2016 16:25:15 +0300 Subject: [PATCH 25/46] MAGETWO-58289: [Github] Product URL Key not automatically generating during import #5128 --- .../Model/Import/Product.php | 2 +- .../Model/Import/ProductTest.php | 39 +++++++++++++++++++ .../products_to_import_without_url_keys.csv | 4 ++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_without_url_keys.csv diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 6df82623b1dd5..4d2ea756f8c48 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1473,7 +1473,7 @@ protected function _saveProducts() } $rowScope = $this->getRowScope($rowData); - if (empty($rowData[self::URL_KEY])) { + if (empty($rowData[self::URL_KEY]) && !empty($rowData[self::COL_NAME])) { $rowData[self::URL_KEY] = $this->getUrlKey($rowData); } diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php index a1762a065ba88..5226abd6de136 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php @@ -1229,6 +1229,45 @@ public function testExistingProductWithUrlKeys() } } + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_url_key.php + * @magentoAppIsolation enabled + */ + public function testImportWithoutUrlKeys() + { + $products = [ + 'simple1' => 'simple-1', + 'simple2' => 'simple-2', + 'simple3' => 'simple-3' + ]; + $filesystem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create(\Magento\Framework\Filesystem::class); + $directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); + $source = $this->objectManager->create( + \Magento\ImportExport\Model\Import\Source\Csv::class, + [ + 'file' => __DIR__ . '/_files/products_to_import_without_url_keys.csv', + 'directory' => $directory + ] + ); + + $errors = $this->_model->setParameters( + ['behavior' => \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND, 'entity' => 'catalog_product'] + ) + ->setSource($source) + ->validateData(); + + $this->assertTrue($errors->getErrorsCount() == 0); + $this->_model->importData(); + + $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Api\ProductRepositoryInterface::class + ); + foreach ($products as $productSku => $productUrlKey) { + $this->assertEquals($productUrlKey, $productRepository->get($productSku)->getUrlKey()); + } + } + /** * @magentoAppIsolation enabled */ diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_without_url_keys.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_without_url_keys.csv new file mode 100644 index 0000000000000..c7efa4cb4bc30 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/products_to_import_without_url_keys.csv @@ -0,0 +1,4 @@ +sku,product_type,store_view_code,name,price,attribute_set_code,url_key +simple1,simple,,"simple 1",25,Default,"" +simple2,simple,,"simple 2",34,Default,"" +simple3,simple,,"simple 3",58,Default,"" \ No newline at end of file From f7094def4fbdc60882357c00d3fc4ec43037afdc Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Tue, 13 Sep 2016 17:09:21 +0300 Subject: [PATCH 26/46] MAGETWO-58289: [Github] Product URL Key not automatically generating during import #5128 --- .../Model/Import/Product.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 4d2ea756f8c48..873944c5188f5 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -1473,7 +1473,7 @@ protected function _saveProducts() } $rowScope = $this->getRowScope($rowData); - if (empty($rowData[self::URL_KEY]) && !empty($rowData[self::COL_NAME])) { + if (empty($rowData[self::URL_KEY])) { $rowData[self::URL_KEY] = $this->getUrlKey($rowData); } @@ -2528,12 +2528,18 @@ protected function getProductUrlSuffix($storeId = null) protected function getUrlKey($rowData) { if (!empty($rowData[self::URL_KEY])) { - $this->productUrlKeys[$rowData[self::COL_SKU]] = $rowData[self::URL_KEY]; + return $this->productUrlKeys[$rowData[self::COL_SKU]] = $rowData[self::URL_KEY]; } - $urlKey = !empty($this->productUrlKeys[$rowData[self::COL_SKU]]) - ? $this->productUrlKeys[$rowData[self::COL_SKU]] - : $this->productUrl->formatUrlKey($rowData[self::COL_NAME]); - return $urlKey; + + if (!empty($this->productUrlKeys[$rowData[self::COL_SKU]])) { + return $this->productUrlKeys[$rowData[self::COL_SKU]]; + } + + if (!empty($rowData[self::COL_NAME])) { + return $this->productUrl->formatUrlKey($rowData[self::COL_NAME]); + } + + return ''; } /** From 6c1cc07f81aa96ff1f5ea0071a92032f23684ff0 Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Tue, 13 Sep 2016 20:47:40 +0300 Subject: [PATCH 27/46] MAGETWO-56947: [API] Can not link simple product to configurable one - mainline --- app/code/Magento/Catalog/Model/Product.php | 11 ++++++++++- .../Model/LinkManagement.php | 4 ++-- .../Test/Unit/Model/LinkManagementTest.php | 19 +++++++------------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 603e566f14fa1..98c3f2a65030b 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -22,7 +22,6 @@ * @method Product setHasError(bool $value) * @method \Magento\Catalog\Model\ResourceModel\Product getResource() * @method null|bool getHasError() - * @method Product setAssociatedProductIds(array $productIds) * @method array getAssociatedProductIds() * @method Product setNewVariationsAttributeSetId(int $value) * @method int getNewVariationsAttributeSetId() @@ -2612,4 +2611,14 @@ private function getMediaGalleryProcessor() } return $this->mediaGalleryProcessor; } + + /** + * Set the associated products + * @param array $productIds + * @return void + */ + public function setAssociatedProductIds(array $productIds) + { + $this->getExtensionAttributes()->setConfigurableProductLinks($productIds); + } } diff --git a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php index 8474991291104..9947f2b23e506 100644 --- a/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php +++ b/app/code/Magento/ConfigurableProduct/Model/LinkManagement.php @@ -103,7 +103,7 @@ public function addChild($sku, $childSku) } $childrenIds[] = $child->getId(); - $product->getExtensionAttributes()->setConfigurableProductLinks($childrenIds); + $product->setAssociatedProductIds($childrenIds); $product->save(); return true; } @@ -132,7 +132,7 @@ public function removeChild($sku, $childSku) if (count($options) == count($ids)) { throw new NoSuchEntityException(__('Requested option doesn\'t exist')); } - $product->addData(['associated_product_ids' => $ids]); + $product->setAssociatedProductIds($ids); $product->save(); return true; } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php index a5725f8f805de..26552e5fb6e6b 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php @@ -7,7 +7,6 @@ namespace Magento\ConfigurableProduct\Test\Unit\Model; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; -use Magento\ConfigurableProduct\Test\Unit\Model\Product\ProductExtensionAttributes; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -163,15 +162,6 @@ public function testAddChild() ->will( $this->returnValue([0 => [1, 2, 3]]) ); - - $extensionAttributes = $this->getMockBuilder(ProductExtensionAttributes::class) - ->setMethods(['setConfigurableProductLinks']) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $configurable->expects($this->once())->method('getExtensionAttributes')->willReturn($extensionAttributes); - $extensionAttributes->expects($this->once())->method('setConfigurableProductLinks')->willReturnSelf(); - $configurable->expects($this->once())->method('save'); $this->assertTrue(true, $this->object->addChild($productSku, $childSku)); @@ -215,7 +205,7 @@ public function testRemoveChild() $childSku = 'simple_10'; $product = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) - ->setMethods(['getTypeInstance', 'save', 'getTypeId', 'addData', '__wakeup']) + ->setMethods(['getTypeInstance', 'save', 'getTypeId', 'addData', '__wakeup', 'getExtensionAttributes']) ->disableOriginalConstructor() ->getMock(); @@ -243,7 +233,12 @@ public function testRemoveChild() $productType->expects($this->once())->method('getUsedProducts') ->will($this->returnValue([$option])); - $product->expects($this->once())->method('addData')->with(['associated_product_ids' => []]); + $extensionAttributesMock = $this->getMockBuilder(\Magento\Framework\Api\ExtensionAttributesInterface::class) + ->disableOriginalConstructor() + ->setMethods(['setConfigurableProductLinks']) + ->getMock(); + + $product->expects($this->once())->method('getExtensionAttributes')->willReturn($extensionAttributesMock); $product->expects($this->once())->method('save'); $this->assertTrue($this->object->removeChild($productSku, $childSku)); } From a2a70eb314a9eef3136299505e3b5ac9227e115f Mon Sep 17 00:00:00 2001 From: Ruslan Kostiv Date: Tue, 13 Sep 2016 20:56:17 +0300 Subject: [PATCH 28/46] MAGETWO-56947: [API] Can not link simple product to configurable one - mainline --- app/code/Magento/Catalog/Model/Product.php | 4 ++-- .../Test/Unit/Model/LinkManagementTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 98c3f2a65030b..07f9655b792a3 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -2619,6 +2619,6 @@ private function getMediaGalleryProcessor() */ public function setAssociatedProductIds(array $productIds) { - $this->getExtensionAttributes()->setConfigurableProductLinks($productIds); - } + $this->getExtensionAttributes()->setConfigurableProductLinks($productIds); + } } diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php index 26552e5fb6e6b..d3f33973dbe3c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php +++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Model/LinkManagementTest.php @@ -238,7 +238,7 @@ public function testRemoveChild() ->setMethods(['setConfigurableProductLinks']) ->getMock(); - $product->expects($this->once())->method('getExtensionAttributes')->willReturn($extensionAttributesMock); + $product->expects($this->once())->method('getExtensionAttributes')->willReturn($extensionAttributesMock); $product->expects($this->once())->method('save'); $this->assertTrue($this->object->removeChild($productSku, $childSku)); } From 22d57a156ec0cfccc186ec11dd284f9f7148c87d Mon Sep 17 00:00:00 2001 From: Vitalii Korotun Date: Wed, 14 Sep 2016 14:18:23 +0300 Subject: [PATCH 29/46] MAGETWO-56552: Escape Js Quote for layout updates - fix moved to Select.php class to cover all possible use-cases - added Unit test --- .../Edit/Chooser/DesignAbstraction.php | 12 - .../Widget/Instance/Edit/Chooser/Layout.php | 12 - .../Framework/View/Element/Html/Select.php | 15 +- .../Test/Unit/Element/Html/SelectTest.php | 209 ++++++++++++++++-- 4 files changed, 193 insertions(+), 55 deletions(-) diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php index 0889b39e8e36f..93573402d18d2 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php @@ -48,18 +48,6 @@ public function __construct( parent::__construct($context, $data); } - /** - * {@inheritdoc} - * - * Add escapeJsQuote on $label - */ - public function addOption($value, $label, $params = []) - { - $label = $this->escapeJsQuote($label); - - return parent::addOption($value, $label, $params); - } - /** * Add necessary options * diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index a27537f131fb4..f458e2ab3a94a 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -32,18 +32,6 @@ public function __construct( parent::__construct($context, $data); } - /** - * {@inheritdoc} - * - * Add escapeJsQuote on $label - */ - public function addOption($value, $label, $params = []) - { - $label = $this->escapeJsQuote($label); - - return parent::addOption($value, $label, $params); - } - /** * Add necessary options * diff --git a/lib/internal/Magento/Framework/View/Element/Html/Select.php b/lib/internal/Magento/Framework/View/Element/Html/Select.php index e388e665dfdba..5ca493032e05f 100644 --- a/lib/internal/Magento/Framework/View/Element/Html/Select.php +++ b/lib/internal/Magento/Framework/View/Element/Html/Select.php @@ -134,13 +134,13 @@ protected function _toHtml() } $html = '' + . '' + . '' + . ''; + + $this->select->setIsRenderToJsTemplate(true); + $this->assertEquals($result, $this->select->getHtml()); + } + public function testGetHtml() { $selectId = 'testId'; @@ -137,33 +176,155 @@ public function testGetHtml() $this->assertEquals($result, $this->select->getHtml()); } - public function testGetHtmlJs() + public function testGetHtmlEscapes() { - $selectId = 'testId'; - $selectClass = 'testClass'; - $selectTitle = 'testTitle'; - $selectName = 'testName'; + $this->escaper->expects($this->any()) + ->method('escapeHtml') + ->will($this->returnValue('ESCAPED')); + $this->escaper->expects($this->any()) + ->method('escapeHtmlAttr') + ->will($this->returnValue('ESCAPED_ATTR')); - $options = [ - 'testValue' => 'testLabel', - 'selectedValue' => 'selectedLabel', + $optionsSets = [ + 'with-single-quote' => [ + 'in' => [ + 'id' => "test'Id", + 'class' => "test'Class", + 'title' => "test'Title", + 'name' => "test'Name", + 'options' => [ + 'regular' => [ + 'value' => 'testValue', + 'label' => "test'Label", + 'params' => ['paramKey' => "param'Value"] + ], + 'selected' => [ + 'value' => 'selectedValue', + 'label' => "selected'Label" + ], + 'optgroup' => [ + 'value' => [ + 'groupElementValue' => "GroupElement'Label", + 'selectedGroupElementValue' => "SelectedGroupElement'Label" + ], + 'label' => "group'Label" + ] + ], + 'values' => ['selectedValue', 'selectedGroupElementValue'] + ], + 'out' => [ + 'id' => 'ESCAPED_ATTR', + 'class' => 'ESCAPED_ATTR', + 'title' => 'ESCAPED_ATTR', + 'name' => 'ESCAPED_ATTR', + 'options' => [ + 'regular' => [ + 'value' => 'testValue', + 'label' => 'ESCAPED', + 'params' => ['paramKey' => 'ESCAPED_ATTR'] + ], + 'selected' => [ + 'value' => 'selectedValue', + 'label' => 'ESCAPED' + ], + 'optgroup' => [ + 'value' => [ + 'groupElementValue' => 'ESCAPED', + 'selectedGroupElementValue' => 'ESCAPED' + ], + 'label' => 'ESCAPED_ATTR' + ] + ], + 'values' => ['selectedValue', 'selectedGroupElementValue'] + ] + ], + 'with-double-quote' => [ + 'in' => [ + 'id' => 'test"Id', + 'class' => 'test"Class', + 'title' => 'test"Title', + 'name' => 'test"Name', + 'options' => [ + 'regular' => [ + 'value' => 'testValue', + 'label' => 'test"Label', + 'params' => ['paramKey' => 'param"Value'] + ], + 'selected' => [ + 'value' => 'selectedValue', + 'label' => 'selected"Label' + ], + 'optgroup' => [ + 'value' => [ + 'groupElementValue' => 'GroupElement"Label', + 'selectedGroupElementValue' => 'SelectedGroupElement"Label' + ], + 'label' => 'group"Label' + ] + ], + 'values' => ['selectedValue', 'selectedGroupElementValue'] + ], + 'out' => [ + 'id' => 'ESCAPED_ATTR', + 'class' => 'ESCAPED_ATTR', + 'title' => 'ESCAPED_ATTR', + 'name' => 'ESCAPED_ATTR', + 'options' => [ + 'regular' => [ + 'value' => 'testValue', + 'label' => 'ESCAPED', + 'params' => ['paramKey' => 'ESCAPED_ATTR'] + ], + 'selected' => [ + 'value' => 'selectedValue', + 'label' => 'ESCAPED' + ], + 'optgroup' => [ + 'value' => [ + 'groupElementValue' => 'ESCAPED', + 'selectedGroupElementValue' => 'ESCAPED' + ], + 'label' => 'ESCAPED_ATTR' + ] + ], + 'values' => ['selectedValue', 'selectedGroupElementValue'] + ] + ] ]; - $selectedValue = 'selectedValue'; - $this->select->setId($selectId); - $this->select->setClass($selectClass); - $this->select->setTitle($selectTitle); - $this->select->setName($selectName); - $this->select->setOptions($options); - $this->select->setValue($selectedValue); + foreach ($optionsSets as $optionsSet) { + $inOptions = $optionsSet['in']; - $result = '' + . '' + . '' + . '' + . '' + . '' + . '' . ''; - $this->select->setIsRenderToJsTemplate(true); - $this->assertEquals($result, $this->select->getHtml()); + return $result; } } From db44ae3b9e05fe2bdbb324b730437fb0f8eea0a4 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 14 Sep 2016 14:40:45 +0300 Subject: [PATCH 30/46] MAGETWO-58289: [Github] Product URL Key not automatically generating during import #5128 --- .../CatalogImportExport/Model/Import/Product.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index 873944c5188f5..bbc60649e0166 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -561,7 +561,10 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity /** @var array */ protected $productUrlSuffix = []; - /** @var array */ + /** + * @var array + * @deprecated + */ protected $productUrlKeys = []; /** @@ -2528,11 +2531,7 @@ protected function getProductUrlSuffix($storeId = null) protected function getUrlKey($rowData) { if (!empty($rowData[self::URL_KEY])) { - return $this->productUrlKeys[$rowData[self::COL_SKU]] = $rowData[self::URL_KEY]; - } - - if (!empty($this->productUrlKeys[$rowData[self::COL_SKU]])) { - return $this->productUrlKeys[$rowData[self::COL_SKU]]; + return $rowData[self::URL_KEY]; } if (!empty($rowData[self::COL_NAME])) { From ec882e7e14d56df84f28369e9ee7e3703b86676a Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Wed, 14 Sep 2016 14:58:25 +0300 Subject: [PATCH 31/46] =?UTF-8?q?MAGETWO-58134:=20[GitHub]=20Products=20be?= =?UTF-8?q?came=20=E2=80=9Cout=20of=20stock=E2=80=9D=20after=20update=20fr?= =?UTF-8?q?om=202.0.7=20to=202.1.0=20#5222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CatalogInventory/Setup/UpgradeData.php | 34 ++++++++++++------- app/code/Magento/CatalogInventory/etc/di.xml | 5 +++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php index 69affa03898c3..b332480e5f9e2 100644 --- a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php +++ b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php @@ -5,11 +5,12 @@ */ namespace Magento\CatalogInventory\Setup; -use Magento\CatalogInventory\Model\Configuration; -use Magento\CatalogInventory\Model\Indexer\Stock\Processor; +use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\Framework\Indexer\AbstractProcessor; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; +use Magento\Store\Model\StoreManagerInterface; /** * Upgrade Data script @@ -18,25 +19,33 @@ class UpgradeData implements UpgradeDataInterface { /** - * @var Configuration + * @var StockConfigurationInterface */ private $configuration; /** - * @var Processor + * @var AbstractProcessor */ - private $stockIndexerProcessor; + private $indexerProcessor; /** - * @param Configuration $configuration - * @param Processor $stockIndexerProcessor + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @param StockConfigurationInterface $configuration + * @param StoreManagerInterface $storeManager + * @param AbstractProcessor $indexerProcessor */ public function __construct( - Configuration $configuration, - Processor $stockIndexerProcessor + StockConfigurationInterface $configuration, + StoreManagerInterface $storeManager, + AbstractProcessor $indexerProcessor ) { $this->configuration = $configuration; - $this->stockIndexerProcessor = $stockIndexerProcessor; + $this->storeManager = $storeManager; + $this->indexerProcessor = $indexerProcessor; } /** @@ -60,8 +69,9 @@ private function upgradeCatalogInventoryStockItem($setup) { $setup->getConnection()->update( $setup->getTable('cataloginventory_stock_item'), - ['website_id' => $this->configuration->getDefaultScopeId()] + ['website_id' => $this->configuration->getDefaultScopeId()], + ['website_id = ?' => $this->storeManager->getWebsite()->getId()] ); - $this->stockIndexerProcessor->getIndexer()->reindexAll(); + $this->indexerProcessor->getIndexer()->reindexAll(); } } diff --git a/app/code/Magento/CatalogInventory/etc/di.xml b/app/code/Magento/CatalogInventory/etc/di.xml index eb97aa454f6e8..71b42ef89f73c 100644 --- a/app/code/Magento/CatalogInventory/etc/di.xml +++ b/app/code/Magento/CatalogInventory/etc/di.xml @@ -74,4 +74,9 @@ + + + Magento\CatalogInventory\Model\Indexer\Stock\Processor + + From a7a24897c5373d2e4f0331d0064fceefedcf52b7 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 14 Sep 2016 16:04:00 +0300 Subject: [PATCH 32/46] MAGETWO-58337: [Github] Duplicated & missing product rows in system product export #4531 --- app/code/Magento/CatalogImportExport/Model/Export/Product.php | 2 +- .../Test/Unit/Model/Export/ProductTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index 02953743662eb..2abd8d97ebc01 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -817,7 +817,7 @@ public function export() while (true) { ++$page; $entityCollection = $this->_getEntityCollection(true); - $entityCollection->setOrder('has_options', 'asc'); + $entityCollection->setOrder('entity_id', 'asc'); $entityCollection->setStoreId(Store::DEFAULT_STORE_ID); $this->_prepareEntityCollection($entityCollection); $this->paginateCollection($page, $this->getItemsPerPage()); diff --git a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Export/ProductTest.php b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Export/ProductTest.php index c61cb03aefa41..5e68a7d80bb4a 100644 --- a/app/code/Magento/CatalogImportExport/Test/Unit/Model/Export/ProductTest.php +++ b/app/code/Magento/CatalogImportExport/Test/Unit/Model/Export/ProductTest.php @@ -403,7 +403,7 @@ public function testExportCountZeroBreakInternalCalls() $this->product->expects($this->once())->method('_prepareEntityCollection')->with($this->abstractCollection); $this->product->expects($this->once())->method('getItemsPerPage')->willReturn($itemsPerPage); $this->product->expects($this->once())->method('paginateCollection')->with($page, $itemsPerPage); - $this->abstractCollection->expects($this->once())->method('setOrder')->with('has_options', 'asc'); + $this->abstractCollection->expects($this->once())->method('setOrder')->with('entity_id', 'asc'); $this->abstractCollection->expects($this->once())->method('setStoreId')->with(Store::DEFAULT_STORE_ID); $this->abstractCollection->expects($this->once())->method('count')->willReturn(0); @@ -434,7 +434,7 @@ public function testExportCurPageEqualToLastBreakInternalCalls() $this->product->expects($this->once())->method('_prepareEntityCollection')->with($this->abstractCollection); $this->product->expects($this->once())->method('getItemsPerPage')->willReturn($itemsPerPage); $this->product->expects($this->once())->method('paginateCollection')->with($page, $itemsPerPage); - $this->abstractCollection->expects($this->once())->method('setOrder')->with('has_options', 'asc'); + $this->abstractCollection->expects($this->once())->method('setOrder')->with('entity_id', 'asc'); $this->abstractCollection->expects($this->once())->method('setStoreId')->with(Store::DEFAULT_STORE_ID); $this->abstractCollection->expects($this->once())->method('count')->willReturn(1); From 9da5634882312ab9c3d32d227e5073ac84d0c2fb Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Fri, 16 Sep 2016 13:17:09 +0300 Subject: [PATCH 33/46] =?UTF-8?q?MAGETWO-58134:=20[GitHub]=20Products=20be?= =?UTF-8?q?came=20=E2=80=9Cout=20of=20stock=E2=80=9D=20after=20update=20fr?= =?UTF-8?q?om=202.0.7=20to=202.1.0=20#5222=20=20-=20remove=20reindex=20fro?= =?UTF-8?q?m=20data=20upgrade=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Magento/CatalogInventory/Setup/UpgradeData.php | 12 +----------- app/code/Magento/CatalogInventory/etc/di.xml | 5 ----- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php index b332480e5f9e2..55cd21bb0362b 100644 --- a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php +++ b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php @@ -6,7 +6,6 @@ namespace Magento\CatalogInventory\Setup; use Magento\CatalogInventory\Api\StockConfigurationInterface; -use Magento\Framework\Indexer\AbstractProcessor; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; @@ -23,11 +22,6 @@ class UpgradeData implements UpgradeDataInterface */ private $configuration; - /** - * @var AbstractProcessor - */ - private $indexerProcessor; - /** * @var StoreManagerInterface */ @@ -36,16 +30,13 @@ class UpgradeData implements UpgradeDataInterface /** * @param StockConfigurationInterface $configuration * @param StoreManagerInterface $storeManager - * @param AbstractProcessor $indexerProcessor */ public function __construct( StockConfigurationInterface $configuration, - StoreManagerInterface $storeManager, - AbstractProcessor $indexerProcessor + StoreManagerInterface $storeManager ) { $this->configuration = $configuration; $this->storeManager = $storeManager; - $this->indexerProcessor = $indexerProcessor; } /** @@ -72,6 +63,5 @@ private function upgradeCatalogInventoryStockItem($setup) ['website_id' => $this->configuration->getDefaultScopeId()], ['website_id = ?' => $this->storeManager->getWebsite()->getId()] ); - $this->indexerProcessor->getIndexer()->reindexAll(); } } diff --git a/app/code/Magento/CatalogInventory/etc/di.xml b/app/code/Magento/CatalogInventory/etc/di.xml index 71b42ef89f73c..eb97aa454f6e8 100644 --- a/app/code/Magento/CatalogInventory/etc/di.xml +++ b/app/code/Magento/CatalogInventory/etc/di.xml @@ -74,9 +74,4 @@ - - - Magento\CatalogInventory\Model\Indexer\Stock\Processor - - From a92bbd3a9b24733a210dc9d3c97a8eced271b7ff Mon Sep 17 00:00:00 2001 From: Nadiya Syvokonenko Date: Fri, 16 Sep 2016 13:32:27 +0300 Subject: [PATCH 34/46] =?UTF-8?q?MAGETWO-58134:=20[GitHub]=20Products=20be?= =?UTF-8?q?came=20=E2=80=9Cout=20of=20stock=E2=80=9D=20after=20update=20fr?= =?UTF-8?q?om=202.0.7=20to=202.1.0=20#5222=20=20-=20set=20cataloginventory?= =?UTF-8?q?=5Fstock=20index=20as=20invalid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Magento/CatalogInventory/Setup/UpgradeData.php | 12 +++++++++++- app/code/Magento/CatalogInventory/etc/di.xml | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php index 55cd21bb0362b..a7bc17e1f5051 100644 --- a/app/code/Magento/CatalogInventory/Setup/UpgradeData.php +++ b/app/code/Magento/CatalogInventory/Setup/UpgradeData.php @@ -6,6 +6,7 @@ namespace Magento\CatalogInventory\Setup; use Magento\CatalogInventory\Api\StockConfigurationInterface; +use Magento\Framework\Indexer\AbstractProcessor; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; @@ -22,6 +23,11 @@ class UpgradeData implements UpgradeDataInterface */ private $configuration; + /** + * @var AbstractProcessor + */ + private $indexerProcessor; + /** * @var StoreManagerInterface */ @@ -30,13 +36,16 @@ class UpgradeData implements UpgradeDataInterface /** * @param StockConfigurationInterface $configuration * @param StoreManagerInterface $storeManager + * @param AbstractProcessor $indexerProcessor */ public function __construct( StockConfigurationInterface $configuration, - StoreManagerInterface $storeManager + StoreManagerInterface $storeManager, + AbstractProcessor $indexerProcessor ) { $this->configuration = $configuration; $this->storeManager = $storeManager; + $this->indexerProcessor = $indexerProcessor; } /** @@ -63,5 +72,6 @@ private function upgradeCatalogInventoryStockItem($setup) ['website_id' => $this->configuration->getDefaultScopeId()], ['website_id = ?' => $this->storeManager->getWebsite()->getId()] ); + $this->indexerProcessor->getIndexer()->invalidate(); } } diff --git a/app/code/Magento/CatalogInventory/etc/di.xml b/app/code/Magento/CatalogInventory/etc/di.xml index eb97aa454f6e8..71b42ef89f73c 100644 --- a/app/code/Magento/CatalogInventory/etc/di.xml +++ b/app/code/Magento/CatalogInventory/etc/di.xml @@ -74,4 +74,9 @@ + + + Magento\CatalogInventory\Model\Indexer\Stock\Processor + + From 124db7139b57c3620657048e52d9a37084512f5b Mon Sep 17 00:00:00 2001 From: Vitalii Korotun Date: Fri, 16 Sep 2016 15:26:30 +0300 Subject: [PATCH 35/46] MAGETWO-56552: [GITHUB PR#4733] Escape Js Quote for layout updates - fix Unit tests --- .../Test/Unit/Element/Html/SelectTest.php | 222 +++++++++--------- 1 file changed, 117 insertions(+), 105 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/SelectTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/SelectTest.php index bccd79cddca20..96d4f9854a208 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/SelectTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/Html/SelectTest.php @@ -186,110 +186,8 @@ public function testGetHtmlEscapes() ->will($this->returnValue('ESCAPED_ATTR')); $optionsSets = [ - 'with-single-quote' => [ - 'in' => [ - 'id' => "test'Id", - 'class' => "test'Class", - 'title' => "test'Title", - 'name' => "test'Name", - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => "test'Label", - 'params' => ['paramKey' => "param'Value"] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => "selected'Label" - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => "GroupElement'Label", - 'selectedGroupElementValue' => "SelectedGroupElement'Label" - ], - 'label' => "group'Label" - ] - ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ], - 'out' => [ - 'id' => 'ESCAPED_ATTR', - 'class' => 'ESCAPED_ATTR', - 'title' => 'ESCAPED_ATTR', - 'name' => 'ESCAPED_ATTR', - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => 'ESCAPED', - 'params' => ['paramKey' => 'ESCAPED_ATTR'] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => 'ESCAPED' - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => 'ESCAPED', - 'selectedGroupElementValue' => 'ESCAPED' - ], - 'label' => 'ESCAPED_ATTR' - ] - ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ] - ], - 'with-double-quote' => [ - 'in' => [ - 'id' => 'test"Id', - 'class' => 'test"Class', - 'title' => 'test"Title', - 'name' => 'test"Name', - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => 'test"Label', - 'params' => ['paramKey' => 'param"Value'] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => 'selected"Label' - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => 'GroupElement"Label', - 'selectedGroupElementValue' => 'SelectedGroupElement"Label' - ], - 'label' => 'group"Label' - ] - ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ], - 'out' => [ - 'id' => 'ESCAPED_ATTR', - 'class' => 'ESCAPED_ATTR', - 'title' => 'ESCAPED_ATTR', - 'name' => 'ESCAPED_ATTR', - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => 'ESCAPED', - 'params' => ['paramKey' => 'ESCAPED_ATTR'] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => 'ESCAPED' - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => 'ESCAPED', - 'selectedGroupElementValue' => 'ESCAPED' - ], - 'label' => 'ESCAPED_ATTR' - ] - ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ] - ] + $this->getOptionsWithSingleQuotes(), + $this->getOptionsWithDoubleQuotes() ]; foreach ($optionsSets as $optionsSet) { @@ -317,7 +215,9 @@ public function testGetHtmlEscapes() private function prepareResult(array $optionSet) { $result = '' + . '' + . '' + . '' + . '' + . '' + . '' + . ''; + foreach ($optionsSets as $inOptions) { $this->select->setId($inOptions['id']); $this->select->setClass($inOptions['class']); $this->select->setTitle($inOptions['title']); @@ -203,140 +218,78 @@ public function testGetHtmlEscapes() } $this->select->setValue($inOptions['values']); - $result = $this->prepareResult($optionsSet['out']); - - $this->assertEquals($result, $this->select->getHtml()); + $this->assertEquals($expectedResult, $this->select->getHtml()); // reset $this->select->setOptions([]); } } - private function prepareResult(array $optionSet) - { - $result = ''; - - return $result; - } - + /** + * @return array + */ private function getOptionsWithSingleQuotes() { return [ - 'in' => [ - 'id' => "test'Id", - 'class' => "test'Class", - 'title' => "test'Title", - 'name' => "test'Name", - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => "test'Label", - 'params' => ['paramKey' => "param'Value"] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => "selected'Label" - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => "GroupElement'Label", - 'selectedGroupElementValue' => "SelectedGroupElement'Label" - ], - 'label' => "group'Label" - ] + 'id' => "test'Id", + 'class' => "test'Class", + 'title' => "test'Title", + 'name' => "test'Name", + 'options' => [ + 'regular' => [ + 'value' => 'testValue', + 'label' => "test'Label", + 'params' => ['paramKey' => "param'Value"] ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ], - 'out' => [ - 'id' => 'ESCAPED_ATTR', - 'class' => 'ESCAPED_ATTR', - 'title' => 'ESCAPED_ATTR', - 'name' => 'ESCAPED_ATTR', - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => 'ESCAPED', - 'params' => ['paramKey' => 'ESCAPED_ATTR'] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => 'ESCAPED' - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => 'ESCAPED', - 'selectedGroupElementValue' => 'ESCAPED' - ], - 'label' => 'ESCAPED_ATTR' - ] + 'selected' => [ + 'value' => 'selectedValue', + 'label' => "selected'Label", + 'params' => [] ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ] + 'optgroup' => [ + 'value' => [ + 'groupElementValue' => "GroupElement'Label", + 'selectedGroupElementValue' => "SelectedGroupElement'Label" + ], + 'label' => "group'Label", + 'params' => [] + ] + ], + 'values' => ['selectedValue', 'selectedGroupElementValue'] ]; } + /** + * @return array + */ private function getOptionsWithDoubleQuotes() { return [ - 'in' => [ - 'id' => 'test"Id', - 'class' => 'test"Class', - 'title' => 'test"Title', - 'name' => 'test"Name', - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => 'test"Label', - 'params' => ['paramKey' => 'param"Value'] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => 'selected"Label' - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => 'GroupElement"Label', - 'selectedGroupElementValue' => 'SelectedGroupElement"Label' - ], - 'label' => 'group"Label' - ] + 'id' => 'test"Id', + 'class' => 'test"Class', + 'title' => 'test"Title', + 'name' => 'test"Name', + 'options' => [ + 'regular' => [ + 'value' => 'testValue', + 'label' => 'test"Label', + 'params' => ['paramKey' => 'param"Value'] ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ], - 'out' => [ - 'id' => 'ESCAPED_ATTR', - 'class' => 'ESCAPED_ATTR', - 'title' => 'ESCAPED_ATTR', - 'name' => 'ESCAPED_ATTR', - 'options' => [ - 'regular' => [ - 'value' => 'testValue', - 'label' => 'ESCAPED', - 'params' => ['paramKey' => 'ESCAPED_ATTR'] - ], - 'selected' => [ - 'value' => 'selectedValue', - 'label' => 'ESCAPED' - ], - 'optgroup' => [ - 'value' => [ - 'groupElementValue' => 'ESCAPED', - 'selectedGroupElementValue' => 'ESCAPED' - ], - 'label' => 'ESCAPED_ATTR' - ] + 'selected' => [ + 'value' => 'selectedValue', + 'label' => 'selected"Label', + 'params' => [] ], - 'values' => ['selectedValue', 'selectedGroupElementValue'] - ] + 'optgroup' => [ + 'value' => [ + 'groupElementValue' => 'GroupElement"Label', + 'selectedGroupElementValue' => 'SelectedGroupElement"Label' + ], + 'label' => 'group"Label', + 'params' => [] + ] + ], + 'values' => ['selectedValue', 'selectedGroupElementValue'] ]; } } From 8b5f17dc64341db4f02949bf67112c3a3f112503 Mon Sep 17 00:00:00 2001 From: Vitalii Korotun Date: Fri, 16 Sep 2016 18:21:27 +0300 Subject: [PATCH 39/46] MAGETWO-56552: [GITHUB PR#4733] Escape Js Quote for layout updates - fix Unit tests --- .../Framework/View/Element/Html/Select.php | 16 ++++++++-------- .../View/Test/Unit/Element/Html/SelectTest.php | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/internal/Magento/Framework/View/Element/Html/Select.php b/lib/internal/Magento/Framework/View/Element/Html/Select.php index 5ca493032e05f..7e0c07ff75e45 100644 --- a/lib/internal/Magento/Framework/View/Element/Html/Select.php +++ b/lib/internal/Magento/Framework/View/Element/Html/Select.php @@ -134,13 +134,13 @@ protected function _toHtml() } $html = '' - . '' + $expectedResult = '