From 34ab5502ce12306607bf87c69105be00a038e078 Mon Sep 17 00:00:00 2001 From: Olga Matviienko Date: Mon, 12 Oct 2015 12:50:49 +0300 Subject: [PATCH 01/83] MAGETWO-42358: Action buttons are displayed shuffled in Storefront Wish List --- .../web/css/source/_module.less | 268 +++++++++--------- 1 file changed, 140 insertions(+), 128 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less index 506bbbd71fe10..49720b30a2cf6 100644 --- a/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less @@ -4,143 +4,143 @@ // */ // -// Common -//-------------------------------------- +// Common +// _____________________________________________ & when (@media-common = true) { -.form.wishlist.items { - .actions-toolbar { - &:extend(.abs-reset-left-margin all); + .form.wishlist.items { + .actions-toolbar { + &:extend(.abs-reset-left-margin all); + } } -} -.product-info-main, -.product-options-bottom, -.block-bundle-summary { - .action.towishlist { - &:extend(.abs-action-addto-product all); + .product-info-main, + .product-options-bottom, + .block-bundle-summary { + .action.towishlist { + &:extend(.abs-action-addto-product all); + } } -} -.products.list.items, -.table-comparison { - .action { - &.towishlist { - &:extend(.abs-actions-addto-gridlist all); - .lib-icon-font-symbol( - @icon-wishlist-empty - ); + .products.list.items, + .table-comparison { + .action { + &.towishlist { + &:extend(.abs-actions-addto-gridlist all); + .lib-icon-font-symbol( + @icon-wishlist-empty + ); + } } } -} -.account .table-wrapper .data.table.wishlist { - .lib-table-bordered( - @_table_type: horizontal - ); - thead > tr > th { - border-bottom: 0; - } - tbody > tr:last-child > td { - border-bottom: 1px solid @table__border-color; - } - .product.name { - display: inline-block; - margin-bottom: @indent__s; - } - .box-tocart { - margin: @indent__s 0; - .qty { - vertical-align: middle; - &:extend(.abs-input-qty all); + .account .table-wrapper .data.table.wishlist { + .lib-table-bordered( + @_table_type: horizontal + ); + thead > tr > th { + border-bottom: 0; } - } - .col { - &.item { - width: 50%; + tbody > tr:last-child > td { + border-bottom: 1px solid @table__border-color; } - &.photo { - max-width: 150px; + .product.name { + display: inline-block; + margin-bottom: @indent__s; } - &.selector { - max-width: 15px; + .box-tocart { + margin: @indent__s 0; + .qty { + vertical-align: middle; + &:extend(.abs-input-qty all); + } + } + .col { + &.item { + width: 50%; + } + &.photo { + max-width: 150px; + } + &.selector { + max-width: 15px; + } + } + textarea { + margin: @indent__s 0; + } + .input-text.qty { + margin-bottom: @indent__s; + } + .action.primary { + vertical-align: top; + } + .price { + font-weight: @font-weight__bold; } } - textarea { - margin: 10px 0; - } - .input-text.qty { - margin-bottom: 10px; - } - .action.primary { - vertical-align: top; - } - .price { - font-weight: @font-weight__bold; - } -} -.block-wishlist { - .block-title { - &:extend(.abs-block-title all); - } - .counter { - &:extend(.abs-block-items-counter all); - } - .product-item-name { - margin-right: @indent__m; + .block-wishlist { + .block-title { + &:extend(.abs-block-title all); + } + .counter { + &:extend(.abs-block-items-counter all); + } + .product-item-name { + margin-right: @indent__m; + } } -} -.products-grid.wishlist { - .product { - &-item { - &-photo { - margin-bottom: @indent__s; - display: block; - } - &-name { - margin-top: 0; - } - .price-box { - margin: 0; - } - &-tooltip { - } - .comment-box { - .label { - &:extend(.abs-visually-hidden all); + .products-grid.wishlist { + .product { + &-item { + &-photo { + display: block; + margin-bottom: @indent__s; } - } - &-comment { - display: block; - margin: @indent__s 0; - height: 42px; - } - &-actions { - > * { - margin-right: 15px; - &:last-child { - margin-right: 0; + &-name { + margin-top: 0; + } + .price-box { + margin: 0; + } + &-tooltip { + } + .comment-box { + .label { + &:extend(.abs-visually-hidden all); } } - } - .box-tocart { - input.qty { - height: 32px; - &:extend(.abs-input-qty all); + &-comment { + display: block; + height: 42px; + margin: @indent__s 0; + } + &-actions { + > * { + margin-right: 15px; + &:last-child { + margin-right: 0; + } + } + } + .box-tocart { + input.qty { + height: 32px; + &:extend(.abs-input-qty all); + } } } } } } -} - // -// Mobile -//-------------------------------------- +// Mobile +// _____________________________________________ + .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { .products-grid.wishlist { .product-item { @@ -154,15 +154,15 @@ .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) { .products-grid.wishlist { - margin-right: -@indent__s; margin-bottom: @indent__l; + margin-right: -@indent__s; .product { &-item { padding: @indent__base @indent__s @indent__base @indent__base; position: relative; &-photo { - margin-right: @indent__base; float: left; + margin-right: @indent__base; } &-name { .lib-font-size(16); @@ -211,8 +211,9 @@ } // - // Grid view for wishlist - //-------------------------------------- + // Grid view for wishlist + // ----------------------------------------- + .wishlist-index-index { .product { &-item { @@ -229,7 +230,7 @@ .wishlist-index-index { .products-grid { .product-item { - margin-bottom: 20px; + margin-bottom: @indent__base; width: 50%; } .product-item-actions { @@ -240,8 +241,9 @@ } // -// Desktop -//-------------------------------------- +// Desktop +// _____________________________________________ + .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .products-grid.wishlist { .product { @@ -253,12 +255,9 @@ margin: @indent__s 0 0; } .fieldset { - .field.qty, - .product-item-actions { - } .field.qty { - padding-right: @indent__s; margin-bottom: @indent__s; + padding-right: @indent__s; .label { width: auto; } @@ -275,7 +274,7 @@ } } } - .wishlist-index-index { + .wishlist-index-index { .product { &-item { &-info { @@ -283,17 +282,30 @@ } } } + .main { + .form-wishlist-items { + .actions-toolbar { + &:extend(.abs-reset-left-margin-desktop all); + } + } + } } } .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__l) { - .wishlist-index-index .products-grid .product-items { margin: 0; } - .wishlist-index-index .products-grid .product-item { - width: 24.439%; - margin-left: calc(~"(100% - 4 * 24.439%) / 3"); - padding: 0; - &:nth-child(4n+1) { - margin-left: 0; + .wishlist-index-index { + .products-grid { + .product-items { + margin: 0; + } + .product-item { + margin-left: calc(~"(100% - 4 * 24.439%) / 3"); + padding: 0; + width: 24.439%; + &:nth-child(4n+1) { + margin-left: 0; + } + } } } } From 9861ef93e6e2936f0193fbb756541dd72e9372d2 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Mon, 12 Oct 2015 13:01:24 +0300 Subject: [PATCH 02/83] MAGETWO-43929: Regression scope functional tests maintenance - Fixes for AddProductToShoppingCart --- .../Constraint/AssertGrandTotalInShoppingCart.php | 1 + .../TestCase/AddProductsToShoppingCartEntityTest.xml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php index ee7f596cc053d..13068aa03c618 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php @@ -28,6 +28,7 @@ public function processAssert(CheckoutCart $checkoutCart, Cart $cart, $requireRe { if ($requireReload) { $checkoutCart->open(); + $checkoutCart->getTotalsBlock()->waitForUpdatedTotals(); } $fixtureGrandTotal = number_format($cart->getGrandTotal(), 2); diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml index 69ab253de55c0..87bb8d8e3b97c 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml @@ -9,7 +9,7 @@ bundleProduct::bundle_dynamic_product - 200 + 210 @@ -18,7 +18,7 @@ bundleProduct::bundle_fixed_product - 756 + 761 @@ -27,7 +27,7 @@ catalogProductSimple::with_two_custom_option - 340 + 345 @@ -45,7 +45,7 @@ configurableProduct::default - 120 + 135 @@ -63,7 +63,7 @@ groupedProduct::three_simple_products - 1920 + 1950 @@ -72,7 +72,7 @@ catalogProductSimple::with_two_custom_option, catalogProductVirtual::product_50_dollar, downloadableProduct::with_two_separately_links, groupedProduct::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product - 2852.43 + 2922.43 From 4f1cfb72b578dd5852110b1f51b9333bab535f2d Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Mon, 12 Oct 2015 15:06:57 +0300 Subject: [PATCH 03/83] MAGETWO-42984: Remove Section from Customer Data --- .../Magento/Customer/Block/CustomerData.php | 32 +------------------ .../frontend/templates/js/customer-data.phtml | 1 - .../view/frontend/web/js/customer-data.js | 8 ----- 3 files changed, 1 insertion(+), 40 deletions(-) diff --git a/app/code/Magento/Customer/Block/CustomerData.php b/app/code/Magento/Customer/Block/CustomerData.php index 66d4043f152e6..9d30a56de217b 100644 --- a/app/code/Magento/Customer/Block/CustomerData.php +++ b/app/code/Magento/Customer/Block/CustomerData.php @@ -7,24 +7,14 @@ class CustomerData extends \Magento\Framework\View\Element\Template { - /** - * Sections that can not be cached on frontend-side - * - * @var array - */ - protected $nonCachedSections = []; - /** * @param \Magento\Framework\View\Element\Template\Context $context * @param array $data - * @param array $nonCachedSections */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, - array $data = [], - array $nonCachedSections = [] + array $data = [] ) { - $this->nonCachedSections = $nonCachedSections; parent::__construct($context, $data); } @@ -50,24 +40,4 @@ public function getCustomerDataUrl($route) { return $this->getUrl($route, ['_secure' => $this->getRequest()->isSecure()]); } - - /** - * Get sections that can not be cached on frontend-side - * - * @return array - */ - public function getNotCachedSections() - { - return $this->nonCachedSections; - } - - /** - * Get keys of sections that can not be cached on frontend-side - * - * @return array - */ - public function getNonCachedSectionKeys() - { - return array_keys($this->nonCachedSections); - } } diff --git a/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml b/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml index 60441eb039d72..b34e7c871d3bf 100644 --- a/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml +++ b/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml @@ -13,7 +13,6 @@ '*' => ['Magento_Customer/js/customer-data' => [ 'sectionLoadUrl' => $block->getCustomerDataUrl('customer/section/load'), 'cookieLifeTime' => $block->getCookieLifeTime(), - 'nonCachedSections' => $block->getNonCachedSectionKeys(), ]], ]); ?> diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js index 726fa0816d71d..f76913fee604f 100644 --- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js +++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js @@ -23,8 +23,6 @@ define([ storage.removeAll(); var date = new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000); $.localStorage.set('mage-cache-timeout', date); - } else { - invalidateNonCachedSections(options); } }; @@ -35,12 +33,6 @@ define([ } }; - var invalidateNonCachedSections = function(options) { - _.each(options.nonCachedSections, function (sectionName) { - storageInvalidation.set(sectionName, true); - }); - } - var dataProvider = { getFromStorage: function (sectionNames) { var result = {}; From 537ef9982515dbcbd34079a62f66b747c5ac5875 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Mon, 12 Oct 2015 16:29:26 +0300 Subject: [PATCH 04/83] MAGETWO-42984: Remove Section from Customer Data --- .../Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php index 63308bbea50d1..e432b6c13ebd0 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php @@ -127,6 +127,7 @@ public function test( $this->customerAccountIndex->getInfoBlock()->openEditContactInfo(); $this->customerAccountEdit->getAccountInfoForm()->fill($customer); $this->customerAccountEdit->getAccountInfoForm()->submit(); + $this->cmsIndex->getCmsPageBlock()->waitPageInit(); \PHPUnit_Framework_Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage); @@ -134,5 +135,6 @@ public function test( $this->customerAccountIndex->getDashboardAddress()->editBillingAddress(); $this->customerAddressEdit->getEditForm()->fill($address); $this->customerAddressEdit->getEditForm()->saveAddress(); + $this->cmsIndex->getCmsPageBlock()->waitPageInit(); } } From d02e4195a3580a5e7c5ffbcf39703bd10480bce8 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Tue, 13 Oct 2015 15:49:20 +0300 Subject: [PATCH 05/83] MAGETWO-43929: Regression scope functional tests maintenance - Fixes for CheckoutWithGiftMessagesTest --- .../Test/Block/Cart/GiftOptions.php | 40 ++++++++++++++- .../Test/Block/Cart/Item/GiftOptions.php | 49 ++++++++++++++++--- .../AssertGiftMessageInFrontendOrderItems.php | 10 +--- .../TestCase/CheckoutWithGiftMessagesTest.xml | 4 +- .../Magento/GiftMessage/Test/etc/testcase.xml | 15 +++--- 5 files changed, 91 insertions(+), 27 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/GiftOptions.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/GiftOptions.php index 0cdd46da28ece..00a96731c134c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/GiftOptions.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/GiftOptions.php @@ -7,7 +7,12 @@ namespace Magento\GiftMessage\Test\Block\Cart; use Magento\GiftMessage\Test\Fixture\GiftMessage; +use Magento\Mtf\Block\BlockFactory; use Magento\Mtf\Block\Form; +use Magento\Mtf\Block\Mapper; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Client\Element\SimpleElement; +use Magento\Mtf\Fixture\FixtureFactory; /** * Class GiftOptions @@ -43,6 +48,33 @@ class GiftOptions extends Form */ protected $giftMessageSummary = ".gift-message-summary"; + /** + * Fixture factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + + /** + * @param SimpleElement $element + * @param BlockFactory $blockFactory + * @param Mapper $mapper + * @param BrowserInterface $browser + * @param FixtureFactory $fixtureFactory + * @param array $config [optional] + */ + public function __construct( + SimpleElement $element, + BlockFactory $blockFactory, + Mapper $mapper, + BrowserInterface $browser, + FixtureFactory $fixtureFactory, + array $config = [] + ) { + $this->fixtureFactory = $fixtureFactory; + parent::__construct($element, $blockFactory, $mapper, $browser, $config); + } + /** * Fill gift message form on order level * @@ -58,7 +90,13 @@ public function fillGiftMessageOrder(GiftMessage $giftMessage) 'Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm', ['element' => $this->_rootElement->find($this->giftMessageOrderForm)] ); - $giftMessageForm->fill($giftMessage); + $formData = [ + 'sender' => $giftMessage->getSender(), + 'recipient' => $giftMessage->getRecipient(), + 'message' => $giftMessage->getMessage() + ]; + $formData = $this->fixtureFactory->createByCode('giftMessage', ['data' => $formData]); + $giftMessageForm->fill($formData); $this->_rootElement->find($this->giftMessageOrderButton)->click(); $this->waitForElementVisible($this->giftMessageSummary); } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php index 5443274248669..e6683a07d4cec 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php @@ -6,9 +6,14 @@ namespace Magento\GiftMessage\Test\Block\Cart\Item; +use Magento\Mtf\Block\BlockFactory; use Magento\GiftMessage\Test\Fixture\GiftMessage; use Magento\Mtf\Block\Form; +use Magento\Mtf\Block\Mapper; +use Magento\Mtf\Client\BrowserInterface; +use Magento\Mtf\Client\Element\SimpleElement; use Magento\Mtf\Client\Locator; +use Magento\Mtf\Fixture\FixtureFactory; /** * Add gift options on checkout cart item level @@ -20,7 +25,7 @@ class GiftOptions extends Form * * @var string */ - protected $giftMessageItemForm = '//div[@class="gift-message"]//fieldset[ancestor::tbody[contains(.,"%s")]]'; + protected $giftMessageItemForm = '.gift-message fieldset'; /** * Allow Gift Options for items @@ -43,6 +48,33 @@ class GiftOptions extends Form */ protected $giftMessageSummary = '//div[@class="gift-message-summary"][ancestor::tbody[contains(.,"%s")]]'; + /** + * Fixture factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + + /** + * @param SimpleElement $element + * @param BlockFactory $blockFactory + * @param Mapper $mapper + * @param BrowserInterface $browser + * @param FixtureFactory $fixtureFactory + * @param array $config [optional] + */ + public function __construct( + SimpleElement $element, + BlockFactory $blockFactory, + Mapper $mapper, + BrowserInterface $browser, + FixtureFactory $fixtureFactory, + array $config = [] + ) { + $this->fixtureFactory = $fixtureFactory; + parent::__construct($element, $blockFactory, $mapper, $browser, $config); + } + /** * Fill gift message form on item level * @@ -62,14 +94,15 @@ public function fillGiftMessageItem(GiftMessage $giftMessage, $products = []) )->click(); $giftMessageForm = $this->blockFactory->create( 'Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm', - [ - 'element' => $this->_rootElement->find( - sprintf($this->giftMessageItemForm, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] + ['element' => $this->_rootElement->find($this->giftMessageItemForm)] ); - $giftMessageForm->fill($giftMessage); + $formData = [ + 'sender' => $giftMessage->getSender(), + 'recipient' => $giftMessage->getRecipient(), + 'message' => $giftMessage->getMessage() + ]; + $formData = $this->fixtureFactory->createByCode('giftMessage', ['data' => $formData]); + $giftMessageForm->fill($formData); $this->_rootElement->find($this->giftMessageItemButton)->click(); $this->waitForElementVisible( sprintf($this->giftMessageSummary, $product->getName()), diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index 9adbac82bef1a..c5fea6f7719b7 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -53,15 +53,7 @@ public function processAssert( $orderHistory->open(); $orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - foreach ($giftMessage->getItems() as $key => $itemGiftMessage) { - $product = $products[$key]; - if ($giftMessage->hasData('items')) { - $expectedData = [ - 'sender' => $itemGiftMessage->getSender(), - 'recipient' => $itemGiftMessage->getRecipient(), - 'message' => $itemGiftMessage->getMessage(), - ]; - } + foreach ($products as $product) { if ($product->getProductHasWeight() !== 'Yes') { $expectedData = []; } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml index 1aa0128c20a6b..1937fd24c0c3c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml @@ -10,7 +10,7 @@ catalogProductSimple::default, catalogProductVirtual::default default - US_address_1 + US_address_1_without_email login Flat Rate Fixed @@ -27,7 +27,7 @@ catalogProductSimple::default, catalogProductVirtual::default default - US_address_1 + US_address_1_without_email login Flat Rate Fixed diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml index 0dfdf20437f1c..fcd1c8bf41640 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml @@ -11,15 +11,16 @@ - - + - - - - - + + + + + + + From df8ce6c46a1553bdf6ea378ac2a861b32c6c7913 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Tue, 13 Oct 2015 16:02:11 +0300 Subject: [PATCH 06/83] MAGETWO-43929: Regression scope functional tests maintenance - Improved checkout payment method selection --- .../app/Magento/Checkout/Test/Block/Onepage/Payment.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php index cc62ddd13e1df..4eb6d81d6f57b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment.php @@ -81,10 +81,11 @@ class Payment extends Block */ public function selectPaymentMethod(array $payment, CreditCard $creditCard = null) { - $paymentSelector = $this->_rootElement->find(sprintf($this->paymentMethodInput, $payment['method'])); - if ($paymentSelector->isVisible()) { - $paymentSelector->click(); - } else { + $paymentSelector = sprintf($this->paymentMethodInput, $payment['method']); + try { + $this->waitForElementVisible($paymentSelector); + $this->_rootElement->find($paymentSelector)->click(); + } catch (\Exception $exception) { $paymentLabel = $this->_rootElement->find(sprintf($this->paymentMethodLabel, $payment['method'])); $this->waitForElementNotVisible($this->waitElement); if (!$paymentLabel->isVisible()) { From 64c72658f2819c24828484f3a63ceaa15e211b9d Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Tue, 13 Oct 2015 17:49:11 +0300 Subject: [PATCH 07/83] MAGETWO-43929: Regression scope functional tests maintenance --- .../tests/app/Magento/Backend/Test/Block/Widget/Grid.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php index 8e1e7be037137..ff465a7239146 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php @@ -252,6 +252,7 @@ public function searchAndOpen(array $filter) } else { throw new \Exception("Searched item was not found by filter\n" . print_r($filter, true)); } + $this->waitLoader(); } /** From 6510322da93d5e1673d69b3cb79281b227230cfd Mon Sep 17 00:00:00 2001 From: Dubovyk Oleksandr Date: Tue, 13 Oct 2015 19:59:21 +0300 Subject: [PATCH 08/83] MAGETWO-38963: Storefront "Layered Navigation" menu items' titles are overlapped by "Expand" button - Removed overlapping --- .../luma/Magento_LayeredNavigation/web/css/source/_module.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/luma/Magento_LayeredNavigation/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_LayeredNavigation/web/css/source/_module.less index 898ddc99afdfa..dfdb366f731b6 100644 --- a/app/design/frontend/Magento/luma/Magento_LayeredNavigation/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_LayeredNavigation/web/css/source/_module.less @@ -102,10 +102,11 @@ font-weight: @font-weight__semibold; margin: 0; overflow: hidden; - padding: @indent__s 20px+@indent__s 0 @indent__s; + padding: @indent__s 30px+@indent__s 0 @indent__s; position: relative; z-index: 1; text-transform: uppercase; + word-break: break-all; .lib-icon-font( @_icon-font-content: @icon-down, From 032004cf6fa432260085ff6b1572325ddde5ae03 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Thu, 15 Oct 2015 18:02:38 +0300 Subject: [PATCH 09/83] MAGETWO-43929: Regression scope functional tests maintenance --- .../AssertGiftMessageInBackendOrder.php | 19 +++++++++++++++---- .../AssertGiftMessageInFrontendOrderItems.php | 10 +++++++++- .../TestCase/CheckoutWithGiftMessagesTest.xml | 1 + .../TestStep/AddGiftMessageBackendStep.php | 13 ++++++++----- .../Magento/GiftMessage/Test/etc/testcase.xml | 3 +-- .../Test/Block/Adminhtml/Order/Create.php | 10 +++++++++- .../Adminhtml/Order/Create/Billing/Method.php | 2 -- .../Order/Create/Shipping/Method.php | 2 -- 8 files changed, 43 insertions(+), 17 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php index 7ebe75449ad20..32447e0181ad4 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php @@ -10,6 +10,7 @@ use Magento\Sales\Test\Page\Adminhtml\OrderIndex; use Magento\Sales\Test\Page\Adminhtml\SalesOrderView; use Magento\Mtf\Constraint\AbstractAssertForm; +use Magento\Mtf\Fixture\FixtureFactory; /** * Assert that message from dataset is displayed on order(s) view page on backend. @@ -34,6 +35,7 @@ class AssertGiftMessageInBackendOrder extends AbstractAssertForm * @param GiftMessage $giftMessage * @param SalesOrderView $salesOrderView * @param OrderIndex $orderIndex + * @param FixtureFactory $fixtureFactory * @param array $products * @param string $orderId * @return void @@ -42,6 +44,7 @@ public function processAssert( GiftMessage $giftMessage, SalesOrderView $salesOrderView, OrderIndex $orderIndex, + FixtureFactory $fixtureFactory, array $products, $orderId ) { @@ -49,12 +52,20 @@ public function processAssert( $actualData = []; $orderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - if ($giftMessage->getAllowGiftMessagesForOrder()) { - $expectedData[] = $giftMessage->getData(); - $actualData[] = $salesOrderView->getGiftOptionsBlock()->getData($giftMessage); + if ($giftMessage->getAllowGiftMessagesForOrder() === 'Yes') { + $formData = [ + 'sender' => $giftMessage->getSender(), + 'recipient' => $giftMessage->getRecipient(), + 'message' => $giftMessage->getMessage() + ]; + $giftMessageForm = $fixtureFactory->createByCode('giftMessage', ['data' => $formData]); + + $expectedData[] = $giftMessageForm->getData(); + $actualData[] = $salesOrderView->getGiftOptionsBlock()->getData($giftMessageForm); + } - if ($giftMessage->getAllowGiftOptionsForItems()) { + if ($giftMessage->getAllowGiftOptionsForItems() === 'Yes') { foreach ($giftMessage->getItems() as $key => $giftMessageItem) { $expectedData[] = $giftMessageItem->getData(); $product = $products[$key]; diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index c5fea6f7719b7..9adbac82bef1a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -53,7 +53,15 @@ public function processAssert( $orderHistory->open(); $orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - foreach ($products as $product) { + foreach ($giftMessage->getItems() as $key => $itemGiftMessage) { + $product = $products[$key]; + if ($giftMessage->hasData('items')) { + $expectedData = [ + 'sender' => $itemGiftMessage->getSender(), + 'recipient' => $itemGiftMessage->getRecipient(), + 'message' => $itemGiftMessage->getMessage(), + ]; + } if ($product->getProductHasWeight() !== 'Yes') { $expectedData = []; } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml index 1937fd24c0c3c..d91f2b5a10140 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml @@ -37,6 +37,7 @@ John Doe Jane Doe text_gift_message + default cashondelivery diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageBackendStep.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageBackendStep.php index 18848d9e75d2c..e089fb4bf7cb2 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageBackendStep.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageBackendStep.php @@ -60,12 +60,15 @@ public function __construct( */ public function run() { - if ($this->giftMessage->getAllowGiftMessagesForOrder()) { - $this->orderCreateIndex->getGiftMessageForOrderBlock()->fill($this->giftMessage); + if ($this->giftMessage->getAllowGiftMessagesForOrder() === 'Yes') { + $giftMessageForOrderBlock = $this->orderCreateIndex->getGiftMessageForOrderBlock(); + $giftMessageForOrderBlock->fill($this->giftMessage); + $giftMessageForOrderBlock->waitForElementNotVisible('.loading-mask'); } - if ($this->giftMessage->getAllowGiftOptionsForItems()) { - $this->orderCreateIndex->getCreateGiftMessageBlock() - ->fillGiftMessageForItems($this->products, $this->giftMessage); + if ($this->giftMessage->getAllowGiftOptionsForItems() === 'Yes') { + $giftMessageBlock = $this->orderCreateIndex->getCreateGiftMessageBlock(); + $giftMessageBlock->fillGiftMessageForItems($this->products, $this->giftMessage); + $giftMessageBlock->waitForElementNotVisible('.loading-mask'); } return ['giftMessage' => $this->giftMessage]; diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml index fcd1c8bf41640..b4bf95dc501ca 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml @@ -31,8 +31,7 @@ - - + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php index 6eb392b6d8ccf..5949d930822bb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php @@ -101,6 +101,13 @@ class Create extends Block */ protected $accountInformationBlock = '#order-form_account'; + /** + * Payment and Shipping methods block. + * + * @var string + */ + protected $orderMethodsSelector = '#order-methods'; + /** * Getter for order selected products grid. * @@ -278,6 +285,7 @@ public function fillAddresses(FixtureInterface $address, $saveAddress = 'No', $s */ public function selectShippingMethod(array $shippingMethod) { + $this->_rootElement->find($this->orderMethodsSelector)->click(); $this->getShippingMethodBlock()->selectShippingMethod($shippingMethod); $this->getTemplateBlock()->waitLoader(); } @@ -291,7 +299,7 @@ public function selectShippingMethod(array $shippingMethod) public function selectPaymentMethod(array $paymentCode) { $this->getTemplateBlock()->waitLoader(); - $this->_rootElement->click(); + $this->_rootElement->find($this->orderMethodsSelector)->click(); $this->getBillingMethodBlock()->selectPaymentMethod($paymentCode); $this->getTemplateBlock()->waitLoader(); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php index 6397d53754a38..24b42e5020a2b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Billing/Method.php @@ -35,8 +35,6 @@ class Method extends Block */ public function selectPaymentMethod(array $paymentCode) { - // Click on rootElement to solve overlapping inner elements by header menu. - $this->_rootElement->click(); $paymentInput = $this->_rootElement->find(sprintf($this->paymentMethod, $paymentCode['method'])); if ($paymentInput->isVisible()) { $paymentInput->click(); diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php index 4f9877eeca53a..25deecd31dea2 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Shipping/Method.php @@ -36,8 +36,6 @@ class Method extends Block */ public function selectShippingMethod(array $shippingMethod) { - // Click on rootElement to solve overlapping inner elements by header menu. - $this->_rootElement->click(); $this->_rootElement->find($this->shippingMethodsLink)->click(); $selector = sprintf( $this->shippingMethod, From 7dfd4afcbed337e04430e18dc55f778861401197 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Thu, 15 Oct 2015 18:24:27 +0300 Subject: [PATCH 10/83] MAGETWO-43929: Regression scope functional tests maintenance --- .../app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php index e6683a07d4cec..9281d05031ba2 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.php @@ -96,6 +96,7 @@ public function fillGiftMessageItem(GiftMessage $giftMessage, $products = []) 'Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm', ['element' => $this->_rootElement->find($this->giftMessageItemForm)] ); + $giftMessage = $giftMessage->getItems()[0]; $formData = [ 'sender' => $giftMessage->getSender(), 'recipient' => $giftMessage->getRecipient(), From 83423597d8335979932d79ac9b4848dd8d4270ff Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov Date: Thu, 15 Oct 2015 19:06:40 +0300 Subject: [PATCH 11/83] MAGETWO-43929: Regression scope functional tests maintenance --- .../GiftMessage/Test/TestStep/AddGiftMessageStep.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageStep.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageStep.php index 35c7994df9e54..6cb87dd9d4a78 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageStep.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestStep/AddGiftMessageStep.php @@ -51,14 +51,16 @@ public function __construct(CheckoutCart $checkoutCart, GiftMessage $giftMessage } /** - * Add gift message to order + * Add gift message to items and/or order. * - * @return void + * @return array */ public function run() { $this->checkoutCart->open(); $this->checkoutCart->getGiftMessagesItemBlock()->fillGiftMessageItem($this->giftMessage, $this->products); $this->checkoutCart->getGiftMessagesOrderBlock()->fillGiftMessageOrder($this->giftMessage, $this->products); + + return ['giftMessage' => $this->giftMessage]; } } From 25e4f7a480841b5277f8621704746cdb2c1aa4af Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Fri, 16 Oct 2015 10:21:40 +0300 Subject: [PATCH 12/83] MAGETWO-42984: Remove Section from Customer Data --- .../Test/TestCase/UpdateCustomerFrontendEntityTest.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php index 8a31cb657a0b7..63308bbea50d1 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php @@ -124,12 +124,9 @@ public function test( 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', ['customer' => $initialCustomer] )->run(); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); - sleep(3); // TODO: remove after resolving an issue with ajax on Frontend. $this->customerAccountIndex->getInfoBlock()->openEditContactInfo(); $this->customerAccountEdit->getAccountInfoForm()->fill($customer); $this->customerAccountEdit->getAccountInfoForm()->submit(); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); \PHPUnit_Framework_Assert::assertThat($this->getName(), $assertCustomerInfoSuccessSavedMessage); @@ -137,8 +134,5 @@ public function test( $this->customerAccountIndex->getDashboardAddress()->editBillingAddress(); $this->customerAddressEdit->getEditForm()->fill($address); $this->customerAddressEdit->getEditForm()->saveAddress(); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); - $this->cmsIndex->getCmsPageBlock()->waitPageInit(); - sleep(3); // TODO: remove after resolving an issue with ajax on Frontend. } } From d38bb2ac935fdbb60386092b2252bee0b06ed53a Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Tue, 20 Oct 2015 15:32:46 +0300 Subject: [PATCH 13/83] MAGETWO-44116: JS bundling file size exceeded --- lib/internal/Magento/Framework/View/Asset/Bundle.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/View/Asset/Bundle.php b/lib/internal/Magento/Framework/View/Asset/Bundle.php index 380d87d31155e..d19d667d61216 100644 --- a/lib/internal/Magento/Framework/View/Asset/Bundle.php +++ b/lib/internal/Magento/Framework/View/Asset/Bundle.php @@ -150,7 +150,7 @@ protected function getMaxPartSize(LocalInterface $asset) */ protected function getAssetSize(LocalInterface $asset) { - return mb_strlen(utf8_encode($asset->getContent()), 'utf-8') / 1024; + return mb_strlen(json_encode(utf8_encode($asset->getContent()), JSON_UNESCAPED_SLASHES), 'utf-8') / 1024; } /** From ddf543aba443c336be95db583b8e521d5067e575 Mon Sep 17 00:00:00 2001 From: Olga Lytvynenko Date: Tue, 20 Oct 2015 16:21:35 +0300 Subject: [PATCH 14/83] MAGETWO-44188: "Thumbnails" section is displayed too close to "Reviews" tab on "view Product" Storefront page --- .../Magento/blank/Magento_Catalog/web/css/source/_module.less | 4 ++++ .../Magento/luma/Magento_Catalog/web/css/source/_module.less | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less index d65fc3090a9fa..67d9400be23c9 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/_module.less @@ -558,9 +558,12 @@ .product-info-main { float: right; } + .product.media { float: left; + margin-bottom: @indent__m; } + .page-layout-1column { .product-info-main { width: 40%; @@ -569,6 +572,7 @@ width: 57%; } } + .page-layout-2columns-left, .page-layout-2columns-right, .page-layout-3columns { diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less index e322d35fe9c55..555101ccdbd5c 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/_module.less @@ -579,9 +579,12 @@ .product-info-main { float: right; } + .product.media { float: left; + margin-bottom: @indent__m; } + .page-layout-1column { .product-info-main { width: 40%; @@ -590,6 +593,7 @@ width: 57%; } } + .page-layout-2columns-left, .page-layout-2columns-right, .page-layout-3columns { From 84372e00efd267586bb716afb3f3142379632809 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 21 Oct 2015 10:58:15 +0300 Subject: [PATCH 15/83] MAGETWO-44321: Magento\Email\Model\TemplateTest integration test fails in PHP 7 --- .../Magento/Email/Model/TemplateTest.php | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index 48d237cd8d627..26e30abc245de 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -122,17 +122,19 @@ public function testGetProcessedTemplate() ->getArea(Area::AREA_FRONTEND) ->load(); - $this->setNotDefaultThemeForFixtureStore(); $expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico'; - $this->model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); - $this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplate()); $this->model->setDesignConfig([ 'area' => 'frontend', 'store' => $this->objectManager->get('Magento\Store\Model\StoreManagerInterface') ->getStore('fixturestore') ->getId(), ]); + $this->model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); + $this->setNotDefaultThemeForFixtureStore(); + $this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplate()); + + $this->setDefaultThemeForFixtureStore(); $this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplate()); } @@ -524,11 +526,33 @@ protected function setUpThemeFallback($area) } /** - * Set 'Magento/luma' for the 'fixturestore' store. + * Set 'Magento/blank' for the 'fixturestore' store. * Application isolation is required, if a test uses this method. */ protected function setNotDefaultThemeForFixtureStore() { + /** @var \Magento\Framework\View\Design\ThemeInterface $theme */ + $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Framework\View\Design\ThemeInterface' + ); + $theme->load('Magento/luma', 'theme_path'); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + 'Magento\Framework\App\Config\MutableScopeConfigInterface' + )->setValue( + \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID, + $theme->getId(), + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + 'fixturestore' + ); + } + + /** + * Set 'Magento/blank' for the 'fixturestore' store. + * Application isolation is required, if a test uses this method. + */ + protected function setDefaultThemeForFixtureStore() + { + /** @var \Magento\Framework\View\Design\ThemeInterface $theme */ $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Framework\View\Design\ThemeInterface' ); @@ -554,10 +578,8 @@ public function testGetProcessedTemplateSubject() ->getArea(Area::AREA_FRONTEND) ->load(); - $this->setNotDefaultThemeForFixtureStore(); $expectedViewUrl = 'static/frontend/Magento/blank/en_US/Magento_Theme/favicon.ico'; $this->model->setTemplateSubject('{{view url="Magento_Theme::favicon.ico"}}'); - $this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([])); $this->model->setDesignConfig([ 'area' => 'frontend', 'store' => $this->objectManager->get('Magento\Store\Model\StoreManagerInterface') @@ -565,6 +587,10 @@ public function testGetProcessedTemplateSubject() ->getId(), ]); + $this->setNotDefaultThemeForFixtureStore(); + $this->assertStringEndsNotWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([])); + + $this->setDefaultThemeForFixtureStore(); $this->assertStringEndsWith($expectedViewUrl, $this->model->getProcessedTemplateSubject([])); } From 932d984cedfa49816effd38dd3c5c01995d20ddd Mon Sep 17 00:00:00 2001 From: Olga Matviienko Date: Wed, 21 Oct 2015 12:16:07 +0300 Subject: [PATCH 16/83] MAGETWO-44303: "Gift options" block is not aligned on Multishipping Checkout --- .../web/css/source/_module.less | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Multishipping/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Multishipping/web/css/source/_module.less index fd2eb640f58f3..9e80d9980430e 100644 --- a/app/design/frontend/Magento/blank/Magento_Multishipping/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Multishipping/web/css/source/_module.less @@ -253,8 +253,8 @@ margin-bottom: @indent__m; } > .primary { - margin-right: 0; margin-bottom: @indent__m; + margin-right: 0; } } } @@ -295,9 +295,19 @@ width: 25%; } .box-shipping-method { - padding-right: @indent__m; padding-left: @indent__m; + padding-right: @indent__m; width: 50%; + .fieldset { + .legend { + &:extend(.abs-reset-left-margin-desktop-s all); + } + .field { + &:before { + display: none; + } + } + } } } From 0b633ca9f7218b1146feae2c3a0e3c821f7a0a96 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 21 Oct 2015 12:16:28 +0300 Subject: [PATCH 17/83] MAGETWO-44346: Error in browser console about Captcha on Multi Shipping Flow --- .../frontend/layout/multishipping_checkout.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml index 097574d310747..46ec2dcccadd7 100644 --- a/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml +++ b/app/code/Magento/Multishipping/view/frontend/layout/multishipping_checkout.xml @@ -7,6 +7,24 @@ --> + + + + + + + + Magento_Captcha/js/view/checkout/loginCaptcha + additional-login-form-fields + user_login + authenticationPopup + + + + + + + From 441e3f43a52a88efcf458f02c9ffb994baf7dc1b Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 21 Oct 2015 12:46:03 +0300 Subject: [PATCH 18/83] MAGETWO-44321: Magento\Email\Model\TemplateTest integration test fails in PHP 7 --- .../integration/testsuite/Magento/Email/Model/TemplateTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index 26e30abc245de..5680b57d0fc2c 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -526,7 +526,7 @@ protected function setUpThemeFallback($area) } /** - * Set 'Magento/blank' for the 'fixturestore' store. + * Set 'Magento/luma' for the 'fixturestore' store. * Application isolation is required, if a test uses this method. */ protected function setNotDefaultThemeForFixtureStore() From dde0f563f9dbe8625ce559e482bcdbae88b0f7ae Mon Sep 17 00:00:00 2001 From: Olga Matviienko Date: Wed, 21 Oct 2015 16:09:24 +0300 Subject: [PATCH 19/83] MAGETWO-44311: Items in Mini Shopping Cart have action buttons not aligned for Blank Theme --- .../web/css/source/module/_minicart.less | 22 ++--- .../web/css/source/module/_minicart.less | 83 +++++++++---------- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less index fb76486d5287a..a0396d053157f 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/_minicart.less @@ -49,8 +49,6 @@ } .subtitle { display: none; - } - .subtitle { &.empty { display: block; font-size: 14px; @@ -124,10 +122,14 @@ right: 26px; } } - .product.actions { - text-align: right; - > .primary, > .secondary { - display: inline; + .product { + .actions { + float: right; + margin: -24px 0 0; + text-align: right; + > .primary, > .secondary { + display: inline; + } } } @@ -165,7 +167,7 @@ text-align: center; white-space: normal; &.empty { - &:extend(.abs-no-display all); + display: none; } .loader { > img { @@ -184,8 +186,8 @@ } .minicart-items-wrapper { - .lib-css(margin, 0 -@minicart__padding-horizontal); .lib-css(border, 1px solid @minicart__border-color); + .lib-css(margin, 0 -@minicart__padding-horizontal); border-left: 0; border-right: 0; overflow-x: auto; @@ -301,12 +303,12 @@ text-align: center; width: 40px; } - .item-update { + .update-cart-item { .lib-font-size(11); vertical-align: top; } .subtitle { - &:extend(.abs-no-display all); + display: none; } .action { &.edit, diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index e4a039fac1df3..10a28b07bdd6b 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -12,7 +12,6 @@ @minicart-qty__height: 24px; - // // Common // _____________________________________________ @@ -52,9 +51,9 @@ display: none; &.empty { display: block; + font-size: 14px; padding: @indent__l 0 @indent__base; text-align: center; - font-size: 14px; } } .text { @@ -95,18 +94,18 @@ .minicart-wrapper { .lib-dropdown( - @_toggle-selector: ~".action.showcart", - @_options-selector: ~".block-minicart", - @_dropdown-toggle-icon-content: @icon-cart, - @_dropdown-toggle-active-icon-content: @icon-cart, - @_dropdown-list-item-padding: false, - @_dropdown-list-item-hover: false, - @_icon-font-position: before, - @_icon-font-size: 22px, - @_icon-font-line-height: 28px, - @_icon-font-color: @minicart-icons-color, - @_icon-font-color-hover: @minicart-icons-color-hover, - @_icon-font-color-active: @minicart-icons-color + @_toggle-selector: ~".action.showcart", + @_options-selector: ~".block-minicart", + @_dropdown-toggle-icon-content: @icon-cart, + @_dropdown-toggle-active-icon-content: @icon-cart, + @_dropdown-list-item-padding: false, + @_dropdown-list-item-hover: false, + @_icon-font-position: before, + @_icon-font-size: 22px, + @_icon-font-line-height: 28px, + @_icon-font-color: @minicart-icons-color, + @_icon-font-color-hover: @minicart-icons-color-hover, + @_icon-font-color-active: @minicart-icons-color ); float: right; .block-minicart { @@ -140,11 +139,11 @@ } .action { &.close { - width: 40px; height: 40px; - top: 0; - right: 0; position: absolute; + right: 0; + top: 0; + width: 40px; .lib-button-reset(); .lib-button-icon( @icon-remove, @@ -155,10 +154,10 @@ ); } &.showcart { + white-space: nowrap; .text { &:extend(.abs-visually-hidden all); } - white-space: nowrap; .counter.qty { .lib-css(background, @active__color); .lib-css(color, @page__background-color); @@ -203,10 +202,10 @@ .minicart-items { .lib-list-reset-styles(); .product-item { + padding: @indent__base 0; &:not(:first-child) { .lib-css(border-top, 1px solid @minicart__border-color); } - padding: @indent__base 0; &:first-child { padding-top: 0; } @@ -260,9 +259,9 @@ .toggle { &:extend(.abs-toggling-title all); &:after { - position: static; - margin: 0 0 0 @indent__xs; .lib-css(color, @color-gray56); + margin: 0 0 0 @indent__xs; + position: static; } border: 0; padding: 0 @indent__xl @indent__xs 0; @@ -281,12 +280,12 @@ &.options { .tooltip.toggle { .lib-icon-font( - @icon-down, - @_icon-font-size: 12px, - @_icon-font-line-height: 12px, - @_icon-font-text-hide: true, - @_icon-font-margin: -3px 0 0 7px, - @_icon-font-position: after + @icon-down, + @_icon-font-size: 12px, + @_icon-font-line-height: 12px, + @_icon-font-text-hide: true, + @_icon-font-margin: -3px 0 0 7px, + @_icon-font-position: after ); } .details { @@ -301,38 +300,37 @@ } } .item-qty { - width: 40px; - text-align: center; margin-right: @indent__s; + text-align: center; + width: 40px; } .update-cart-item { - vertical-align: top; .lib-font-size(11); + vertical-align: top; + } + .subtitle { + display: none; } .action { &.edit, &.delete { .lib-icon-font( - @icon-edit, - @_icon-font-size: 18px, - @_icon-font-line-height: 20px, - @_icon-font-text-hide: true, - @_icon-font-color: @minicart-icons-color, - @_icon-font-color-hover: @primary__color, - @_icon-font-color-active: @minicart-icons-color + @icon-edit, + @_icon-font-size: 18px, + @_icon-font-line-height: 20px, + @_icon-font-text-hide: true, + @_icon-font-color: @minicart-icons-color, + @_icon-font-color-hover: @primary__color, + @_icon-font-color-active: @minicart-icons-color ); } &.delete { .lib-icon-font-symbol( - @_icon-font-content: @icon-trash + @_icon-font-content: @icon-trash ); } } - .subtitle { - display: none; - } } - } // @@ -351,7 +349,6 @@ } } - // // Desktop // _____________________________________________ From cf3c476ac241b139e2d567fde31712be21125a32 Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 21 Oct 2015 16:25:32 +0300 Subject: [PATCH 20/83] MAGETWO-44306: Backend Page "Find Partners & Extensions" is untranslatable --- .../Marketplace/view/adminhtml/templates/index.phtml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml b/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml index 53c60cf1d7a00..df3056645645d 100644 --- a/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml +++ b/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml @@ -6,7 +6,7 @@ ?>
-

Platinum Partners

+

Representing Magento's highest level of partner engagement, Magento Platinum Partners have established themselves as @@ -17,7 +17,7 @@ functions, and tools, as well as back-end systems and operations, to extend and enhance the power of the Magento commerce platform.

-

Featured Platinum Partners

+

@@ -30,7 +30,7 @@
-

Magento Marketplace

+

Extensions and Themes are an essential component of the Magento Ecosystem. Please visit the Magento Marketplace @@ -64,7 +64,7 @@

- Visit Magento Marketplaces +
From 071e731248e17e661dcddc216976c990c4def9cc Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 21 Oct 2015 16:55:10 +0300 Subject: [PATCH 21/83] MAGETWO-43793: [github] broken references when viewing admin after initial install #1795 --- .../Framework/View/Layout/Data/Structure.php | 19 +++- .../View/Layout/ScheduledStructure/Helper.php | 22 +++- .../Test/Unit/Layout/Data/StructureTest.php | 94 ++++++++++++++++ .../Layout/ScheduledStructure/HelperTest.php | 105 ++++++++++++++++-- 4 files changed, 222 insertions(+), 18 deletions(-) create mode 100644 lib/internal/Magento/Framework/View/Test/Unit/Layout/Data/StructureTest.php diff --git a/lib/internal/Magento/Framework/View/Layout/Data/Structure.php b/lib/internal/Magento/Framework/View/Layout/Data/Structure.php index 79e514b42b23a..643b2cdf9429f 100644 --- a/lib/internal/Magento/Framework/View/Layout/Data/Structure.php +++ b/lib/internal/Magento/Framework/View/Layout/Data/Structure.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Layout\Data; use Magento\Framework\Data\Structure as DataStructure; +use Magento\Framework\App\State; /** * An associative data structure, that features "nested set" parent-child relations @@ -24,17 +25,25 @@ class Structure extends DataStructure */ protected $logger; + /** + * @var \Magento\Framework\App\State + */ + protected $state; + /** * Constructor * * @param \Psr\Log\LoggerInterface $logger + * @param \Magento\Framework\App\State $state * @param array $elements */ public function __construct( \Psr\Log\LoggerInterface $logger, + \Magento\Framework\App\State $state, array $elements = null ) { $this->logger = $logger; + $this->state = $state; parent::__construct($elements); } @@ -109,10 +118,12 @@ public function reorderChildElement($parentName, $childName, $offsetOrSibling, $ if ($childName !== $sibling) { $siblingParentName = $this->getParentId($sibling); if ($parentName !== $siblingParentName) { - $this->logger->critical( - "Broken reference: the '{$childName}' tries to reorder itself towards '{$sibling}', but " . - "their parents are different: '{$parentName}' and '{$siblingParentName}' respectively." - ); + if ($this->state->getMode() == State::MODE_DEVELOPER) { + $this->logger->critical( + "Broken reference: the '{$childName}' tries to reorder itself towards '{$sibling}', but " . + "their parents are different: '{$parentName}' and '{$siblingParentName}' respectively." + ); + } return; } $this->reorderToSibling($parentName, $childName, $sibling, $after ? 1 : -1); diff --git a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php index aaa2e5fe1ecdd..e433a42056f0c 100644 --- a/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php +++ b/lib/internal/Magento/Framework/View/Layout/ScheduledStructure/Helper.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Layout\ScheduledStructure; use Magento\Framework\View\Layout; +use Magento\Framework\App\State; class Helper { @@ -31,13 +32,21 @@ class Helper */ protected $logger; + /** + * @var \Magento\Framework\App\State + */ + protected $state; + /** * @param \Psr\Log\LoggerInterface $logger + * @param \Magento\Framework\App\State $state */ public function __construct( - \Psr\Log\LoggerInterface $logger + \Psr\Log\LoggerInterface $logger, + \Magento\Framework\App\State $state ) { $this->logger = $logger; + $this->state = $state; } /** @@ -190,10 +199,13 @@ public function scheduleElement( } } else { $scheduledStructure->setElementToBrokenParentList($key); - $this->logger->critical( - "Broken reference: the '{$name}' element cannot be added as child to '{$parentName}', " . - 'because the latter doesn\'t exist' - ); + + if ($this->state->getMode() == State::MODE_DEVELOPER) { + $this->logger->critical( + "Broken reference: the '{$name}' element cannot be added as child to '{$parentName}', " . + 'because the latter doesn\'t exist' + ); + } } } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/Data/StructureTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Data/StructureTest.php new file mode 100644 index 0000000000000..b6e836b24416b --- /dev/null +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/Data/StructureTest.php @@ -0,0 +1,94 @@ +loggerMock = $this->getMock('Psr\Log\LoggerInterface'); + $this->stateMock = $this->getMock('Magento\Framework\App\State', [], [], '', false); + + $this->objectManagerHelper = new ObjectManagerHelper($this); + $this->dataStructure = $this->objectManagerHelper->getObject( + 'Magento\Framework\View\Layout\Data\Structure', + [ + 'logger' => $this->loggerMock, + 'state' => $this->stateMock + ] + ); + } + + /** + * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $loggerExpects + * @param string $stateMode + * @return void + * @dataProvider reorderChildElementLogDataProvider + */ + public function testReorderChildElementLog($loggerExpects, $stateMode) + { + $parentName = 'parent'; + $childName = 'child'; + $offsetOrSibling = '-'; + + $this->stateMock->expects($this->once()) + ->method('getMode') + ->willReturn($stateMode); + + $this->loggerMock->expects($loggerExpects) + ->method('critical') + ->with("Broken reference: the '{$childName}' tries to reorder itself towards '', but " . + "their parents are different: '{$parentName}' and '' respectively."); + + $this->dataStructure->reorderChildElement($parentName, $childName, $offsetOrSibling); + } + + /** + * @return array + */ + public function reorderChildElementLogDataProvider() + { + return [ + [ + 'loggerExpects' => $this->once(), + 'stateMode' => State::MODE_DEVELOPER + ], + [ + 'loggerExpects' => $this->never(), + 'stateMode' => State::MODE_DEFAULT + ], + [ + 'loggerExpects' => $this->never(), + 'stateMode' => State::MODE_PRODUCTION + ] + ]; + } +} diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php index 4aeff78304d31..1157ea287774f 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Layout/ScheduledStructure/HelperTest.php @@ -7,6 +7,7 @@ namespace Magento\Framework\View\Test\Unit\Layout\ScheduledStructure; use Magento\Framework\View\Layout; +use Magento\Framework\App\State; /** * Class HelperTest @@ -22,7 +23,17 @@ class HelperTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Framework\View\Layout\Data\Structure|\PHPUnit_Framework_MockObject_MockObject */ - protected $dataStructure; + protected $dataStructureMock; + + /** + * @var \Psr\Log\LoggerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $loggerMock; + + /** + * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject + */ + protected $stateMock; /** * @var \Magento\Framework\View\Layout\ScheduledStructure\Helper @@ -37,13 +48,20 @@ public function setUp() $this->scheduledStructureMock = $this->getMockBuilder('Magento\Framework\View\Layout\ScheduledStructure') ->disableOriginalConstructor() ->getMock(); - - $this->dataStructure = $this->getMockBuilder('Magento\Framework\View\Layout\Data\Structure') + $this->dataStructureMock = $this->getMockBuilder('Magento\Framework\View\Layout\Data\Structure') ->disableOriginalConstructor() ->getMock(); + $this->loggerMock = $this->getMock('Psr\Log\LoggerInterface'); + $this->stateMock = $this->getMock('Magento\Framework\App\State', [], [], '', false); $helperObjectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - $this->helper = $helperObjectManager->getObject('Magento\Framework\View\Layout\ScheduledStructure\Helper'); + $this->helper = $helperObjectManager->getObject( + 'Magento\Framework\View\Layout\ScheduledStructure\Helper', + [ + 'logger' => $this->loggerMock, + 'state' => $this->stateMock + ] + ); } /** @@ -122,7 +140,76 @@ public function testScheduleNonExistentElement() $this->scheduledStructureMock->expects($this->once())->method('unsetPathElement')->with($key); $this->scheduledStructureMock->expects($this->once())->method('unsetStructureElement')->with($key); - $this->helper->scheduleElement($this->scheduledStructureMock, $this->dataStructure, $key); + $this->helper->scheduleElement($this->scheduledStructureMock, $this->dataStructureMock, $key); + } + + /** + * @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $loggerExpects + * @param string $stateMode + * @return void + * @dataProvider scheduleElementLogDataProvider + */ + public function testScheduleElementLog($loggerExpects, $stateMode) + { + $key = 'key'; + $parentName = 'parent'; + $alias = 'alias'; + $block = 'block'; + $siblingName = null; + $isAfter = false; + + $this->scheduledStructureMock->expects($this->once()) + ->method('getStructureElement') + ->willReturn( + [ + Layout\ScheduledStructure\Helper::SCHEDULED_STRUCTURE_INDEX_TYPE => $block, + Layout\ScheduledStructure\Helper::SCHEDULED_STRUCTURE_INDEX_ALIAS => $alias, + Layout\ScheduledStructure\Helper::SCHEDULED_STRUCTURE_INDEX_PARENT_NAME => $parentName, + Layout\ScheduledStructure\Helper::SCHEDULED_STRUCTURE_INDEX_SIBLING_NAME => $siblingName, + Layout\ScheduledStructure\Helper::SCHEDULED_STRUCTURE_INDEX_IS_AFTER => $isAfter + ] + ); + $this->scheduledStructureMock->expects($this->once()) + ->method('hasStructureElement') + ->with($parentName) + ->willReturn(false); + + $this->dataStructureMock->expects($this->once()) + ->method('hasElement') + ->with($parentName) + ->willReturn(false); + + $this->stateMock->expects($this->once()) + ->method('getMode') + ->willReturn($stateMode); + + $this->loggerMock->expects($loggerExpects) + ->method('critical') + ->with("Broken reference: the '{$key}' element cannot be added as child to '{$parentName}', " . + 'because the latter doesn\'t exist'); + + $this->helper->scheduleElement($this->scheduledStructureMock, $this->dataStructureMock, $key); + } + + /** + * @return array + */ + public function scheduleElementLogDataProvider() + { + return [ + [ + 'loggerExpects' => $this->once(), + 'stateMode' => State::MODE_DEVELOPER + ], + [ + 'loggerExpects' => $this->never(), + 'stateMode' => State::MODE_DEFAULT + ], + [ + 'loggerExpects' => $this->never(), + 'stateMode' => State::MODE_PRODUCTION + ] + ]; } /** @@ -171,9 +258,9 @@ public function testScheduleElement($hasParent, $setAsChild, $toRemoveList, $sib $this->scheduledStructureMock->expects($this->any())->method('hasStructureElement')->willReturn(true); $this->scheduledStructureMock->expects($this->once())->method('setElement')->with($key, [$block, $data]); - $this->dataStructure->expects($this->once())->method('createElement')->with($key, ['type' => $block]); - $this->dataStructure->expects($this->once())->method('hasElement')->with($parentName)->willReturn($hasParent); - $this->dataStructure->expects($this->exactly($setAsChild)) + $this->dataStructureMock->expects($this->once())->method('createElement')->with($key, ['type' => $block]); + $this->dataStructureMock->expects($this->once())->method('hasElement')->with($parentName)->willReturn($hasParent); + $this->dataStructureMock->expects($this->exactly($setAsChild)) ->method('setAsChild') ->with($key, $parentName, $alias) ->willReturn(true); @@ -185,7 +272,7 @@ public function testScheduleElement($hasParent, $setAsChild, $toRemoveList, $sib ->method('setElementToSortList') ->with($parentName, $key, $siblingName, $isAfter); - $this->helper->scheduleElement($this->scheduledStructureMock, $this->dataStructure, $key); + $this->helper->scheduleElement($this->scheduledStructureMock, $this->dataStructureMock, $key); } /** From 53b49147bd1342951add2e68c4fc28e6f8b0dffa Mon Sep 17 00:00:00 2001 From: Oleh Posyniak Date: Wed, 21 Oct 2015 17:07:49 +0300 Subject: [PATCH 22/83] MAGETWO-44306: Backend Page "Find Partners & Extensions" is untranslatable --- app/code/Magento/Marketplace/i18n/en_US.csv | 8 +++++++ .../view/adminhtml/templates/index.phtml | 22 +++---------------- 2 files changed, 11 insertions(+), 19 deletions(-) create mode 100644 app/code/Magento/Marketplace/i18n/en_US.csv diff --git a/app/code/Magento/Marketplace/i18n/en_US.csv b/app/code/Magento/Marketplace/i18n/en_US.csv new file mode 100644 index 0000000000000..3d18ce49acd77 --- /dev/null +++ b/app/code/Magento/Marketplace/i18n/en_US.csv @@ -0,0 +1,8 @@ +"Platinum Partners","Platinum Partners" +"Representing Magento's highest level of partner engagement, Magento Platinum Partners have established themselves as leaders and innovators of key products and services designed to help merchants and brands grow their business. Magento reserves the Platinum level for select trusted partners that are committed to offering integrations of commerce features, functions, and tools, as well as back-end systems and operations, to extend and enhance the power of the Magento commerce platform.","Representing Magento's highest level of partner engagement, Magento Platinum Partners have established themselves as leaders and innovators of key products and services designed to help merchants and brands grow their business. Magento reserves the Platinum level for select trusted partners that are committed to offering integrations of commerce features, functions, and tools, as well as back-end systems and operations, to extend and enhance the power of the Magento commerce platform." +"Featured Platinum Partners","Featured Platinum Partners" +"Partner search","Partner search" +"Magento has a thriving ecosystem of technology partners to help merchants and brands deliver the best possiblecustomer experiences. They are recognized as experts in eCommerce, search, email marketing, payments, tax, fraud, optimization and analytics, fulfillment, and more. Visit the Magento Partner Directory to see all of our trusted partners.","Magento has a thriving ecosystem of technology partners to help merchants and brands deliver the best possiblecustomer experiences. They are recognized as experts in eCommerce, search, email marketing, payments, tax, fraud, optimization and analytics, fulfillment, and more. Visit the Magento Partner Directory to see all of our trusted partners." +"Magento Marketplace","Magento Marketplace" +"Extensions and Themes are an essential component of the Magento Ecosystem. Please visit the Magento Marketplace to see the latest innovations that developers have created to enhance your Magento Store.","Extensions and Themes are an essential component of the Magento Ecosystem. Please visit the Magento Marketplace to see the latest innovations that developers have created to enhance your Magento Store." +"Visit Magento Marketplaces","Visit Magento Marketplaces" diff --git a/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml b/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml index df3056645645d..4b3a62e49d133 100644 --- a/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml +++ b/app/code/Magento/Marketplace/view/adminhtml/templates/index.phtml @@ -8,14 +8,7 @@

- Representing Magento's highest level of partner engagement, - Magento Platinum Partners have established themselves as - leaders and innovators of key products and services designed - to help merchants and brands grow their business. Magento - reserves the Platinum level for select trusted partners that - are committed to offering integrations of commerce features, - functions, and tools, as well as back-end systems and operations, - to extend and enhance the power of the Magento commerce platform. +

@@ -32,13 +25,7 @@