From a31c539707444cb191e25b00586087778bceffcf Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Mon, 19 Oct 2015 21:01:53 +0300 Subject: [PATCH 01/16] MAGETWO-39018: Wish list item image placeholder overlays link to wish list --- .../Wishlist/CustomerData/Wishlist.php | 98 +++++++++++++------ .../Test/Unit/CustomerData/WishlistTest.php | 29 +++++- .../view/frontend/templates/sidebar.phtml | 2 +- .../frontend/web/template/product_image.html | 7 -- 4 files changed, 96 insertions(+), 40 deletions(-) delete mode 100644 app/code/Magento/Wishlist/view/frontend/web/template/product_image.html diff --git a/app/code/Magento/Wishlist/CustomerData/Wishlist.php b/app/code/Magento/Wishlist/CustomerData/Wishlist.php index 2c4379872b8ab..0a9ceb2b66c03 100644 --- a/app/code/Magento/Wishlist/CustomerData/Wishlist.php +++ b/app/code/Magento/Wishlist/CustomerData/Wishlist.php @@ -3,7 +3,6 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Wishlist\CustomerData; use Magento\Customer\CustomerData\SectionSourceInterface; @@ -24,9 +23,9 @@ class Wishlist implements SectionSourceInterface protected $wishlistHelper; /** - * @var \Magento\Catalog\Helper\Image + * @var \Magento\Catalog\Helper\ImageFactory */ - protected $imageHelper; + protected $imageHelperFactory; /** * @var \Magento\Framework\App\ViewInterface @@ -41,17 +40,17 @@ class Wishlist implements SectionSourceInterface /** * @param \Magento\Wishlist\Helper\Data $wishlistHelper * @param \Magento\Wishlist\Block\Customer\Sidebar $block - * @param \Magento\Catalog\Helper\Image $imageHelper + * @param \Magento\Catalog\Helper\ImageFactory $imageHelperFactory * @param \Magento\Framework\App\ViewInterface $view */ public function __construct( \Magento\Wishlist\Helper\Data $wishlistHelper, \Magento\Wishlist\Block\Customer\Sidebar $block, - \Magento\Catalog\Helper\Image $imageHelper, + \Magento\Catalog\Helper\ImageFactory $imageHelperFactory, \Magento\Framework\App\ViewInterface $view ) { $this->wishlistHelper = $wishlistHelper; - $this->imageHelper = $imageHelper; + $this->imageHelperFactory = $imageHelperFactory; $this->block = $block; $this->view = $view; } @@ -100,35 +99,76 @@ protected function createCounter($count) protected function getItems() { $this->view->loadLayout(); + $collection = $this->wishlistHelper->getWishlistItemCollection(); $collection->clear()->setPageSize(self::SIDEBAR_ITEMS_NUMBER) ->setInStockFilter(true)->setOrder('added_at'); + $items = []; - /** @var \Magento\Wishlist\Model\Item $wishlistItem */ foreach ($collection as $wishlistItem) { - $product = $wishlistItem->getProduct(); - $this->imageHelper->init($product, 'wishlist_sidebar_block'); - $items[] = [ - 'image' => [ - 'src' => $this->imageHelper->getUrl(), - 'alt' => $this->imageHelper->getLabel(), - 'width' => $this->imageHelper->getWidth(), - 'height' => $this->imageHelper->getHeight(), - ], - 'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem), - 'product_name' => $product->getName(), - 'product_price' => $this->block->getProductPriceHtml( - $product, - \Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, - \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, - ['item' => $wishlistItem] - ), - 'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(), - 'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product), - 'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem, true), - 'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem, true), - ]; + $items[] = $this->getItemData($wishlistItem); } return $items; } + + /** + * Retrieve wishlist item data + * + * @param \Magento\Wishlist\Model\Item $wishlistItem + * @return array + */ + protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem) + { + $product = $wishlistItem->getProduct(); + return [ + 'image' => $this->getImageData($product), + 'product_url' => $this->wishlistHelper->getProductUrl($wishlistItem), + 'product_name' => $product->getName(), + 'product_price' => $this->block->getProductPriceHtml( + $product, + \Magento\Catalog\Pricing\Price\ConfiguredPriceInterface::CONFIGURED_PRICE_CODE, + \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST, + ['item' => $wishlistItem] + ), + 'product_is_saleable_and_visible' => $product->isSaleable() && $product->isVisibleInSiteVisibility(), + 'product_has_required_options' => $product->getTypeInstance()->hasRequiredOptions($product), + 'add_to_cart_params' => $this->wishlistHelper->getAddToCartParams($wishlistItem, true), + 'delete_item_params' => $this->wishlistHelper->getRemoveParams($wishlistItem, true), + ]; + } + + /** + * Retrieve product image data + * + * @param \Magento\Catalog\Model\Product $product + * @return \Magento\Catalog\Block\Product\Image + */ + protected function getImageData($product) + { + /** @var \Magento\Catalog\Helper\Image $helper */ + $helper = $this->imageHelperFactory->create() + ->init($product, 'wishlist_sidebar_block'); + + $template = $helper->getFrame() + ? 'Magento_Catalog/product/image' + : 'Magento_Catalog/product/image_with_borders'; + + $imagesize = $helper->getResizedImageInfo(); + + $width = $helper->getFrame() + ? $helper->getWidth() + : (!empty($imagesize[0]) ? $imagesize[0] : $helper->getWidth()); + + $height = $helper->getFrame() + ? $helper->getHeight() + : (!empty($imagesize[1]) ? $imagesize[1] : $helper->getHeight()); + + return [ + 'template' => $template, + 'src' => $helper->getUrl(), + 'width' => $width, + 'height' => $height, + 'alt' => $helper->getLabel(), + ]; + } } diff --git a/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php b/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php index 24368820dc4df..470be780e1269 100644 --- a/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php +++ b/app/code/Magento/Wishlist/Test/Unit/CustomerData/WishlistTest.php @@ -46,16 +46,24 @@ protected function setUp() $this->sidebarMock = $this->getMockBuilder('Magento\Wishlist\Block\Customer\Sidebar') ->disableOriginalConstructor() ->getMock(); + $this->viewMock = $this->getMockBuilder('Magento\Framework\App\ViewInterface') + ->getMockForAbstractClass(); + $this->catalogImageHelperMock = $this->getMockBuilder('Magento\Catalog\Helper\Image') ->disableOriginalConstructor() ->getMock(); - $this->viewMock = $this->getMockBuilder('Magento\Framework\App\ViewInterface') - ->getMockForAbstractClass(); + $imageHelperFactory = $this->getMockBuilder('Magento\Catalog\Helper\ImageFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $imageHelperFactory->expects($this->any()) + ->method('create') + ->willReturn($this->catalogImageHelperMock); $this->model = new Wishlist( $this->wishlistHelperMock, $this->sidebarMock, - $this->catalogImageHelperMock, + $imageHelperFactory, $this->viewMock ); } @@ -83,6 +91,7 @@ public function testGetSectionData() 'items' => [ [ 'image' => [ + 'template' => 'Magento_Catalog/product/image', 'src' => $imageUrl, 'alt' => $imageLabel, 'width' => $imageWidth, @@ -165,6 +174,12 @@ public function testGetSectionData() $this->catalogImageHelperMock->expects($this->once()) ->method('getHeight') ->willReturn($imageHeight); + $this->catalogImageHelperMock->expects($this->any()) + ->method('getFrame') + ->willReturn(true); + $this->catalogImageHelperMock->expects($this->once()) + ->method('getResizedImageInfo') + ->willReturn([]); $this->wishlistHelperMock->expects($this->once()) ->method('getProductUrl') @@ -251,6 +266,7 @@ public function testGetSectionDataWithTwoItems() 'items' => [ [ 'image' => [ + 'template' => 'Magento_Catalog/product/image', 'src' => $imageUrl, 'alt' => $imageLabel, 'width' => $imageWidth, @@ -266,6 +282,7 @@ public function testGetSectionDataWithTwoItems() ], [ 'image' => [ + 'template' => 'Magento_Catalog/product/image', 'src' => $imageUrl, 'alt' => $imageLabel, 'width' => $imageWidth, @@ -342,6 +359,12 @@ public function testGetSectionDataWithTwoItems() $this->catalogImageHelperMock->expects($this->exactly(2)) ->method('getHeight') ->willReturn($imageHeight); + $this->catalogImageHelperMock->expects($this->any()) + ->method('getFrame') + ->willReturn(true); + $this->catalogImageHelperMock->expects($this->exactly(2)) + ->method('getResizedImageInfo') + ->willReturn([]); $this->wishlistHelperMock->expects($this->exactly(2)) ->method('getProductUrl') diff --git a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml index bab2e79a75f33..1d7eb6e7dcc73 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/sidebar.phtml @@ -26,7 +26,7 @@ $wishlistHelper = $this->helper('Magento\Wishlist\Helper\Data');
  • - +
    diff --git a/app/code/Magento/Wishlist/view/frontend/web/template/product_image.html b/app/code/Magento/Wishlist/view/frontend/web/template/product_image.html deleted file mode 100644 index da88b3236c986..0000000000000 --- a/app/code/Magento/Wishlist/view/frontend/web/template/product_image.html +++ /dev/null @@ -1,7 +0,0 @@ - - From 6591bf080749dc01568bc8605200b9f492a9200b Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Tue, 20 Oct 2015 14:45:35 +0300 Subject: [PATCH 02/16] MAGETWO-39018: Wish list item image placeholder overlays link to wish list --- app/code/Magento/Wishlist/CustomerData/Wishlist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Wishlist/CustomerData/Wishlist.php b/app/code/Magento/Wishlist/CustomerData/Wishlist.php index 0a9ceb2b66c03..c937e334992c2 100644 --- a/app/code/Magento/Wishlist/CustomerData/Wishlist.php +++ b/app/code/Magento/Wishlist/CustomerData/Wishlist.php @@ -142,6 +142,7 @@ protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem) * * @param \Magento\Catalog\Model\Product $product * @return \Magento\Catalog\Block\Product\Image + * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function getImageData($product) { From 4696a9b4d2d63824856ec5915aeda97e8a7ceb0b Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Tue, 20 Oct 2015 16:58:54 +0300 Subject: [PATCH 03/16] MAGETWO-44304: Product grid is broken on Storefront Category page if HTML files minification is enabled --- lib/internal/Magento/Framework/View/Template/Html/Minifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php index af80583da16e7..6b9017a1972ce 100644 --- a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php +++ b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php @@ -117,7 +117,7 @@ public function minify($file) ')\s+#', - '$1', + '$1 ', preg_replace( '#(?inlineHtmlTags) . ')\> \<#', '><', From 6a3ecbcd041a234a90f98358d7bcc0fb2850c4aa Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Tue, 20 Oct 2015 17:07:39 +0300 Subject: [PATCH 04/16] MAGETWO-44182: Customer custom attribute of type 'file' prevent to save customer --- app/code/Magento/Eav/Model/Entity/AbstractEntity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php index 14147d6849de9..c52d87b51b419 100644 --- a/app/code/Magento/Eav/Model/Entity/AbstractEntity.php +++ b/app/code/Magento/Eav/Model/Entity/AbstractEntity.php @@ -1296,11 +1296,11 @@ protected function _collectSaveData($newObject) } elseif (!is_numeric($v) && $v !== $origData[$k] || is_numeric($v) && $v != $origData[$k]) { $update[$attrId] = [ 'value_id' => $attribute->getBackend()->getEntityValueId($newObject), - 'value' => $v, + 'value' => is_array($v) ? array_shift($v) : $v,//@TODO: MAGETWO-44182, ]; } } elseif (!$this->_isAttributeValueEmpty($attribute, $v)) { - $insert[$attrId] = $v; + $insert[$attrId] = is_array($v) ? array_shift($v) : $v;//@TODO: MAGETWO-44182 } } From 7fb9c49ba5b4ea3481d5c5eb77c198dd57d61bdd Mon Sep 17 00:00:00 2001 From: Oleksandr Karpenko Date: Tue, 20 Oct 2015 18:53:30 +0300 Subject: [PATCH 05/16] MAGETWO-44017: Exception appears when user opens scheduled import export without installed imort/export --- .../Framework/Module/DependencyChecker.php | 21 ++++--- .../Magento/Framework/Module/PackageInfo.php | 63 ++++++++++++++++++- 2 files changed, 76 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/Module/DependencyChecker.php b/lib/internal/Magento/Framework/Module/DependencyChecker.php index 44f771fb6ca20..b4e5d043e4721 100644 --- a/lib/internal/Magento/Framework/Module/DependencyChecker.php +++ b/lib/internal/Magento/Framework/Module/DependencyChecker.php @@ -33,6 +33,9 @@ class DependencyChecker */ private $graph; + /** @var PackageInfo */ + private $packageInfo; + /** * Constructor * @@ -44,8 +47,8 @@ public function __construct(ModuleList $list, ModuleList\Loader $loader, Package { $this->enabledModuleList = $list->getNames(); $this->fullModuleList = $loader->load(); - $packageInfo = $packageInfoFactory->create(); - $this->graph = $this->createGraph($packageInfo); + $this->packageInfo = $packageInfoFactory->create(); + $this->graph = $this->createGraph(); } /** @@ -93,7 +96,10 @@ private function checkDependencyGraph($isEnable, $moduleNames, $enabledModules) foreach ($moduleNames as $moduleName) { $dependenciesMissing = []; $paths = $this->graph->findPathsToReachableNodes($moduleName, $graphMode); - foreach (array_keys($this->fullModuleList) as $module) { + $modules = array_merge( + array_keys($this->fullModuleList), $this->packageInfo->getNonExistingDependencies() + ); + foreach ($modules as $module) { if (isset($paths[$module])) { if ($isEnable && !in_array($module, $enabledModules)) { $dependenciesMissing[$module] = $paths[$module]; @@ -110,10 +116,9 @@ private function checkDependencyGraph($isEnable, $moduleNames, $enabledModules) /** * Create the dependency graph * - * @param PackageInfo $packageInfo * @return Graph */ - private function createGraph(PackageInfo $packageInfo) + private function createGraph() { $nodes = []; $dependencies = []; @@ -121,13 +126,15 @@ private function createGraph(PackageInfo $packageInfo) // build the graph data foreach (array_keys($this->fullModuleList) as $moduleName) { $nodes[] = $moduleName; - foreach ($packageInfo->getRequire($moduleName) as $dependModuleName) { + foreach ($this->packageInfo->getRequire($moduleName) as $dependModuleName) { if ($dependModuleName) { $dependencies[] = [$moduleName, $dependModuleName]; } } } - $nodes = array_unique($nodes); + $nodes = array_unique( + array_merge($nodes, $this->packageInfo->getNonExistingDependencies()) + ); return new Graph($nodes, $dependencies); } diff --git a/lib/internal/Magento/Framework/Module/PackageInfo.php b/lib/internal/Magento/Framework/Module/PackageInfo.php index 97fd828c36d6c..938d357b0a27f 100644 --- a/lib/internal/Magento/Framework/Module/PackageInfo.php +++ b/lib/internal/Magento/Framework/Module/PackageInfo.php @@ -53,6 +53,9 @@ class PackageInfo */ private $componentRegistrar; + /** @var array */ + protected $nonExistingDependencies = []; + /** * Constructor * @@ -104,7 +107,65 @@ private function load() public function getModuleName($packageName) { $this->load(); - return isset($this->packageModuleMap[$packageName]) ? $this->packageModuleMap[$packageName] : ''; + + $moduleName = null; + if (isset($this->packageModuleMap[$packageName])) { + $moduleName = $this->packageModuleMap[$packageName]; + } else if ($this->isInternalPackage($packageName)) { + $moduleName = $this->convertPackageNameToModuleName($packageName); + $this->addNonExistingDependency($moduleName); + } + + return $moduleName; + } + + /** + * Add non existing dependency + * + * @param $dependency + */ + protected function addNonExistingDependency($dependency) + { + if (!isset($this->nonExistingDependencies[$dependency])) { + $this->nonExistingDependencies[$dependency] = $dependency; + } + } + + /** + * Return list of non existing dependencies + * + * @return array + */ + public function getNonExistingDependencies() + { + return $this->nonExistingDependencies; + } + + /** + * Build module name based on internal package name + * + * @param string $packageName + * @return string|null + */ + protected function convertPackageNameToModuleName($packageName) + { + $moduleName = str_replace('magento/module-', '', $packageName); + $moduleName = str_replace('-', ' ', $moduleName); + $moduleName = ucwords($moduleName); + $moduleName = str_replace(' ', '', $moduleName); + + return 'Magento_' . $moduleName; + } + + /** + * Check if package is internal magento module + * + * @param string $packageName + * @return bool + */ + protected function isInternalPackage($packageName) + { + return strpos($packageName, 'magento/module-') === 0; } /** From ff4ac7c54d39ae81602a391c0be19253a7a4e32c Mon Sep 17 00:00:00 2001 From: Oleksandr Karpenko Date: Tue, 20 Oct 2015 19:13:46 +0300 Subject: [PATCH 06/16] MAGETWO-44017: Exception appears when user opens scheduled import export without installed imort/export --- .../Magento/Framework/Module/DependencyChecker.php | 6 ++++-- .../Magento/Framework/Module/PackageInfo.php | 14 ++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/internal/Magento/Framework/Module/DependencyChecker.php b/lib/internal/Magento/Framework/Module/DependencyChecker.php index b4e5d043e4721..e84e2b99a119d 100644 --- a/lib/internal/Magento/Framework/Module/DependencyChecker.php +++ b/lib/internal/Magento/Framework/Module/DependencyChecker.php @@ -33,8 +33,10 @@ class DependencyChecker */ private $graph; - /** @var PackageInfo */ - private $packageInfo; + /** + * @var PackageInfo + */ + protected $packageInfo; /** * Constructor diff --git a/lib/internal/Magento/Framework/Module/PackageInfo.php b/lib/internal/Magento/Framework/Module/PackageInfo.php index 938d357b0a27f..1e2ed5064c8e6 100644 --- a/lib/internal/Magento/Framework/Module/PackageInfo.php +++ b/lib/internal/Magento/Framework/Module/PackageInfo.php @@ -53,7 +53,9 @@ class PackageInfo */ private $componentRegistrar; - /** @var array */ + /** + * @var array + */ protected $nonExistingDependencies = []; /** @@ -111,7 +113,7 @@ public function getModuleName($packageName) $moduleName = null; if (isset($this->packageModuleMap[$packageName])) { $moduleName = $this->packageModuleMap[$packageName]; - } else if ($this->isInternalPackage($packageName)) { + } elseif ($this->isMagentoPackage($packageName)) { $moduleName = $this->convertPackageNameToModuleName($packageName); $this->addNonExistingDependency($moduleName); } @@ -122,7 +124,8 @@ public function getModuleName($packageName) /** * Add non existing dependency * - * @param $dependency + * @param string $dependency + * @return void */ protected function addNonExistingDependency($dependency) { @@ -151,8 +154,7 @@ protected function convertPackageNameToModuleName($packageName) { $moduleName = str_replace('magento/module-', '', $packageName); $moduleName = str_replace('-', ' ', $moduleName); - $moduleName = ucwords($moduleName); - $moduleName = str_replace(' ', '', $moduleName); + $moduleName = str_replace(' ', '', ucwords($moduleName)); return 'Magento_' . $moduleName; } @@ -163,7 +165,7 @@ protected function convertPackageNameToModuleName($packageName) * @param string $packageName * @return bool */ - protected function isInternalPackage($packageName) + protected function isMagentoPackage($packageName) { return strpos($packageName, 'magento/module-') === 0; } From 6c73c31351fc07a9b4c2cf20444bcbfe1d526bb6 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Tue, 20 Oct 2015 19:47:00 +0300 Subject: [PATCH 07/16] MAGETWO-44025: Can't edit bundle product from wishlist --- .../Magento/Bundle/Model/Product/Price.php | 23 +++- .../Test/Unit/Model/Product/PriceTest.php | 117 ++++++++++++++++++ 2 files changed, 137 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Bundle/Model/Product/Price.php b/app/code/Magento/Bundle/Model/Product/Price.php index d7dd23bc8931e..73902761e14a5 100644 --- a/app/code/Magento/Bundle/Model/Product/Price.php +++ b/app/code/Magento/Bundle/Model/Product/Price.php @@ -118,9 +118,8 @@ public function getTotalBundleItemsPrice($product, $qty = null) { $price = 0.0; if ($product->hasCustomOptions()) { - $customOption = $product->getCustomOption('bundle_selection_ids'); - if ($customOption) { - $selectionIds = unserialize($customOption->getValue()); + $selectionIds = $this->getBundleSelectionIds($product); + if ($selectionIds) { $selections = $product->getTypeInstance()->getSelectionsByIds($selectionIds, $product); $selections->addTierPriceData(); $this->_eventManager->dispatch( @@ -145,6 +144,24 @@ public function getTotalBundleItemsPrice($product, $qty = null) return $price; } + /** + * Retrieve array of bundle selection IDs + * + * @param \Magento\Catalog\Model\Product $product + * @return array + */ + protected function getBundleSelectionIds(\Magento\Catalog\Model\Product $product) + { + $customOption = $product->getCustomOption('bundle_selection_ids'); + if ($customOption) { + $selectionIds = unserialize($customOption->getValue()); + if (!empty($selectionIds) && is_array($selectionIds)) { + return $selectionIds; + } + } + return []; + } + /** * Get product final price * diff --git a/app/code/Magento/Bundle/Test/Unit/Model/Product/PriceTest.php b/app/code/Magento/Bundle/Test/Unit/Model/Product/PriceTest.php index 226418b97aed8..887d772ea4032 100644 --- a/app/code/Magento/Bundle/Test/Unit/Model/Product/PriceTest.php +++ b/app/code/Magento/Bundle/Test/Unit/Model/Product/PriceTest.php @@ -146,4 +146,121 @@ public function calculateSpecialPrice() [10, 100, 1, true, 10], ]; } + + public function testGetTotalBundleItemsPriceWithNoCustomOptions() + { + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->once()) + ->method('hasCustomOptions') + ->willReturn(false); + + $this->assertEquals(0, $this->model->getTotalBundleItemsPrice($productMock)); + } + + /** + * @param string|null $value + * @dataProvider dataProviderWithEmptyOptions + */ + public function testGetTotalBundleItemsPriceWithEmptyOptions($value) + { + $dataObjectMock = $this->getMockBuilder('Magento\Framework\DataObject') + ->setMethods(['getValue']) + ->disableOriginalConstructor() + ->getMock(); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->once()) + ->method('hasCustomOptions') + ->willReturn(true); + $productMock->expects($this->once()) + ->method('getCustomOption') + ->with('bundle_selection_ids') + ->willReturn($dataObjectMock); + + $dataObjectMock->expects($this->once()) + ->method('getValue') + ->willReturn($value); + + $this->assertEquals(0, $this->model->getTotalBundleItemsPrice($productMock)); + } + + /** + * @return array + */ + public function dataProviderWithEmptyOptions() + { + return [ + ['a:0:{}'], + [''], + [null], + ]; + } + + public function testGetTotalBundleItemsPriceWithNoItems() + { + $storeId = 1; + + $dataObjectMock = $this->getMockBuilder('Magento\Framework\DataObject') + ->setMethods(['getValue']) + ->disableOriginalConstructor() + ->getMock(); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $productTypeMock = $this->getMockBuilder('Magento\Bundle\Model\Product\Type') + ->disableOriginalConstructor() + ->getMock(); + + $selectionsMock = $this->getMockBuilder('Magento\Bundle\Model\ResourceModel\Selection\Collection') + ->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->once()) + ->method('hasCustomOptions') + ->willReturn(true); + $productMock->expects($this->once()) + ->method('getCustomOption') + ->with('bundle_selection_ids') + ->willReturn($dataObjectMock); + $productMock->expects($this->once()) + ->method('getTypeInstance') + ->willReturn($productTypeMock); + $productMock->expects($this->once()) + ->method('getStoreId') + ->willReturn($storeId); + + $dataObjectMock->expects($this->once()) + ->method('getValue') + ->willReturn('a:1:{i:0;s:1:"1";}'); + + $productTypeMock->expects($this->once()) + ->method('getSelectionsByIds') + ->with([1], $productMock) + ->willReturn($selectionsMock); + + $selectionsMock->expects($this->once()) + ->method('addTierPriceData') + ->willReturnSelf(); + $selectionsMock->expects($this->once()) + ->method('getItems') + ->willReturn([]); + + $this->eventManagerMock->expects($this->once()) + ->method('dispatch') + ->with( + 'prepare_catalog_product_collection_prices', + ['collection' => $selectionsMock, 'store_id' => $storeId] + ) + ->willReturnSelf(); + + $this->assertEquals(0, $this->model->getTotalBundleItemsPrice($productMock)); + } } From 27972acd81a0df5ea58d667de49ebe9b508d40c0 Mon Sep 17 00:00:00 2001 From: Oleksandr Karpenko Date: Wed, 21 Oct 2015 11:17:13 +0300 Subject: [PATCH 08/16] MAGETWO-44017: Exception appears when user opens scheduled import export without installed imort/export --- .../Framework/Module/DependencyChecker.php | 3 ++- .../Module/Test/Unit/DependencyCheckerTest.php | 18 ++++++++++++++---- .../Module/Test/Unit/PackageInfoTest.php | 5 +++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Module/DependencyChecker.php b/lib/internal/Magento/Framework/Module/DependencyChecker.php index e84e2b99a119d..71c811daf3c46 100644 --- a/lib/internal/Magento/Framework/Module/DependencyChecker.php +++ b/lib/internal/Magento/Framework/Module/DependencyChecker.php @@ -99,7 +99,8 @@ private function checkDependencyGraph($isEnable, $moduleNames, $enabledModules) $dependenciesMissing = []; $paths = $this->graph->findPathsToReachableNodes($moduleName, $graphMode); $modules = array_merge( - array_keys($this->fullModuleList), $this->packageInfo->getNonExistingDependencies() + array_keys($this->fullModuleList), + $this->packageInfo->getNonExistingDependencies() ); foreach ($modules as $module) { if (isset($paths[$module])) { diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php index eb09d4a41ac3b..0d7774d8ddad8 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/DependencyCheckerTest.php @@ -70,10 +70,12 @@ public function setUp() public function testCheckDependenciesWhenDisableModules() { - $this->listMock - ->expects($this->any()) + $this->listMock->expects($this->any()) ->method('getNames') ->will($this->returnValue(['A', 'B', 'C', 'D', 'E'])); + $this->packageInfoMock->expects($this->atLeastOnce()) + ->method('getNonExistingDependencies') + ->willReturn([]); $this->checker = new DependencyChecker($this->listMock, $this->loaderMock, $this->packageInfoFactoryMock); $actual = $this->checker->checkDependenciesWhenDisableModules(['B', 'D']); @@ -83,6 +85,9 @@ public function testCheckDependenciesWhenDisableModules() public function testCheckDependenciesWhenDisableModulesWithCurEnabledModules() { + $this->packageInfoMock->expects($this->atLeastOnce()) + ->method('getNonExistingDependencies') + ->willReturn([]); $this->checker = new DependencyChecker($this->listMock, $this->loaderMock, $this->packageInfoFactoryMock); $actual = $this->checker->checkDependenciesWhenDisableModules(['B', 'D'], ['C', 'D', 'E']); @@ -92,10 +97,12 @@ public function testCheckDependenciesWhenDisableModulesWithCurEnabledModules() public function testCheckDependenciesWhenEnableModules() { - $this->listMock - ->expects($this->any()) + $this->listMock->expects($this->any()) ->method('getNames') ->will($this->returnValue(['C'])); + $this->packageInfoMock->expects($this->atLeastOnce()) + ->method('getNonExistingDependencies') + ->willReturn([]); $this->checker = new DependencyChecker($this->listMock, $this->loaderMock, $this->packageInfoFactoryMock); $actual = $this->checker->checkDependenciesWhenEnableModules(['B', 'D']); $expected = [ @@ -107,6 +114,9 @@ public function testCheckDependenciesWhenEnableModules() public function testCheckDependenciesWhenEnableModulesWithCurEnabledModules() { + $this->packageInfoMock->expects($this->atLeastOnce()) + ->method('getNonExistingDependencies') + ->willReturn([]); $this->checker = new DependencyChecker($this->listMock, $this->loaderMock, $this->packageInfoFactoryMock); $actual = $this->checker->checkDependenciesWhenEnableModules(['B', 'D'], ['C']); $expected = [ diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php index 8a2512c485fd1..4328b62c0c6ce 100644 --- a/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php +++ b/lib/internal/Magento/Framework/Module/Test/Unit/PackageInfoTest.php @@ -57,6 +57,11 @@ public function testGetModuleName() $this->assertEquals('C', $this->packageInfo->getModuleName('c')); $this->assertEquals('D', $this->packageInfo->getModuleName('d')); $this->assertEquals('E', $this->packageInfo->getModuleName('e')); + $this->assertEquals( + 'Magento_TestModuleName', + $this->packageInfo->getModuleName('magento/module-test-module-name') + ); + $this->assertArrayHasKey('Magento_TestModuleName', $this->packageInfo->getNonExistingDependencies()); } public function testGetPackageName() From b100744447f9171b242ba6bac89ef8be8538d725 Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Wed, 21 Oct 2015 12:43:13 +0300 Subject: [PATCH 09/16] MAGETWO-43869: The "Header contains invalid attribute(s)..." message appears wher user tries to import customers --- .../Model/Import/Customer.php | 51 +++++++++++-------- .../Model/Import/CustomerComposite.php | 22 +++++--- .../Model/Import/AbstractEntity.php | 12 ++++- .../Model/Import/Entity/AbstractEntity.php | 12 ++++- 4 files changed, 67 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/CustomerImportExport/Model/Import/Customer.php b/app/code/Magento/CustomerImportExport/Model/Import/Customer.php index 6cf06f839c175..ef92b5194c5d0 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/Customer.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/Customer.php @@ -5,6 +5,7 @@ */ namespace Magento\CustomerImportExport\Model\Import; +use Magento\Customer\Api\Data\CustomerInterface; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; /** @@ -135,25 +136,25 @@ class Customer extends AbstractCustomer /** * Customer fields in file */ - public $customerFields = [ - 'group_id', - 'store_id', - 'updated_at', - 'created_at', - 'created_in', - 'prefix', - 'firstname', - 'middlename', - 'lastname', - 'suffix', - 'dob', + protected $customerFields = [ + CustomerInterface::GROUP_ID, + CustomerInterface::STORE_ID, + CustomerInterface::UPDATED_AT, + CustomerInterface::CREATED_AT, + CustomerInterface::CREATED_IN, + CustomerInterface::PREFIX, + CustomerInterface::FIRSTNAME, + CustomerInterface::MIDDLENAME, + CustomerInterface::LASTNAME, + CustomerInterface::SUFFIX, + CustomerInterface::DOB, 'password_hash', - 'taxvat', - 'confirmation', - 'gender', + CustomerInterface::TAXVAT, + CustomerInterface::CONFIRMATION, + CustomerInterface::GENDER, 'rp_token', 'rp_token_created_at', - ]; + ]; /** * @param \Magento\Framework\Stdlib\StringUtils $string @@ -237,11 +238,6 @@ public function __construct( $this->_initStores(true)->_initAttributes(); - $this->validColumnNames = array_merge( - $this->validColumnNames, - $this->customerFields - ); - $this->_customerModel = $customerFactory->create(); /** @var $customerResource \Magento\Customer\Model\ResourceModel\Customer */ $customerResource = $this->_customerModel->getResource(); @@ -562,4 +558,17 @@ public function getEntityTable() { return $this->_entityTable; } + + /** + * @inheritDoc + */ + public function getValidColumnNames() + { + $this->validColumnNames = array_merge( + $this->validColumnNames, + $this->customerFields + ); + + return $this->validColumnNames; + } } diff --git a/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php b/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php index ed7d2f8fe9e85..97d2407a7805c 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php @@ -224,13 +224,6 @@ public function __construct( } $this->_initAddressAttributes(); - $this->validColumnNames = array_merge( - $this->validColumnNames, - $this->_customerAttributes, - $this->_addressAttributes, - $this->_customerEntity->customerFields - ); - // next customer id if (isset($data['next_customer_id'])) { $this->_nextCustomerId = $data['next_customer_id']; @@ -489,4 +482,19 @@ protected function _prepareRowForDb(array $rowData) return parent::_prepareRowForDb($rowData); } + + /** + * @inheritDoc + */ + public function getValidColumnNames() + { + $this->validColumnNames = array_merge( + $this->validColumnNames, + $this->_customerAttributes, + $this->_addressAttributes, + $this->_customerEntity->customerFields + ); + + return $this->validColumnNames; + } } diff --git a/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php index e9b684c2bd2a9..085c9261e3412 100644 --- a/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Import/AbstractEntity.php @@ -792,7 +792,7 @@ public function validateData() $emptyHeaderColumns[] = $columnNumber; } elseif (!preg_match('/^[a-z][a-z0-9_]*$/', $columnName)) { $invalidColumns[] = $columnName; - } elseif ($this->needColumnCheck && !in_array($columnName, $this->validColumnNames)) { + } elseif ($this->needColumnCheck && !in_array($columnName, $this->getValidColumnNames())) { $invalidAttributes[] = $columnName; } } @@ -854,4 +854,14 @@ protected function updateItemsCounterStats(array $created = [], array $updated = $this->countItemsDeleted = count($deleted); return $this; } + + /** + * Retrieve valid column names + * + * @return array + */ + public function getValidColumnNames() + { + return $this->validColumnNames; + } } diff --git a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php index 81422c45e13a8..9a0971d18e104 100644 --- a/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php +++ b/app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php @@ -763,7 +763,7 @@ public function validateData() $emptyHeaderColumns[] = $columnNumber; } elseif (!preg_match('/^[a-z][a-z0-9_]*$/', $columnName)) { $invalidColumns[] = $columnName; - } elseif ($this->needColumnCheck && !in_array($columnName, $this->validColumnNames)) { + } elseif ($this->needColumnCheck && !in_array($columnName, $this->getValidColumnNames())) { $invalidAttributes[] = $columnName; } } @@ -818,4 +818,14 @@ public function getDeletedItemsCount() { return $this->countItemsDeleted; } + + /** + * Retrieve valid column names + * + * @return array + */ + public function getValidColumnNames() + { + return $this->validColumnNames; + } } From 7802b8b1a13bc4f1c0534cea014771bef9b60e4a Mon Sep 17 00:00:00 2001 From: Oleksandr Karpenko Date: Wed, 21 Oct 2015 18:30:19 +0300 Subject: [PATCH 10/16] MAGETWO-44411: CLONE - Container "page.bottom.container" isn't created in empty layout file --- app/code/Magento/Theme/view/base/page_layout/empty.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/view/base/page_layout/empty.xml b/app/code/Magento/Theme/view/base/page_layout/empty.xml index 09d5658a86c4b..d69d34f79e64a 100644 --- a/app/code/Magento/Theme/view/base/page_layout/empty.xml +++ b/app/code/Magento/Theme/view/base/page_layout/empty.xml @@ -16,7 +16,7 @@ - + From 6ab3673e397d57e4fb9091c496f145c26e337a81 Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Wed, 21 Oct 2015 19:13:00 +0300 Subject: [PATCH 11/16] MAGETWO-44315: Multiple select customer attribute is not saved in admin if more than one values selected --- .../Magento/Ui/view/base/web/js/form/element/multiselect.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js index 6c5de791d1e87..1260a366cc07a 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js @@ -20,8 +20,10 @@ define([ * * @returns {Array} */ - normalizeData: function () { - var value = this._super(); + normalizeData: function (value) { + if (utils.isEmpty(value)) { + value = []; + } return _.isString(value) ? value.split(',') : value; }, From 17a5dbfa388ac24d4969f157e0026291f0d40f7e Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 21 Oct 2015 19:18:43 +0300 Subject: [PATCH 12/16] MAGETWO-42285: Customer Information In Grid Shows Wrong Account "Created In" Field --- .../Customer/Model/AccountManagement.php | 7 +++ .../Test/Unit/Model/AccountManagementTest.php | 59 ++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index 500a104861d3b..06be21a82e3c1 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -513,6 +513,13 @@ public function createAccountWithPasswordHash(CustomerInterface $customer, $hash $customer->setStoreId($storeId); } + // Update 'created_in' value with actual store name + if ($customer->getId() === null) { + $storeName = $this->storeManager->getStore($customer->getStoreId()) + ->getName(); + $customer->setCreatedIn($storeName); + } + $customerAddresses = $customer->getAddresses() ?: []; $customer->setAddresses(null); try { diff --git a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php index d5fc01b379051..62d7232bda0f2 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php @@ -265,7 +265,7 @@ public function testCreateAccountWithPasswordHashWithCustomerWithoutStoreId() ->method('getDefaultStore') ->willReturn($store); $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); - $customer->expects($this->once()) + $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); $customer->expects($this->once()) @@ -341,7 +341,7 @@ public function testCreateAccountWithPasswordHashWithLocalizedException() ->method('getDefaultStore') ->willReturn($store); $customer = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface')->getMock(); - $customer->expects($this->once()) + $customer->expects($this->atLeastOnce()) ->method('getId') ->willReturn($customerId); $customer->expects($this->once()) @@ -478,6 +478,61 @@ public function testCreateAccountWithPasswordHashWithAddressException() $this->accountManagement->createAccountWithPasswordHash($customer, $hash); } + /** + * @expectedException \Magento\Framework\Exception\LocalizedException + */ + public function testCreateAccountWithPasswordHashWithNewCustomerAndLocalizedException() + { + $storeId = 1; + $storeName = 'store_name'; + $hash = '4nj54lkj5jfi03j49f8bgujfgsd'; + + $customerMock = $this->getMockBuilder('Magento\Customer\Api\Data\CustomerInterface') + ->getMockForAbstractClass(); + + $customerMock->expects($this->atLeastOnce()) + ->method('getId') + ->willReturn(null); + $customerMock->expects($this->atLeastOnce()) + ->method('getStoreId') + ->willReturn($storeId); + $customerMock->expects($this->once()) + ->method('setCreatedIn') + ->with($storeName) + ->willReturnSelf(); + $customerMock->expects($this->once()) + ->method('getAddresses') + ->willReturn([]); + $customerMock->expects($this->once()) + ->method('setAddresses') + ->with(null) + ->willReturnSelf(); + + $storeMock = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + + $storeMock->expects($this->once()) + ->method('getName') + ->willReturn($storeName); + + $this->storeManager->expects($this->once()) + ->method('getStore') + ->with($storeId) + ->willReturn($storeMock); + + $exception = new \Magento\Framework\Exception\LocalizedException( + new \Magento\Framework\Phrase('Exception message') + ); + $this->customerRepository + ->expects($this->once()) + ->method('save') + ->with($customerMock, $hash) + ->willThrowException($exception); + + $this->accountManagement->createAccountWithPasswordHash($customerMock, $hash); + } + /** * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ From 7633d01c77f3a871cc8b6853c5d29639e6862b9d Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Wed, 21 Oct 2015 19:25:50 +0300 Subject: [PATCH 13/16] MAGETWO-43587: Sorting by price does not work in backend grid --- .../Model/ResourceModel/Product/Collection.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 0393bf0227625..15421607a696f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -133,22 +133,6 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Collection\Abstrac */ protected $_priceDataFieldFilters = []; - /** - * Map of price fields - * - * @var array - */ - protected $_map = [ - 'fields' => [ - 'price' => 'price_index.price', - 'final_price' => 'price_index.final_price', - 'min_price' => 'price_index.min_price', - 'max_price' => 'price_index.max_price', - 'tier_price' => 'price_index.tier_price', - 'special_price' => 'price_index.special_price', - ], - ]; - /** * Price expression sql * From 1314e8735445dd55a8cf04af6897d2c6736b5091 Mon Sep 17 00:00:00 2001 From: Maxim Medinskiy Date: Thu, 22 Oct 2015 12:31:23 +0300 Subject: [PATCH 14/16] MAGETWO-43869: The "Header contains invalid attribute(s)..." message appears wher user tries to import customers --- .../CustomerImportExport/Model/Import/CustomerComposite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php b/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php index 97d2407a7805c..a42167fb68134 100644 --- a/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php +++ b/app/code/Magento/CustomerImportExport/Model/Import/CustomerComposite.php @@ -492,7 +492,7 @@ public function getValidColumnNames() $this->validColumnNames, $this->_customerAttributes, $this->_addressAttributes, - $this->_customerEntity->customerFields + $this->_customerEntity->getValidColumnNames() ); return $this->validColumnNames; From baa7682fc1b4da365ae74f6972b8084c828e5527 Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Thu, 22 Oct 2015 13:51:31 +0300 Subject: [PATCH 15/16] MAGETWO-42285: Customer Information In Grid Shows Wrong Account "Created In" Field --- .../Magento/Customer/Model/AccountManagementTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php index 65c3aae162bf6..077f18fbe2cf3 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/AccountManagementTest.php @@ -587,7 +587,6 @@ public function testCreateNonexistingCustomer() 'email' => $email, 'firstname' => $firstName, 'lastname' => $lastName, - 'created_in' => 'Admin', 'id' => null ] ); @@ -603,7 +602,6 @@ public function testCreateNonexistingCustomer() $this->assertEquals($email, $customerAfter->getEmail()); $this->assertEquals($firstName, $customerAfter->getFirstname()); $this->assertEquals($lastName, $customerAfter->getLastname()); - $this->assertEquals('Admin', $customerAfter->getCreatedIn()); $this->accountManagement->authenticate( $customerAfter->getEmail(), 'aPassword' @@ -807,7 +805,6 @@ public function testCreateNewCustomerFromClone() $customerEntity->setEmail($email) ->setFirstname($firstName) ->setLastname($lastname) - ->setCreatedIn('Admin') ->setId(null); $customer = $this->accountManagement->createAccount($customerEntity, 'aPassword'); @@ -815,7 +812,6 @@ public function testCreateNewCustomerFromClone() $this->assertEquals($email, $customer->getEmail()); $this->assertEquals($firstName, $customer->getFirstname()); $this->assertEquals($lastname, $customer->getLastname()); - $this->assertEquals('Admin', $customer->getCreatedIn()); $this->accountManagement->authenticate( $customer->getEmail(), 'aPassword', From 80a905f7ab88865ea3d78fdeab29db579bb7e326 Mon Sep 17 00:00:00 2001 From: Andriy Nasinnyk Date: Thu, 22 Oct 2015 17:48:25 +0300 Subject: [PATCH 16/16] MAGETWO-44304: Product grid is broken on Storefront Category page if HTML files minification is enabled --- .../Framework/View/Test/Unit/Template/Html/MinifierTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php index a93962b3ae7e6..e598a93c243a4 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php @@ -117,7 +117,7 @@ public function testMinify() TEXT; $expectedContent = <<Test titleText Link some textsomeMethod(); ?>