diff --git a/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml b/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml index 44dc85b5404a1b51b2b3e508cbaa6b575788215e..e866c76a8b5a452899dd74551f151eb6ce54cfe8 100644 --- a/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml +++ b/app/code/Magento/Braintree/view/frontend/templates/creditcard/edit.phtml @@ -328,7 +328,7 @@ $serializedFormData = $this->helper('Magento\Framework\Json\Helper\Data')->jsonE </label> <div class="control"> - <?php echo $block->escapeHtml($block->countrySelect('credit_card[billing_address][country_code_alpha2]', 'billing_address_country', $default)); ?> + <?php /* @noEscape */ echo $block->countrySelect('credit_card[billing_address][country_code_alpha2]', 'billing_address_country', $default); ?> </div> </div> </fieldset> diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index 5e4efdb8e56cbcb45dbaa32a20e54367021c05fe..befca9212fccc264c9a5af55996f474b4d60cf41 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -162,7 +162,7 @@ class Options extends \Magento\Framework\View\Element\Template $data = [ 'prices' => [ 'oldPrice' => [ - 'amount' => $this->pricingHelper->currency($option->getPrice(false), false, false), + 'amount' => $optionPrice, 'adjustments' => [], ], 'basePrice' => [ diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml deleted file mode 100644 index 4d0318516508c3d23b6eea467edf8f855f3352c3..0000000000000000000000000000000000000000 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/1column.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All One-Column Layout Pages" design_abstraction="page_layout"> - <body> - <move element="catalog.leftnav" destination="content.top" after="-"/> - </body> -</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml deleted file mode 100644 index 7b679489fe942bc693b9948de94883e4bcab25cd..0000000000000000000000000000000000000000 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-left.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Left Column)" design_abstraction="page_layout"> - <body> - <move element="catalog.leftnav" destination="sidebar.main" before="-"/> - </body> -</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml deleted file mode 100644 index 5e8b8e338716d710d43d7859a77557443cb0662e..0000000000000000000000000000000000000000 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/2columns-right.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Two-Column Layout Pages (Right Column)" design_abstraction="page_layout"> - <body> - <move element="catalog.leftnav" destination="sidebar.main" before="-"/> - </body> -</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml deleted file mode 100644 index 5b97b56d83d48958b92d9db9860d2c9f6b574a3e..0000000000000000000000000000000000000000 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/3columns.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Three-Column Layout Pages" design_abstraction="page_layout"> - <body> - <move element="catalog.leftnav" destination="sidebar.main" before="-"/> - </body> -</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml b/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml deleted file mode 100644 index aaf387bdfdea016140bcf8e179ddd1174013d721..0000000000000000000000000000000000000000 --- a/app/code/Magento/LayeredNavigation/view/frontend/layout/page_empty.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="All Empty Layout Pages" design_abstraction="page_layout"> - <body> - <move element="catalog.leftnav" destination="category.product.list.additional" before="-"/> - </body> -</page> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/page_layout/1column.xml b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/1column.xml new file mode 100644 index 0000000000000000000000000000000000000000..d35beff77e8b896b26611c0cf123e88e1bcf4919 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/1column.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> + <move element="catalog.leftnav" destination="content.top" after="-"/> +</layout> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/page_layout/2columns-left.xml b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/2columns-left.xml new file mode 100644 index 0000000000000000000000000000000000000000..94286e3cd4d3ea68ea42680dffa5cf51eff52af2 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/2columns-left.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> + <move element="catalog.leftnav" destination="sidebar.main" before="-"/> +</layout> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/page_layout/2columns-right.xml b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/2columns-right.xml new file mode 100644 index 0000000000000000000000000000000000000000..94286e3cd4d3ea68ea42680dffa5cf51eff52af2 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/2columns-right.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> + <move element="catalog.leftnav" destination="sidebar.main" before="-"/> +</layout> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/page_layout/3columns.xml b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/3columns.xml new file mode 100644 index 0000000000000000000000000000000000000000..94286e3cd4d3ea68ea42680dffa5cf51eff52af2 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/3columns.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> + <move element="catalog.leftnav" destination="sidebar.main" before="-"/> +</layout> diff --git a/app/code/Magento/LayeredNavigation/view/frontend/page_layout/empty.xml b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/empty.xml new file mode 100644 index 0000000000000000000000000000000000000000..6a45bb383141099dd4d367120ecfe131c77fa4c7 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/view/frontend/page_layout/empty.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd"> + <move element="catalog.leftnav" destination="category.product.list.additional" before="-"/> +</layout> diff --git a/app/code/Magento/Paypal/Observer/AddBillingAgreementToSessionObserver.php b/app/code/Magento/Paypal/Observer/AddBillingAgreementToSessionObserver.php index 8bd494207b6b70faa97e1f92b775d13ade60c15f..2cc2425387b134c7c67ce9a3098a8be9ad5056c7 100644 --- a/app/code/Magento/Paypal/Observer/AddBillingAgreementToSessionObserver.php +++ b/app/code/Magento/Paypal/Observer/AddBillingAgreementToSessionObserver.php @@ -53,6 +53,7 @@ class AddBillingAgreementToSessionObserver implements ObserverInterface if ($agreement->isValid()) { $message = __('Created billing agreement #%1.', $agreement->getReferenceId()); $order->addRelatedObject($agreement); + $agreement->addOrderRelation($order); $this->checkoutSession->setLastBillingAgreementReferenceId($agreement->getReferenceId()); $agreementCreated = true; } else { diff --git a/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php b/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php index 7feea45b45d589f6485793750e1fe933a6999152..df0fc80c177e45d516f09cee03777bb887b8b3d5 100644 --- a/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Observer/AddBillingAgreementToSessionObserverTest.php @@ -122,6 +122,7 @@ class AddBillingAgreementToSessionObserverTest extends \PHPUnit_Framework_TestCa )->will( $this->returnValue('agreement reference id') ); + $agreement->expects($this->once())->method('addOrderRelation')->with($order); $order->expects(new MethodInvokedAtIndex(0))->method('addRelatedObject')->with($agreement); $this->_checkoutSession->expects( $this->once() diff --git a/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml b/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml index c026c3fca5e1f8fe7fbcb4a266d1267fe89d9f0b..835f442c0daadfb6a9127ddba69865d20a9ff235 100644 --- a/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml +++ b/app/code/Magento/Paypal/view/frontend/templates/billing/agreement/view.phtml @@ -105,7 +105,7 @@ $relatedOrders = $block->getRelatedOrders(); )); ?> </td> <td data-th="<?php echo $block->escapeHtml(__('Order Total')); ?>" class="col total"> - <?php echo $block->escapeHtml($block->getOrderItemValue($order, 'order_total')); ?> + <?php /* @noEscape */ echo $block->getOrderItemValue($order, 'order_total'); ?> </td> <td data-th="<?php echo $block->escapeHtml(__('Order Status')); ?>" class="col status"> <?php echo $block->escapeHtml($block->getOrderItemValue( diff --git a/app/code/Magento/Review/Block/Product/Review.php b/app/code/Magento/Review/Block/Product/Review.php index b553291cfbf8728ae3865831d2fbf5ee10edb176..02764dc5123f1f59535e6865bb9024a361f9d635 100644 --- a/app/code/Magento/Review/Block/Product/Review.php +++ b/app/code/Magento/Review/Block/Product/Review.php @@ -5,13 +5,15 @@ */ namespace Magento\Review\Block\Product; +use Magento\Framework\DataObject\IdentityInterface; +use Magento\Framework\View\Element\Template; /** * Product Review Tab * * @author Magento Core Team <core@magentocommerce.com> */ -class Review extends \Magento\Framework\View\Element\Template +class Review extends Template implements IdentityInterface { /** * Core registry @@ -98,4 +100,14 @@ class Review extends \Magento\Framework\View\Element\Template return $collection->getSize(); } + + /** + * Return unique ID(s) for each object in system + * + * @return array + */ + public function getIdentities() + { + return [\Magento\Review\Model\Review::CACHE_TAG]; + } } diff --git a/app/code/Magento/Review/Model/Rating.php b/app/code/Magento/Review/Model/Rating.php index f9af9a9223ee7bcb99cf2b8b5a50eae449ee8add..f251cf838cc1381e4786a54d40bcbda4db5fe683 100644 --- a/app/code/Magento/Review/Model/Rating.php +++ b/app/code/Magento/Review/Model/Rating.php @@ -5,6 +5,8 @@ */ namespace Magento\Review\Model; +use Magento\Framework\DataObject\IdentityInterface; + /** * Rating model * @@ -18,7 +20,7 @@ namespace Magento\Review\Model; * * @author Magento Core Team <core@magentocommerce.com> */ -class Rating extends \Magento\Framework\Model\AbstractModel +class Rating extends \Magento\Framework\Model\AbstractModel implements IdentityInterface { /** * rating entity codes @@ -161,4 +163,15 @@ class Rating extends \Magento\Framework\Model\AbstractModel { return $this->getResource()->getEntityIdByCode($entityCode); } + + /** + * Return unique ID(s) for each object in system + * + * @return array + */ + public function getIdentities() + { + // clear cache for all reviews + return [Review::CACHE_TAG]; + } } diff --git a/app/code/Magento/Review/Model/Review.php b/app/code/Magento/Review/Model/Review.php index a44da6d2f825851d1e65636140c2a8047a491af2..792babfba4e3203a536054c4555cbc48471edd64 100644 --- a/app/code/Magento/Review/Model/Review.php +++ b/app/code/Magento/Review/Model/Review.php @@ -31,6 +31,11 @@ class Review extends \Magento\Framework\Model\AbstractModel implements IdentityI */ protected $_eventPrefix = 'review'; + /** + * Cache tag + */ + const CACHE_TAG = 'review_block'; + /** * Product entity review code */ diff --git a/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0bc6dd49473e2f59ec96f7313e98a4bdc1f32963 --- /dev/null +++ b/app/code/Magento/Review/Test/Unit/Block/Product/ReviewTest.php @@ -0,0 +1,163 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Review\Test\Unit\Block\Product; + +use Magento\Framework\Registry; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Element\Template\Context; +use Magento\Catalog\Model\Product; +use Magento\Review\Block\Product\Review as ReviewBlock; +use Magento\Review\Model\ResourceModel\Review\Collection; +use Magento\Review\Model\ResourceModel\Review\CollectionFactory; +use Magento\Review\Model\Review; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManager; + +/** + * Class ReviewTest + * @package Magento\Review\Test\Unit\Block\Product + */ +class ReviewTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Review\Block\Product\Review + */ + private $block; + + /** + * @var \Magento\Review\Model\ResourceModel\Review\Collection|\PHPUnit_Framework_MockObject_MockObject + */ + private $collection; + + /** + * @var \Magento\Review\Model\ResourceModel\Review\CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $collectionFactory; + + /** + * @var \Magento\Framework\Registry|\PHPUnit_Framework_MockObject_MockObject + */ + private $registry; + + /** + * @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject + */ + private $product; + + /** + * @var \Magento\Store\Model\StoreManager|\PHPUnit_Framework_MockObject_MockObject + */ + private $storeManager; + + /** + * @var \Magento\Store\Model\Store|\PHPUnit_Framework_MockObject_MockObject + */ + private $store; + + protected function setUp() + { + $this->initContextMock(); + $this->initRegistryMock(); + $this->initCollectionMocks(); + + $helper = new ObjectManager($this); + $this->block = $helper->getObject(ReviewBlock::class, [ + 'storeManager' => $this->storeManager, + 'registry' => $this->registry, + 'collectionFactory' => $this->collectionFactory, + ]); + } + + /** + * @covers \Magento\Review\Block\Product\Review::getIdentities() + */ + public function testGetIdentities() + { + static::assertEquals([Review::CACHE_TAG], $this->block->getIdentities()); + } + + /** + * Create mocks for collection and its factory + */ + private function initCollectionMocks() + { + $this->collection = $this->getMockBuilder(Collection::class) + ->disableOriginalConstructor() + ->setMethods(['addStoreFilter', 'addStatusFilter', 'addEntityFilter', 'getSize', '__wakeup']) + ->getMock(); + + $this->collection->expects(static::any()) + ->method('addStoreFilter') + ->willReturnSelf(); + + $this->collection->expects(static::any()) + ->method('addStatusFilter') + ->with(Review::STATUS_APPROVED) + ->willReturnSelf(); + + $this->collection->expects(static::any()) + ->method('addEntityFilter') + ->willReturnSelf(); + + $this->collectionFactory = $this->getMockBuilder(CollectionFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create', '__wakeup']) + ->getMock(); + + $this->collectionFactory->expects(static::once()) + ->method('create') + ->willReturn($this->collection); + } + + /** + * Create mock for registry object + */ + private function initRegistryMock() + { + $this->initProductMock(); + $this->registry = $this->getMockBuilder(Registry::class) + ->disableOriginalConstructor() + ->setMethods(['registry']) + ->getMock(); + + $this->registry->expects(static::once()) + ->method('registry') + ->with('product') + ->willReturn($this->product); + } + + /** + * Create mock object for catalog product + */ + private function initProductMock() + { + $this->product = $this->getMockBuilder(Product::class) + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMock(); + } + + /** + * Create mock object for context + */ + private function initContextMock() + { + $this->store = $this->getMockBuilder(Store::class) + ->disableOriginalConstructor() + ->setMethods(['getId', '__wakeup']) + ->getMock(); + + $this->storeManager = $this->getMockBuilder(StoreManager::class) + ->disableOriginalConstructor() + ->setMethods(['getStore', '__wakeup']) + ->getMock(); + + $this->storeManager->expects(static::any()) + ->method('getStore') + ->willReturn($this->store); + } +} diff --git a/app/code/Magento/Review/Test/Unit/Model/RatingTest.php b/app/code/Magento/Review/Test/Unit/Model/RatingTest.php new file mode 100644 index 0000000000000000000000000000000000000000..82db181bedfb56dccf9af12ad10e0ce979e2b7c2 --- /dev/null +++ b/app/code/Magento/Review/Test/Unit/Model/RatingTest.php @@ -0,0 +1,36 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Review\Test\Unit\Model; + +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Review\Model\Review; +use Magento\Review\Model\Rating; + +class RatingTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Review\Model\Rating + */ + private $rating; + + /** + * Init objects needed by tests + */ + protected function setUp() + { + $helper = new ObjectManager($this); + $this->rating = $helper->getObject(Rating::class); + } + + /** + * @covers \Magento\Review\Model\Rating::getIdentities() + * @return void + */ + public function testGetIdentities() + { + static::assertEquals([Review::CACHE_TAG], $this->rating->getIdentities()); + } +} diff --git a/app/code/Magento/Tax/CustomerData/CheckoutTotalsJsLayoutDataProvider.php b/app/code/Magento/Tax/CustomerData/CheckoutTotalsJsLayoutDataProvider.php index 61a94b5a84887f13d8d32767fa0b57a8e82abd3d..35af16ecba53dc6f82b323786fe2f7ecf3a3e14a 100644 --- a/app/code/Magento/Tax/CustomerData/CheckoutTotalsJsLayoutDataProvider.php +++ b/app/code/Magento/Tax/CustomerData/CheckoutTotalsJsLayoutDataProvider.php @@ -61,7 +61,7 @@ class CheckoutTotalsJsLayoutDataProvider implements JsLayoutDataProviderInterfac protected function getTotalsConfig() { return [ - 'display_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax(), + 'display_cart_subtotal_incl_tax' => (int)$this->taxConfig->displayCartSubtotalInclTax(), 'display_cart_subtotal_excl_tax' => (int)$this->taxConfig->displayCartSubtotalExclTax(), ]; } diff --git a/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php b/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php index 05bd7fd103dbf27124974334778fe7cc9b429b8b..488cba181ade7669f1267b9c3566ac4348e7570e 100644 --- a/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php @@ -28,7 +28,7 @@ abstract class AbstractAggregateCalculator extends AbstractCalculator $priceInclTax = $this->calculationTool->round($item->getUnitPrice()); $rowTotalInclTax = $priceInclTax * $quantity; if (!$this->isSameRateAsStore($rate, $storeRate)) { - $priceInclTax = $this->calculatePriceInclTax($priceInclTax, $storeRate, $rate); + $priceInclTax = $this->calculatePriceInclTax($priceInclTax, $storeRate, $rate, $round); $rowTotalInclTax = $priceInclTax * $quantity; } $rowTaxExact = $this->calculationTool->calcTaxAmount($rowTotalInclTax, $rate, true, false); diff --git a/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php b/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php index d8ab3e259b27960515c7e1f19196132023215349..8f37546c839b79f2c38bf118c636b2ca5a4d32e9 100644 --- a/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php @@ -433,14 +433,18 @@ abstract class AbstractCalculator * @param float $storePriceInclTax * @param float $storeRate * @param float $customerRate + * @param boolean $round * @return float */ - protected function calculatePriceInclTax($storePriceInclTax, $storeRate, $customerRate) + protected function calculatePriceInclTax($storePriceInclTax, $storeRate, $customerRate, $round = true) { $storeTax = $this->calculationTool->calcTaxAmount($storePriceInclTax, $storeRate, true, false); $priceExclTax = $storePriceInclTax - $storeTax; $customerTax = $this->calculationTool->calcTaxAmount($priceExclTax, $customerRate, false, false); - $customerPriceInclTax = $this->calculationTool->round($priceExclTax + $customerTax); + $customerPriceInclTax = $priceExclTax + $customerTax; + if ($round) { + $customerPriceInclTax = $this->calculationTool->round($customerPriceInclTax); + } return $customerPriceInclTax; } } diff --git a/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php b/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php index 37c22cf5e147c4d4c7a01420650dd39a71d3e7da..fa8fa61379295bf6304781cad377f1123471b39e 100644 --- a/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/UnitBaseCalculator.php @@ -45,7 +45,7 @@ class UnitBaseCalculator extends AbstractCalculator $applyTaxAfterDiscount = $this->config->applyTaxAfterDiscount($this->storeId); $priceInclTax = $this->calculationTool->round($item->getUnitPrice()); if (!$this->isSameRateAsStore($rate, $storeRate)) { - $priceInclTax = $this->calculatePriceInclTax($priceInclTax, $storeRate, $rate); + $priceInclTax = $this->calculatePriceInclTax($priceInclTax, $storeRate, $rate, $round); } $uniTax = $this->calculationTool->calcTaxAmount($priceInclTax, $rate, true, false); $deltaRoundingType = self::KEY_REGULAR_DELTA_ROUNDING; diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php index c1cd2b9927c2fb1ba0db506fba2bf61a96344c05..34562754e0893aa11164945fc8e837db67c19d1b 100644 --- a/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php +++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php @@ -88,6 +88,7 @@ class Tax extends CommonTaxCollector * @param ShippingAssignmentInterface $shippingAssignment * @param Address\Total $total * @return $this + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function collect( \Magento\Quote\Model\Quote $quote, @@ -291,6 +292,7 @@ class Tax extends CommonTaxCollector * @param Address\Total $total * @return array|null * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total) { @@ -298,6 +300,10 @@ class Tax extends CommonTaxCollector $store = $quote->getStore(); $applied = $total->getAppliedTaxes(); $amount = $total->getTaxAmount(); + if ($amount == null) { + $this->enhanceTotalData($quote, $total); + $amount = $total->getTaxAmount(); + } $taxAmount = $amount + $total->getTotalAmount('discount_tax_compensation'); $area = null; @@ -340,6 +346,44 @@ class Tax extends CommonTaxCollector return $totals; } + /** + * Adds minimal tax information to the "total" data structure + * + * @param \Magento\Quote\Model\Quote $quote + * @param Address\Total $total + * @return null + */ + protected function enhanceTotalData( + \Magento\Quote\Model\Quote $quote, + \Magento\Quote\Model\Quote\Address\Total $total + ) { + $taxAmount = 0; + $shippingTaxAmount = 0; + $discountTaxCompensation = 0; + + $subtotalInclTax = $total->getSubtotalInclTax(); + $computeSubtotalInclTax = true; + if ($total->getSubtotalInclTax() > 0) { + $computeSubtotalInclTax = false; + } + + /** @var \Magento\Quote\Model\Quote\Address $address */ + foreach ($quote->getAllAddresses() as $address) { + $taxAmount += $address->getTaxAmount(); + $shippingTaxAmount += $address->getShippingTaxAmount(); + $discountTaxCompensation += $address->getDiscountTaxCompensationAmount(); + if ($computeSubtotalInclTax) { + $subtotalInclTax += $address->getSubtotalInclTax(); + } + } + + $total->setTaxAmount($taxAmount); + $total->setShippingTaxAmount($shippingTaxAmount); + $total->setDiscountTaxCompensationAmount($discountTaxCompensation); // accessed via 'discount_tax_compensation' + $total->setSubtotalInclTax($subtotalInclTax); + return; + } + /** * Process model configuration array. * This method can be used for changing totals collect sort order diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php index c4c271aef036101adb3366f5ab3588f7f65b2ed6..da0d9154d19bc7dd4be291a96537fdcde10e983f 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseAndTotalBaseCalculatorTestCase.php @@ -20,6 +20,9 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase const RATE = 10; const STORE_RATE = 11; + const UNIT_PRICE_INCL_TAX = 495.49549549545; + const UNIT_PRICE_INCL_TAX_ROUNDED = 495.5; + const CODE = 'CODE'; const TYPE = 'TYPE'; @@ -71,7 +74,7 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase { $this->initMockItem($isTaxIncluded); $this->initMockConfig(); - $this->initMockCalculationTool(); + $this->initMockCalculationTool($isTaxIncluded); $this->initMockAppliedTaxDataObjectFactory(); } @@ -93,7 +96,7 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase $this->mockCalculationTool = $this->getMockBuilder('\Magento\Tax\Model\Calculation') ->disableOriginalConstructor() ->setMethods( - ['__wakeup', 'round', 'getRate', 'getStoreRate', 'getRateRequest', 'getAppliedRates', 'calcTaxAmount'] + ['__wakeup', 'round', 'getRate', 'getStoreRate', 'getRateRequest', 'getAppliedRates'] ) ->getMock(); $this->mockConfig = $this->getMockBuilder('\Magento\Tax\Model\Config') @@ -129,11 +132,12 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase /** * @param $calculator RowBaseCalculator|TotalBaseCalculator + * @param boolean $round * @return \Magento\Tax\Api\Data\TaxDetailsItemInterface */ - public function calculate($calculator) + public function calculate($calculator, $round = true) { - return $calculator->calculate($this->mockItem, 1); + return $calculator->calculate($this->mockItem, 1, $round); } /** @@ -147,7 +151,7 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase $this->mockItem, [ [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'getDiscountAmount', self::MOCK_VALUE => 1, ], @@ -157,17 +161,17 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase self::MOCK_VALUE => self::CODE ], [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'getType', self::MOCK_VALUE => self::TYPE ], [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'getUnitPrice', self::MOCK_VALUE => self::UNIT_PRICE ], [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'getIsTaxIncluded', self::MOCK_VALUE => $isTaxIncluded ] @@ -185,7 +189,7 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase $this->mockConfig, [ [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'applyTaxAfterDiscount', self::MOCK_VALUE => true, ] @@ -196,47 +200,55 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase /** * init mock calculation model * + * @param boolean $isTaxIncluded */ - protected function initMockCalculationTool() + protected function initMockCalculationTool($isTaxIncluded) { - $this->mockReturnValues( - $this->mockCalculationTool, + $mockValues = [ [ - [ - self::ONCE => false, - self::MOCK_METHOD_NAME => 'calcTaxAmount', - self::MOCK_VALUE => 1.5, - ], - [ - self::ONCE => true, - self::MOCK_METHOD_NAME => 'getRate', - self::MOCK_VALUE => self::RATE - ], - [ - self::ONCE => true, - self::MOCK_METHOD_NAME => 'getAppliedRates', - self::MOCK_VALUE => [ - [ - 'id' => 0, - 'percent' => 1.4, - 'rates' => [ - [ - 'code' => 'sku_1', - 'title' => 'title1', - 'percent' => 1.1, - ], + self::ONCE => false, + self::MOCK_METHOD_NAME => 'getRate', + self::MOCK_VALUE => self::RATE + ], + [ + self::ONCE => false, + self::MOCK_METHOD_NAME => 'getAppliedRates', + self::MOCK_VALUE => [ + [ + 'id' => 0, + 'percent' => 1.4, + 'rates' => [ + [ + 'code' => 'sku_1', + 'title' => 'title1', + 'percent' => 1.1, ], ], - ] - ], - [ - self::ONCE => false, - self::MOCK_METHOD_NAME => 'round', - self::MOCK_VALUE => 1.3 + ], ] - ] + ], + ]; + + if ($isTaxIncluded) { + $mockValues[] = [ + self::ONCE => false, + self::MOCK_METHOD_NAME => 'getStoreRate', + self::MOCK_VALUE => self::STORE_RATE + ]; + } + + $this->mockReturnValues( + $this->mockCalculationTool, + $mockValues ); + $this->mockCalculationTool->expects($this->atLeastOnce()) + ->method('round') + ->willReturnCallback( + function ($price) { + return round($price, 2); + } + ); } /** @@ -249,7 +261,7 @@ class RowBaseAndTotalBaseCalculatorTestCase extends \PHPUnit_Framework_TestCase $this->appliedTaxDataObjectFactory, [ [ - self::ONCE => true, + self::ONCE => false, self::MOCK_METHOD_NAME => 'create', self::MOCK_VALUE => $this->mockAppliedTax, ] diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php index 3de3c4b10ea28f0805e3598ad8bd581288339c88..ebf9239463a61ceaa05dde8fd99bb42cee6e62cf 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RowBaseCalculatorTest.php @@ -26,8 +26,15 @@ class RowBaseCalculatorTest extends RowBaseAndTotalBaseCalculatorTestCase $this->assertSame( $this->taxDetailsItem, - $this->calculate($this->rowBaseCalculator) + $this->calculate($this->rowBaseCalculator, true) + ); + $this->assertEquals(self::UNIT_PRICE_INCL_TAX_ROUNDED, $this->taxDetailsItem->getPriceInclTax()); + + $this->assertSame( + $this->taxDetailsItem, + $this->calculate($this->rowBaseCalculator, false) ); + $this->assertEquals(self::UNIT_PRICE_INCL_TAX, $this->taxDetailsItem->getPriceInclTax()); } public function testCalculateWithTaxNotInPrice() diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/TotalBaseCalculatorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/TotalBaseCalculatorTest.php index 880b9d57c81b56cc4750fa4da8de4cd6496c0495..d5c0c0ef85c8701778a651540880d8d6f8439dd6 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/TotalBaseCalculatorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/TotalBaseCalculatorTest.php @@ -22,6 +22,21 @@ class TotalBaseCalculatorTest extends RowBaseAndTotalBaseCalculatorTestCase $this->taxDetailsItem, $this->calculate($this->totalBaseCalculator) ); + $this->assertEquals(self::UNIT_PRICE_INCL_TAX_ROUNDED, $this->taxDetailsItem->getPriceInclTax()); + } + + public function testCalculateWithTaxInPriceNoRounding() + { + $this->initTotalBaseCalculator(); + $this->totalBaseCalculator->expects($this->exactly(3)) + ->method('deltaRound')->will($this->returnValue(0)); + $this->initMocks(true); + + $this->assertSame( + $this->taxDetailsItem, + $this->calculate($this->totalBaseCalculator, false) + ); + $this->assertEquals(self::UNIT_PRICE_INCL_TAX, $this->taxDetailsItem->getPriceInclTax()); } public function testCalculateWithTaxNotInPrice() diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php index 9f69f1a2035bf1f8bd629490d795f0f64c1007c3..bed813c1f188860769a2316b55ed3665781d6f8f 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/UnitBaseCalculatorTest.php @@ -18,7 +18,10 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase const CODE = 'CODE'; const TYPE = 'TYPE'; - const ROW_TAX = 44.954136954136; + const ROW_TAX = 44.958682408681; + const ROW_TAX_ROUNDED = 44.95; + const PRICE_INCL_TAX = 495.4954954955; + const PRICE_INCL_TAX_ROUNDED = 495.50; /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $taxDetailsItemDataObjectFactoryMock; @@ -68,7 +71,11 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase $this->mockCalculationTool->expects($this->any()) ->method('round') ->withAnyParameters() - ->will($this->returnArgument(0)); + ->willReturnCallback( + function ($price) { + return round($price, 2); + } + ); $this->mockConfig = $this->getMockBuilder('\Magento\Tax\Model\Config') ->disableOriginalConstructor() ->getMock(); @@ -113,26 +120,26 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase public function testCalculateWithTaxInPrice() { $mockItem = $this->getMockItem(); - $mockItem->expects($this->once()) + $mockItem->expects($this->atLeastOnce()) ->method('getIsTaxIncluded') ->will($this->returnValue(true)); - $this->mockConfig->expects($this->once()) + $this->mockConfig->expects($this->atLeastOnce()) ->method('crossBorderTradeEnabled') ->will($this->returnValue(false)); - $this->mockConfig->expects($this->once()) + $this->mockConfig->expects($this->atLeastOnce()) ->method('applyTaxAfterDiscount') ->will($this->returnValue(true)); - $this->mockCalculationTool->expects($this->once()) + $this->mockCalculationTool->expects($this->atLeastOnce()) ->method('getRate') ->with($this->addressRateRequest) ->will($this->returnValue(self::RATE)); - $this->mockCalculationTool->expects($this->once()) + $this->mockCalculationTool->expects($this->atLeastOnce()) ->method('getStoreRate') ->with($this->addressRateRequest, self::STORE_ID) ->will($this->returnValue(self::STORE_RATE)); - $this->mockCalculationTool->expects($this->once()) + $this->mockCalculationTool->expects($this->atLeastOnce()) ->method('getAppliedRates') ->withAnyParameters() ->will($this->returnValue([])); @@ -140,7 +147,14 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase $this->assertSame($this->taxDetailsItem, $this->model->calculate($mockItem, self::QUANTITY)); $this->assertSame(self::CODE, $this->taxDetailsItem->getCode()); $this->assertSame(self::TYPE, $this->taxDetailsItem->getType()); + $this->assertSame(self::ROW_TAX_ROUNDED, $this->taxDetailsItem->getRowTax()); + $this->assertEquals(self::PRICE_INCL_TAX_ROUNDED, $this->taxDetailsItem->getPriceInclTax()); + + $this->assertSame($this->taxDetailsItem, $this->model->calculate($mockItem, self::QUANTITY, false)); + $this->assertSame(self::CODE, $this->taxDetailsItem->getCode()); + $this->assertSame(self::TYPE, $this->taxDetailsItem->getType()); $this->assertSame(self::ROW_TAX, $this->taxDetailsItem->getRowTax()); + $this->assertEquals(self::PRICE_INCL_TAX, $this->taxDetailsItem->getPriceInclTax()); } public function testCalculateWithTaxNotInPrice() @@ -178,16 +192,16 @@ class UnitBaseCalculatorTest extends \PHPUnit_Framework_TestCase $mockItem = $this->getMockBuilder('Magento\Tax\Api\Data\QuoteDetailsItemInterface') ->disableOriginalConstructor() ->getMock(); - $mockItem->expects($this->once()) + $mockItem->expects($this->atLeastOnce()) ->method('getDiscountAmount') ->will($this->returnValue(1)); $mockItem->expects($this->atLeastOnce()) ->method('getCode') ->will($this->returnValue(self::CODE)); - $mockItem->expects($this->once()) + $mockItem->expects($this->atLeastOnce()) ->method('getType') ->will($this->returnValue(self::TYPE)); - $mockItem->expects($this->once()) + $mockItem->expects($this->atLeastOnce()) ->method('getUnitPrice') ->will($this->returnValue(self::UNIT_PRICE)); diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php index b5c223f0a6287acf8ad920a7b35cc6391a2a95e7..ee093ee6807bc586dc2ee41a1179d396726afc7a 100644 --- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php +++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/TaxTest.php @@ -576,7 +576,7 @@ class TaxTest extends \PHPUnit_Framework_TestCase /** * Tests the specific method * - * @param string $itemData + * @param string $appliedTaxesData * @param array $addressData * * @dataProvider dataProviderFetchArray @@ -584,7 +584,8 @@ class TaxTest extends \PHPUnit_Framework_TestCase */ public function testFetch($appliedTaxesData, $addressData) { - $methods = ['getAppliedTaxes', 'getTaxAmount', 'getTotalAmount', 'getGrandTotal', 'getSubtotalInclTax']; + $taxAmount = 8; + $methods = ['getAppliedTaxes', 'getTotalAmount', 'getGrandTotal', 'getSubtotalInclTax']; $totalsMock = $this->getMock('Magento\Quote\Model\Quote\Address\Total', $methods, [], '', false); $taxConfig = $this->getMockBuilder('\Magento\Tax\Model\Config') ->disableOriginalConstructor() @@ -632,10 +633,6 @@ class TaxTest extends \PHPUnit_Framework_TestCase ->expects($this->once()) ->method('getAppliedTaxes') ->will($this->returnValue($appliedTaxes)); - $address - ->expects($this->any()) - ->method('getQuote') - ->will($this->returnValue($quote)); $totalsMock ->expects($this->any()) ->method('getGrandTotal') @@ -644,10 +641,17 @@ class TaxTest extends \PHPUnit_Framework_TestCase ->expects($this->any()) ->method('getStore') ->will($this->returnValue($store)); + $quote->expects($this->any()) + ->method('getAllAddresses') + ->will($this->returnValue([$address])); + $address + ->expects($this->any()) + ->method('getQuote') + ->will($this->returnValue($quote)); $address ->expects($this->any()) ->method('getTaxAmount') - ->will($this->returnValue(8)); + ->will($this->returnValue($taxAmount)); $address ->expects($this->any()) ->method('getCustomAttributesCodes') @@ -658,7 +662,10 @@ class TaxTest extends \PHPUnit_Framework_TestCase $address->setData($key, $value); } - $taxTotalsCalcModel->fetch($quote, $totalsMock); + $this->assertNull($totalsMock->getTaxAmount()); + $totalsArray = $taxTotalsCalcModel->fetch($quote, $totalsMock); + $this->assertArrayHasKey('value', $totalsArray[0]); + $this->assertEquals($taxAmount, $totalsArray[0]['value']); } /** diff --git a/app/code/Magento/Tax/Test/Unit/Setup/TaxSetupTest.php b/app/code/Magento/Tax/Test/Unit/Setup/TaxSetupTest.php index c42a28490e3442ad20d004b535abfb6994ef3262..151cd1876c40294acb1e7bd0d013b4e8955ae6f4 100644 --- a/app/code/Magento/Tax/Test/Unit/Setup/TaxSetupTest.php +++ b/app/code/Magento/Tax/Test/Unit/Setup/TaxSetupTest.php @@ -19,11 +19,19 @@ class TaxSetupTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->typeConfigMock = $this->getMock('Magento\Catalog\Model\ProductTypes\ConfigInterface'); + + $salesSetup = $this->getMock('\Magento\Sales\Setup\SalesSetup', [], [], '', false); + $salesSetupFactory = $this->getMock('Magento\Sales\Setup\SalesSetupFactory', ['create'], [], '', false); + $salesSetupFactory->expects($this->any())->method('create')->will($this->returnValue($salesSetup)); + + $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->taxSetup = $helper->getObject( 'Magento\Tax\Setup\TaxSetup', - ['productTypeConfig' => $this->typeConfigMock] + [ + 'productTypeConfig' => $this->typeConfigMock, + 'salesSetupFactory' => $salesSetupFactory, + ] ); } diff --git a/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml index e04ddfeeefeb8028d1d6159558ef2340b8e80c1c..22adf3c427eaad459e2e317e943f984838e8ef5b 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml @@ -88,7 +88,7 @@ require([ item.itemElement = that.prev(); $('#tax-rate-form') .dialogRates({itemRate: item}) - .dialogRates('open'); + .dialogRates('openModal'); } else { if (result.error_message) diff --git a/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html b/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html index c3c28a58138221e7031bc00c463df46c62a9a416..5b04ee8298480f1c9910f94d1f9897d44c91dcb7 100644 --- a/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html +++ b/app/code/Magento/Tax/view/frontend/web/template/checkout/minicart/subtotal/totals.html @@ -10,11 +10,11 @@ <span class="price-wrapper" data-bind="html: cart().subtotal_excl_tax"></span> <!-- /ko --> - <!-- ko if: !display_cart_subtotal_excl_tax && display_subtotal_incl_tax --> + <!-- ko if: !display_cart_subtotal_excl_tax && display_cart_subtotal_incl_tax --> <span class="price-wrapper" data-bind="html: cart().subtotal_incl_tax"></span> <!-- /ko --> - <!-- ko if: !display_cart_subtotal_excl_tax && !display_subtotal_incl_tax --> + <!-- ko if: !display_cart_subtotal_excl_tax && !display_cart_subtotal_incl_tax --> <span class="price-wrapper price-including-tax" data-bind="attr: { 'data-label': $t('Incl. Tax') }, html: cart().subtotal_incl_tax"> </span> diff --git a/app/code/Magento/Weee/Helper/Data.php b/app/code/Magento/Weee/Helper/Data.php index 55db9791896ecb8307b01bee407fb1bf1a84eaa9..138ae26986b5aaf112780ed64e2c8ecd5f08cb0c 100644 --- a/app/code/Magento/Weee/Helper/Data.php +++ b/app/code/Magento/Weee/Helper/Data.php @@ -739,12 +739,12 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper } /** - * get FPT DISPLAY_INCL setting + * Get FPT DISPLAY_INCL setting * * @param int|null $storeId * @return bool */ - public function geDisplayIncl($storeId = null) + public function isDisplayIncl($storeId = null) { return $this->typeOfDisplay( WeeeDisplayConfig::DISPLAY_INCL, @@ -754,12 +754,27 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper } /** - * get FPT DISPLAY_EXCL_DESCR_INCL setting + * Get FPT DISPLAY_INCL_DESCR setting * * @param int|null $storeId * @return bool */ - public function geDisplayExlDescIncl($storeId = null) + public function isDisplayInclDesc($storeId = null) + { + return $this->typeOfDisplay( + WeeeDisplayConfig::DISPLAY_INCL_DESCR, + \Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW, + $storeId + ); + } + + /** + * Get FPT DISPLAY_EXCL_DESCR_INCL setting + * + * @param int|null $storeId + * @return bool + */ + public function isDisplayExclDescIncl($storeId = null) { return $this->typeOfDisplay( WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL, @@ -769,12 +784,12 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper } /** - * get FPT DISPLAY_EXCL setting + * Get FPT DISPLAY_EXCL setting * * @param int|null $storeId * @return bool */ - public function geDisplayExcl($storeId = null) + public function isDisplayExcl($storeId = null) { return $this->typeOfDisplay( WeeeDisplayConfig::DISPLAY_EXCL, diff --git a/app/code/Magento/Weee/Model/Config/Source/Display.php b/app/code/Magento/Weee/Model/Config/Source/Display.php index c5408a0489f491686df9c2765677ec76f43754f3..6782463857870196fdf75b7e46bc6dd487df1889 100644 --- a/app/code/Magento/Weee/Model/Config/Source/Display.php +++ b/app/code/Magento/Weee/Model/Config/Source/Display.php @@ -15,16 +15,22 @@ class Display implements \Magento\Framework\Option\ArrayInterface public function toOptionArray() { return [ - ['value' => \Magento\Weee\Model\Tax::DISPLAY_INCL, 'label' => __('Including FPT only')], + [ + 'value' => \Magento\Weee\Model\Tax::DISPLAY_INCL, + 'label' => __('Including FPT only') + ], [ 'value' => \Magento\Weee\Model\Tax::DISPLAY_INCL_DESCR, 'label' => __('Including FPT and FPT description') ], [ 'value' => \Magento\Weee\Model\Tax::DISPLAY_EXCL_DESCR_INCL, - 'label' => __('Excluding FPT, FPT description, final price') + 'label' => __('Excluding FPT. Including FPT description and final price') ], - ['value' => \Magento\Weee\Model\Tax::DISPLAY_EXCL, 'label' => __('Excluding FPT')] + [ + 'value' => \Magento\Weee\Model\Tax::DISPLAY_EXCL, + 'label' => __('Excluding FPT') + ] ]; } } diff --git a/app/code/Magento/Weee/Model/Tax.php b/app/code/Magento/Weee/Model/Tax.php index 8550915d5a21d2c56d86c019e04c3361418e1ac0..a21bc4a163ff30332cc9c7b10d0bcb2506591f92 100644 --- a/app/code/Magento/Weee/Model/Tax.php +++ b/app/code/Magento/Weee/Model/Tax.php @@ -27,7 +27,7 @@ class Tax extends \Magento\Framework\Model\AbstractModel const DISPLAY_INCL_DESCR = 1; /** - * Excluding FPT, FPT description, final price + * Excluding FPT. Including FPT description and final price */ const DISPLAY_EXCL_DESCR_INCL = 2; diff --git a/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php b/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php index 96effbb8545bfb5b54ec2fffa3e15481afd871c8..264bd13de6138459f94b6194240634b1e0bc88d5 100644 --- a/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php +++ b/app/code/Magento/Weee/Observer/GetPriceConfigurationObserver.php @@ -142,8 +142,8 @@ class GetPriceConfigurationObserver implements ObserverInterface protected function getWhichCalcPriceToUse($storeId = null) { $calcPrice = 'finalPrice'; - if ($this->weeeData->geDisplayExcl($storeId) || - $this->weeeData->geDisplayExlDescIncl($storeId) || + if ($this->weeeData->isDisplayExcl($storeId) || + $this->weeeData->isDisplayExclDescIncl($storeId) || ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) ) { $calcPrice = 'basePrice'; diff --git a/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php b/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php index 77d022811702a4fb2ab58bb76dc1a4fe760a79dd..3619e9ae9e643b9782c1747016846b78cd125018 100644 --- a/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php +++ b/app/code/Magento/Weee/Observer/UpdateProductOptionsObserver.php @@ -59,23 +59,28 @@ class UpdateProductOptionsObserver implements ObserverInterface return $this; } - if ($this->weeeData->isEnabled() && - !$this->weeeData->geDisplayIncl($product->getStoreId()) && - !$this->weeeData->geDisplayExcl($product->getStoreId()) - ) { - // only do processing on bundle product - if ($product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { - if (!array_key_exists('optionTemplate', $options)) { - $calcPrice = $this->getWhichCalcPriceToUse($product->getStoreId()); - $options['optionTemplate'] = '<%- data.label %>' - . '<% if (data.' . $calcPrice . '.value) { %>' - . ' +<%- data.' . $calcPrice . '.formatted %>' - . '<% } %>'; - } + // if the Weee module is enabled, then only do processing on bundle products + if ($this->weeeData->isEnabled() && $product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) { + + if ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) { + // the Tax module might have set up a default, but we will re-decide which calcPrice field to use + unset($options['optionTemplate']); + } + + if (!array_key_exists('optionTemplate', $options)) { + $calcPrice = $this->getWhichCalcPriceToUse($product->getStoreId()); + $options['optionTemplate'] = '<%- data.label %>' + . '<% if (data.' . $calcPrice . '.value) { %>' + . ' +<%- data.' . $calcPrice . '.formatted %>' + . '<% } %>'; + } + if (!$this->weeeData->isDisplayIncl($product->getStoreId()) && + !$this->weeeData->isDisplayExcl($product->getStoreId())) { + // we need to display the individual Weee amounts foreach ($this->weeeData->getWeeeAttributesForBundle($product) as $weeeAttributes) { foreach ($weeeAttributes as $weeeAttribute) { - if (!preg_match('/'.$weeeAttribute->getCode().'/', $options['optionTemplate'])) { + if (!preg_match('/' . $weeeAttribute->getCode() . '/', $options['optionTemplate'])) { $options['optionTemplate'] .= sprintf( ' <%% if (data.weeePrice' . $weeeAttribute->getCode() . ') { %%>' . ' (' . $weeeAttribute->getName() @@ -86,15 +91,14 @@ class UpdateProductOptionsObserver implements ObserverInterface } } } + } - if ($this->weeeData->geDisplayExlDescIncl($product->getStoreId())) { - $options['optionTemplate'] .= sprintf( - ' <%% if (data.weeePrice) { %%>' - . '<%%- data.weeePrice.formatted %%>' - . '<%% } %%>' - ); - } - + if ($this->weeeData->isDisplayExclDescIncl($product->getStoreId())) { + $options['optionTemplate'] .= sprintf( + ' <%% if (data.weeePrice) { %%>' + . '<%%- data.weeePrice.formatted %%>' + . '<%% } %%>' + ); } } $response->setAdditionalOptions($options); @@ -102,7 +106,7 @@ class UpdateProductOptionsObserver implements ObserverInterface } /** - * Returns which product price to use as a basis for the Weee's final price + * Returns which product price to show (before listing the individual Weee amounts, if applicable) * * @param int|null $storeId * @return string @@ -110,10 +114,9 @@ class UpdateProductOptionsObserver implements ObserverInterface protected function getWhichCalcPriceToUse($storeId = null) { $calcPrice = 'finalPrice'; - if ($this->weeeData->geDisplayExcl($storeId) || - $this->weeeData->geDisplayExlDescIncl($storeId) || - ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) - ) { + + if ($this->weeeData->isDisplayExclDescIncl($storeId) || + ($this->weeeData->isDisplayExcl($storeId) && $this->taxData->displayPriceExcludingTax())) { $calcPrice = 'basePrice'; } return $calcPrice; diff --git a/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php b/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php index 8725a62d837be15e68989b1fb1eab050ab0f4968..9fa6c897807a78a8025e6cba387dcaba4eb728f4 100644 --- a/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php +++ b/app/code/Magento/Weee/Test/Unit/Observer/UpdateProductOptionsObserverTest.php @@ -6,25 +6,28 @@ namespace Magento\Weee\Test\Unit\Observer; -use \Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Weee\Model\Tax as WeeeDisplayConfig; +use Magento\Tax\Model\Config as TaxConfig; class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase { /** * Tests the methods that rely on the ScopeConfigInterface object to provide their return values * - * @param array $testArray The initial array that specifies the set of additional options + * @param array $initialArray The initial array that specifies the set of additional options * @param bool $weeeEnabled Whether the Weee module is assumed to be enabled - * @param bool $weeeDisplayExclDescIncl Is this Weee display setting assumed to be set + * @param int $weeeDisplay Which Weee display is configured + * @param int $priceDisplay Values are: including tax, excluding tax, or both including and excluding tax * @param array $expectedArray The revised array of the additional options * * @dataProvider updateProductOptionsProvider */ - public function testUpdateProductOptions($testArray, $weeeEnabled, $weeeDisplayExclDescIncl, $expectedArray) + public function testUpdateProductOptions($initialArray, $weeeEnabled, $weeeDisplay, $priceDisplay, $expectedArray) { $configObj = new \Magento\Framework\DataObject( [ - 'additional_options' => $testArray, + 'additional_options' => $initialArray, ] ); @@ -47,12 +50,26 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase ->method('isEnabled') ->will($this->returnValue($weeeEnabled)); $weeeHelper->expects($this->any()) - ->method('geDisplayExlDescIncl') - ->will($this->returnValue($weeeDisplayExclDescIncl)); + ->method('isDisplayIncl') + ->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_INCL)); + $weeeHelper->expects($this->any()) + ->method('isDisplayExclDescIncl') + ->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL)); + $weeeHelper->expects($this->any()) + ->method('isDisplayExcl') + ->will($this->returnValue($weeeDisplay == WeeeDisplayConfig::DISPLAY_EXCL)); $weeeHelper->expects($this->any()) ->method('getWeeeAttributesForBundle') ->will($this->returnValue([['fpt1' => $weeeObject1], ['fpt1'=>$weeeObject1, 'fpt2'=>$weeeObject2]])); + $taxHelper=$this->getMock('Magento\Tax\Helper\Data', [], [], '', false); + $taxHelper->expects($this->any()) + ->method('displayPriceExcludingTax') + ->will($this->returnValue($priceDisplay == TaxConfig::DISPLAY_TYPE_EXCLUDING_TAX)); + $taxHelper->expects($this->any()) + ->method('priceIncludesTax') + ->will($this->returnValue(true)); + $responseObject=$this->getMock('Magento\Framework\Event\Observer', ['getResponseObject'], [], '', false); $responseObject->expects($this->any()) ->method('getResponseObject') @@ -83,6 +100,7 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase 'Magento\Weee\Observer\UpdateProductOptionsObserver', [ 'weeeData' => $weeeHelper, + 'taxData' => $taxHelper, 'registry' => $registry, ] ); @@ -99,13 +117,30 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase { return [ 'weee not enabled' => [ - 'testArray' => [ + 'initialArray' => [ + 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', + 'optionTemplate' => '<%= data.label %><% if (data.finalPrice.value) ' + . '{ %> +<%- data.finalPrice.formatted %><% } %>', + ], + 'weeeEnabled' => false, + 'weeeDisplay' => WeeeDisplayConfig::DISPLAY_INCL, // has no effect for this scenario + 'priceDisplay' => TaxConfig::DISPLAY_TYPE_EXCLUDING_TAX, // has no effect for this scenario + 'expectedArray' => [ + 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', + 'optionTemplate' => '<%= data.label %><% if (data.finalPrice.value) ' + . '{ %> +<%- data.finalPrice.formatted %><% } %>', + ], + ], + + 'weee enabled, and display with Weee included in the price' => [ + 'initialArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' . '{ %> +<%- data.basePrice.formatted %><% } %>', ], - 'weeeEnabled' => false, - 'weeeDisplayExclDescIncl' => true, + 'weeeEnabled' => true, + 'weeeDisplay' => WeeeDisplayConfig::DISPLAY_INCL, + 'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX, 'expectedArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' @@ -113,31 +148,33 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase ], ], - 'weee enabled, but not displaying ExclDescIncl' => [ - 'testArray' => [ + 'weee enabled, and display with Weee included in the price, and include the Weee descriptions' => [ + 'initialArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' . '{ %> +<%- data.basePrice.formatted %><% } %>', ], 'weeeEnabled' => true, - 'weeeDisplayExclDescIncl' => false, + 'weeeDisplay' => WeeeDisplayConfig::DISPLAY_INCL_DESCR, + 'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX, 'expectedArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' . '{ %> +<%- data.basePrice.formatted %><% } %> <% if (data.weeePricefpt1) ' - . '{ %> (: <%- data.weeePricefpt1.formatted %>)<% } %>' - . ' <% if (data.weeePricefpt2) { %> (: <%- data.weeePricefpt2.formatted %>)<% } %>', + . '{ %> (: <%- data.weeePricefpt1.formatted %>)<% } %> ' + . '<% if (data.weeePricefpt2) { %> (: <%- data.weeePricefpt2.formatted %>)<% } %>', ], ], 'weee enabled, and display with ExclDescIncl' => [ - 'testArray' => [ + 'initialArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' . '{ %> +<%- data.basePrice.formatted %><% } %>', ], 'weeeEnabled' => true, - 'weeeDisplayExclDescIncl' => true, + 'weeeDisplay' => WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL, + 'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX, 'expectedArray' => [ 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', 'optionTemplate' => '<%= data.label %><% if (data.basePrice.value) ' @@ -147,6 +184,34 @@ class UpdateProductOptionsObserverTest extends \PHPUnit_Framework_TestCase . '<% if (data.weeePrice) { %><%- data.weeePrice.formatted %><% } %>', ], ], + + 'weee enabled, and display prices including tax but without Weee' => [ + 'initialArray' => [ + 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', + ], + 'weeeEnabled' => true, + 'weeeDisplay' => WeeeDisplayConfig::DISPLAY_EXCL, + 'priceDisplay' => TaxConfig::DISPLAY_TYPE_INCLUDING_TAX, + 'expectedArray' => [ + 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', + 'optionTemplate' => '<%- data.label %><% if (data.finalPrice.value) ' + . '{ %> +<%- data.finalPrice.formatted %><% } %>', + ], + ], + + 'weee enabled, and display prices excluding tax but without Weee' => [ + 'initialArray' => [ + 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', + ], + 'weeeEnabled' => true, + 'weeeDisplay' => WeeeDisplayConfig::DISPLAY_EXCL, + 'priceDisplay' => TaxConfig::DISPLAY_TYPE_EXCLUDING_TAX, + 'expectedArray' => [ + 'TOTAL_BASE_CALCULATION' => 'TOTAL_BASE_CALCULATION', + 'optionTemplate' => '<%- data.label %><% if (data.basePrice.value) ' + . '{ %> +<%- data.basePrice.formatted %><% } %>', + ], + ], ]; } } diff --git a/app/code/Magento/Weee/i18n/de_DE.csv b/app/code/Magento/Weee/i18n/de_DE.csv index 7ec820d9eb205f5c9f27ebef7b290e9a4e9d3ca9..5c64ff992a1fafd049616625934bd2feb3b6ba77 100644 --- a/app/code/Magento/Weee/i18n/de_DE.csv +++ b/app/code/Magento/Weee/i18n/de_DE.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","Lediglich einschließlich FPT" "Including FPT and FPT description","Einschließlich FPT und FPT-Beschreibung" -"Excluding FPT, FPT description, final price","Ausschließlich FPT, FPT-Beschreibung, Endpreis" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","Ausschließlich FPT" "Fixed Product Tax","Feste Produktsteuer" Country/State,Country/State diff --git a/app/code/Magento/Weee/i18n/en_US.csv b/app/code/Magento/Weee/i18n/en_US.csv index e0989690885440cf7da81d32be361a8b2814234e..668926b681505716a6eb73ed537d715559a0cf41 100644 --- a/app/code/Magento/Weee/i18n/en_US.csv +++ b/app/code/Magento/Weee/i18n/en_US.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","Including FPT only" "Including FPT and FPT description","Including FPT and FPT description" -"Excluding FPT, FPT description, final price","Excluding FPT, FPT description, final price" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","Excluding FPT" "Fixed Product Tax","Fixed Product Tax" Country/State,Country/State diff --git a/app/code/Magento/Weee/i18n/es_ES.csv b/app/code/Magento/Weee/i18n/es_ES.csv index 75afe15b65ecdf9ebdd74e2c5623116e493d9a8a..967e9d55c1650a2482c4b46460dc62581d408bfc 100644 --- a/app/code/Magento/Weee/i18n/es_ES.csv +++ b/app/code/Magento/Weee/i18n/es_ES.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","Incluir sólo FPT" "Including FPT and FPT description","Inlcuir impuestos y descripción de los impuestos" -"Excluding FPT, FPT description, final price","Excluido FPT, descripción FPT, precio final" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","FPT no incluido" "Fixed Product Tax","Impuesto fijo del producto" Country/State,Country/State diff --git a/app/code/Magento/Weee/i18n/fr_FR.csv b/app/code/Magento/Weee/i18n/fr_FR.csv index 7570f61e26c2639aa9e0a7ed5406f320cf9a2527..3361b7bc238a1a7fa451350672cf9b3cc363eb0b 100644 --- a/app/code/Magento/Weee/i18n/fr_FR.csv +++ b/app/code/Magento/Weee/i18n/fr_FR.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","Inclure uniquement les taxes sur les produits fixes" "Including FPT and FPT description","Inclure les taxes sur les produits fixes et leur description" -"Excluding FPT, FPT description, final price","Exclure les taxes sur les produits fixes, les descriptions, et le prix final" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","Exclure les taxes sur les produits fixes" "Fixed Product Tax","Taxe sur le produit fixe" Country/State,Country/State diff --git a/app/code/Magento/Weee/i18n/nl_NL.csv b/app/code/Magento/Weee/i18n/nl_NL.csv index b86bb1920067043ab369c9e056293be0601982c1..b21a8574d6dd2e3b192d79a47700df287dc41391 100644 --- a/app/code/Magento/Weee/i18n/nl_NL.csv +++ b/app/code/Magento/Weee/i18n/nl_NL.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","Inclusief alleen FPT" "Including FPT and FPT description","Inclusief FPT en FPT omschrijving" -"Excluding FPT, FPT description, final price","Met uitzondering van FPT, FPT omschrijving, definitieve prijs" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","Met uitzondering van FPT" "Fixed Product Tax","Vaste Product Belasting" Country/State,Country/State diff --git a/app/code/Magento/Weee/i18n/pt_BR.csv b/app/code/Magento/Weee/i18n/pt_BR.csv index 7f2a0e7632ad9ef4553e6225c06ba2aa31ab0d32..881b6fe4a60aff57b39dbae4619549883f392348 100644 --- a/app/code/Magento/Weee/i18n/pt_BR.csv +++ b/app/code/Magento/Weee/i18n/pt_BR.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","Incluindo somente FPT" "Including FPT and FPT description","Incluindo FPT e descrição de FPT" -"Excluding FPT, FPT description, final price","Excluindo FPT, descrição de FPT, preço final" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","Excluindo FPT" "Fixed Product Tax","Imposto fixo do produto" Country/State,Country/State diff --git a/app/code/Magento/Weee/i18n/zh_Hans_CN.csv b/app/code/Magento/Weee/i18n/zh_Hans_CN.csv index a2c88c879992e63a8e090089d07671e0b3bc6773..55878a66c3ffbe5e528693b31e9f78ae00ed8939 100644 --- a/app/code/Magento/Weee/i18n/zh_Hans_CN.csv +++ b/app/code/Magento/Weee/i18n/zh_Hans_CN.csv @@ -7,7 +7,7 @@ Website,Website "We found a duplicate of website, country and state fields for a fixed product tax","We found a duplicate of website, country and state fields for a fixed product tax" "Including FPT only","ä»…åŒ…å« FPT" "Including FPT and FPT description","åŒ…å« FPT å’Œ FPT æè¿°" -"Excluding FPT, FPT description, final price","ä¸åŒ…å« FPT,FPT æè¿°ï¼Œæœ€ç»ˆä»·æ ¼" +"Excluding FPT. Including FPT description and final price","Excluding FPT. Including FPT description and final price" "Excluding FPT","ä¸åŒ…å« FPT" "Fixed Product Tax",固定产å“税费 Country/State,Country/State diff --git a/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml b/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml index 0f71192ce3985097bb36583c0f7be9463ee1d00e..2da14c7d14b5e96b7e87c2972d035324704071ee 100644 --- a/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml +++ b/app/code/Magento/Weee/view/frontend/templates/checkout/cart/item/price/sidebar.phtml @@ -9,24 +9,30 @@ /** @var $block \Magento\Weee\Block\Item\Price\Renderer */ $item = $block->getItem(); + +// ensure we use the zone for the shopping cart / minicart +$originalZone = $block->getZone(); +$block->setZone(\Magento\Framework\Pricing\Render::ZONE_CART); ?> + <?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?> -<span class="price-including-tax" data-label="<?php echo $block->escapeHtml(__('Incl. Tax')); ?>"> - <?php if ($block->displayPriceWithWeeeDetails()): ?> - <span class="minicart-tax-total"> - <?php else: ?> + <span class="price-including-tax" data-label="<?php echo $block->escapeHtml(__('Incl. Tax')); ?>"> + <?php if ($block->displayPriceWithWeeeDetails()): ?> + <span class="minicart-tax-total"> + <?php else: ?> <span class="minicart-price"> - <?php endif; ?> + <?php endif; ?> <?php /* @escapeNotVerified */ echo $block->formatPrice($block->getUnitDisplayPriceInclTax()); ?> - </span> + </span> + <?php if ($block->displayPriceWithWeeeDetails()): ?> <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> - <span class="minicart-tax-info" style="display: none"> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> - <span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>"> - <?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount_incl_tax'], true, true); ?> - </span> - <?php endforeach; ?> + <span class="minicart-tax-info"> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> + <span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>"> + <?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount_incl_tax'], true, true); ?> + </span> + <?php endforeach; ?> </span> <?php if ($block->displayFinalPrice()): ?> @@ -37,35 +43,39 @@ $item = $block->getItem(); </span> <?php endif; ?> <?php endif; ?> - </span> <?php endif; ?> + </span> +<?php endif; ?> - <?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?> +<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?> <span class="price-excluding-tax" data-label="<?php echo $block->escapeHtml(__('Excl. Tax')); ?>"> - <?php if ($block->displayPriceWithWeeeDetails()): ?> + <?php if ($block->displayPriceWithWeeeDetails()): ?> <span class="minicart-tax-total"> - <?php else: ?> - <span class="minicart-price"> - <?php endif; ?> + <?php else: ?> + <span class="minicart-price"> + <?php endif; ?> <?php /* @escapeNotVerified */ echo $block->formatPrice($block->getUnitDisplayPriceExclTax()); ?> - </span> + </span> - <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> - <span class="minicart-tax-info"> - <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> - <span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>"> - <?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount'], true, true); ?> - </span> - <?php endforeach; ?> + <?php if ($block->displayPriceWithWeeeDetails()): ?> + <?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?> + <span class="minicart-tax-info"> + <?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?> + <span class="weee" data-label="<?php /* @escapeNotVerified */ echo $tax['title']; ?>"> + <?php /* @escapeNotVerified */ echo $block->formatPrice($tax['amount'], true, true); ?> + </span> + <?php endforeach; ?> </span> <?php if ($block->displayFinalPrice()): ?> - <span class="minicart-tax-total"> + <span class="minicart-tax-total"> <span class="weee" data-label="<?php echo $block->escapeHtml(__('Total')); ?>"> <?php /* @escapeNotVerified */ echo $block->formatPrice($block->getFinalUnitDisplayPriceExclTax()); ?> </span> </span> - <?php endif; ?> <?php endif; ?> - </span> <?php endif; ?> + <?php endif; ?> + </span> +<?php endif; ?> +<?php $block->setZone($originalZone); ?> diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less index 730f3d53ff58c7e23ab424d3926e85948cf1d305..78129d62a70de8796227b5d870c8aadafe147861 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less @@ -253,6 +253,9 @@ .scope-label { padding: 31px 1.5rem 0 0; } + .use-default { + padding: 29px 1.5rem 0 0; + } .value { padding-right: 4rem; } diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less index 0de27d21df32f5a65c45e23f1c67b5a09f1fd9d1..4f8c9b771654909e46c3d61764fa9a134c03ff44 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payment-options.less @@ -105,6 +105,58 @@ filter: gray; // For IE 6 - 9 } } + + .ccard { + .legend { + &:extend(.abs-visually-hidden all); + } + .fields { + > .year { + padding-left: @indent__xs; + } + .select { + padding-left: @indent__xs; + padding-right: @indent__xs; + } + } + .month { + .select { + width: 140px; + } + } + .year { + .select { + width: 80px; + } + } + .number { + .input-text { + width: 225px; + } + } + + > .field.cvv { + > .control { + padding-right: @indent__base; + width: auto; + } + } + .cvv { + .input-text { + width: 55px; + } + } + + &.fieldset { + > .field { + .fields.group.group-2 { + .field { + width: auto !important; + } + } + } + } + } } } diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payments.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payments.less index 741516ae64dd30e2e11067ebc2a3c7d574ba95a9..516d9e21e8b091645193355d94bef8c86f5c2f87 100644 --- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payments.less +++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_payments.less @@ -76,13 +76,6 @@ margin: 0 0 @indent__base; } } - .field { - &.cvv { - .control { - width: 40%; - } - } - } } .field-select-billing, @@ -136,14 +129,6 @@ .no-payments-block { margin: @indent__base 0; } - .ccard { - .legend { - &:extend(.abs-visually-hidden all); - } - .year { - padding-left: @indent__l; - } - } .payments { .legend { &:extend(.abs-visually-hidden all); diff --git a/app/design/frontend/Magento/blank/Magento_LayeredNavigation/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_LayeredNavigation/web/css/source/_module.less index 8b3d0a38fe55dcf3540acd828ce9a4eae32f0f4a..c51aac33382940011e165490c0ca0eae85451536 100644 --- a/app/design/frontend/Magento/blank/Magento_LayeredNavigation/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_LayeredNavigation/web/css/source/_module.less @@ -4,75 +4,88 @@ // */ // -// Common -//-------------------------------------- +// Common +// _____________________________________________ & when (@media-common = true) { -.block.filter { - margin-bottom: 40px; - .title { - margin-bottom: 20px; - strong { - font-size: 18px; - } - } - .subtitle { - display: none; - } - .filter-options-content { - .filter-count-label { - &:extend(.abs-visually-hidden all); + .block.filter { + margin-bottom: @indent__xl ; + .title { + margin-bottom: @indent__base; + strong { + font-size: 18px; + } } - } - .options { - margin: 0; - > dt { - .lib-heading(h4); - margin: 0 0 10px; + .subtitle { + display: none; } - > dd { - margin: 0 0 25px; - - .item { - margin-bottom: 3px; + .filter-options-content { + .filter-count-label { + &:extend(.abs-visually-hidden all); } } - .count { - .lib-css(color, @text__color__muted); - &:before { - content: '('; + .options { + margin: 0; + > dt { + .lib-heading(h4); + margin: 0 0 @indent__s; } - &:after { - content: ')'; + > dd { + margin: 0 0 @indent__m; + + .item { + margin-bottom: 3px; + } + } + .count { + .lib-css(color, @text__color__muted); + &:before { + content: '('; + } + &:after { + content: ')'; + } } } - } - .items { - &:extend(.abs-reset-list all); - } - .filtered { .items { - margin: 15px 0; + &:extend(.abs-reset-list all); } - .item { - position: relative; - padding-left: 22px; - margin-bottom: 6px; - .label { - font-weight: @font-weight__bold; + .filtered { + .items { + margin: 15px 0; } - .action.remove { - &:extend(.abs-remove-button-for-blocks all); - position: absolute; - left: -6px; - top: 0; + .item { + margin-bottom: 6px; + padding-left: 22px; + position: relative; + .label { + font-weight: @font-weight__bold; + } + .action.remove { + &:extend(.abs-remove-button-for-blocks all); + left: -6px; + position: absolute; + top: 0; + } + } + & + .actions { + margin-bottom: 35px; } - } - & + .actions { - margin-bottom: 35px; } } } +// +// Mobile +// _____________________________________________ + +.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { + .page-with-filter { + .columns { + .sidebar-main { + .lib-vendor-prefix-order(0); + } + } + } } diff --git a/app/design/frontend/Magento/blank/web/css/source/_navigation.less b/app/design/frontend/Magento/blank/web/css/source/_navigation.less index 4e4b410c5f6e28d62b5619792c739f760976103f..f4fee4d5d7d4e92f7c16e69eb4c83c469f7b58b6 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_navigation.less +++ b/app/design/frontend/Magento/blank/web/css/source/_navigation.less @@ -86,7 +86,7 @@ font-size: 1.6rem; font-weight: 700; margin: 0; - padding: 8px 20px; + padding: .8rem 3.5rem .8rem 2rem; .label { display: block; margin-bottom: @indent__xs; @@ -125,16 +125,17 @@ .header.links { .lib-list-reset-styles(); + border-bottom: 1px solid @color-gray82; li { - border-top: 1px solid @color-gray82; font-size: 1.6rem; margin: 0; &.greet.welcome { + border-top: 1px solid @color-gray82; font-weight: 700; - padding: 8px 20px; + padding: .8rem @indent__base; } - &:last-child { - border-bottom: 1px solid @color-gray82; + > a { + border-top: 1px solid @color-gray82; } } a, @@ -143,7 +144,10 @@ .lib-css(text-decoration, @navigation-level0-item__text-decoration); display: block; font-weight: 700; - padding: 8px 20px; + padding: .8rem @indent__base; + } + .header.links { + border: 0; } } } @@ -217,6 +221,11 @@ background: transparent; border-bottom: 0; } + .nav-sections-item-switch { + &:hover { + text-decoration: none; + } + } } &-item-content { diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payment-options.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payment-options.less new file mode 100644 index 0000000000000000000000000000000000000000..555098fcefb113aa8c98fa535c37ac960278abe2 --- /dev/null +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payment-options.less @@ -0,0 +1,203 @@ +// /** +// * Copyright © 2015 Magento. All rights reserved. +// * See COPYING.txt for license details. +// */ + +// +// Variables +// _____________________________________________ + +@checkout-payment-option-title__border: @checkout-payment-method-title__border; +@checkout-payment-option-title__color: @link__color; +@checkout-payment-option-title__padding: @checkout-payment-method-title__padding; +@checkout-payment-option-title-mobile__padding: @checkout-payment-method-title-mobile__padding; + +@checkout-payment-option-title-icon__font-size: 32px; +@checkout-payment-option-title-icon__line-height: 16px; +@checkout-payment-option-title-icon__margin: 0; +@checkout-payment-option-title-icon__color: @minicart-icons-color; +@checkout-payment-option-title-icon__hover__color: @primary__color; + +@checkout-payment-option-content__padding__xl: @checkout-payment-method-content__padding__xl; + +// +// Common +// _____________________________________________ + +& when (@media-common = true) { + .checkout-payment-method { + .payment-option { + &._active { + .payment-option-title { + .action-toggle { + &:after { + content: @icon-up; + } + } + } + } + &._collapsible { + .payment-option-title { + cursor: pointer; + } + .payment-option-content { + display: none; + } + } + } + + .payment-option-title { + .lib-css(border-top, @checkout-payment-option-title__border); + .lib-css(padding, @checkout-payment-option-title__padding 0); + + .action-toggle { + .lib-css(color, @checkout-payment-option-title__color); + .lib-icon-font( + @icon-down, + @_icon-font-size: @checkout-payment-option-title-icon__font-size, + @_icon-font-line-height: @checkout-payment-option-title-icon__line-height, + @_icon-font-color: @checkout-payment-option-title-icon__color, + @_icon-font-color-hover: @checkout-payment-option-title-icon__hover__color, + @_icon-font-color-active: @checkout-payment-option-title-icon__color, + @_icon-font-margin: @checkout-payment-option-title-icon__margin, + @_icon-font-position: after + ); + } + } + + .payment-option-content { + .lib-css(padding, 0 0 @indent__base @checkout-payment-option-content__padding__xl); + } + + .payment-option-inner { + margin: 0 0 @indent__base; + } + + .credit-card-types { + padding: 0; + .item { + display: inline-block; + list-style: none; + margin: 0 @indent__xs 0 0; + vertical-align: top; + &._active { + font-weight: @font-weight__bold; + img { + -webkit-filter: grayscale(0%); + filter: grayscale(0%); + filter: none; + } + } + &._inactive { + opacity: 0.4; + filter: alpha(opacity=40); + } + span { + display: inline-block; + padding-top: 6px; + vertical-align: top; + } + } + img { + -webkit-filter: grayscale(100%); // For Webkit browsers + -webkit-transition: all .6s ease; // Fade to color for Chrome and Safari + filter: grayscale(100%); + filter: gray; // For IE 6 - 9 + } + } + + .ccard { + .legend { + &:extend(.abs-visually-hidden all); + } + .fields { + > .year { + padding-left: @indent__xs; + } + .select { + padding-left: @indent__xs; + padding-right: @indent__xs; + } + } + .month { + .select { + width: 140px; + } + } + .year { + .select { + width: 80px; + } + } + .number { + .input-text { + width: 225px; + } + } + + > .field.cvv { + > .control { + display: inline-block; + padding-right: @indent__base; + } + } + .cvv { + .label { + display: block; + } + .input-text { + width: 55px; + } + } + + &.fieldset { + > .field { + .fields.group.group-2 { + .field { + width: auto !important; + } + } + } + } + } + } +} + +// +// Mobile +// _____________________________________________ + +.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) { + .checkout-payment-method { + .payment-option { + .lib-css(margin, 0 -(@checkout-payment-option-title-mobile__padding)); + + .payment-option-title { + .lib-css(padding, @checkout-payment-option-title-mobile__padding) + } + + .payment-option-content { + .lib-css(padding, 0 @checkout-payment-option-title-mobile__padding @indent__base); + } + } + } +} + +// +// Desktop +// _____________________________________________ + +.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { + .checkout-payment-method { + .payment-option-title { + .lib-css(padding-left, @checkout-payment-option-content__padding__xl); + } + .payment-option-content { + .payment-option-inner { + + .actions-toolbar { + margin-left: 0; + } + } + } + } +} diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less index c0f1168e6ef0f0a2513ed747ed59cebf21d85fe4..0940e6e4723609fa1da4a64f6fa315bca9999472 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less @@ -76,13 +76,6 @@ margin: 0 0 @indent__base; } } - .field { - &.cvv { - .control { - width: 40%; - } - } - } } .field-select-billing, @@ -136,14 +129,6 @@ .no-payments-block { margin: @indent__base 0; } - .ccard { - .legend { - &:extend(.abs-visually-hidden all); - } - .year { - padding-left: @indent__l; - } - } .payments { .legend { &:extend(.abs-visually-hidden all); 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 898ddc99afdfa2d23f5d8f7baf12d8d65baec71e..17cadfeb19cd5bec72ae4e0f54888586dbf3f39e 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 @@ -4,238 +4,239 @@ // */ // -// Common -//-------------------------------------- +// Common +// _____________________________________________ & when (@media-common = true) { + .filter { + &.block { + margin-bottom: 0; + } + &-title { + strong { + @_shadow: inset 0 1px 0 0 @color-white, inset 0 -1px 0 0 fade(@border-color__base, 30); -.filter { - &.block { - margin-bottom: 0; - } - &-title { - strong { - position: absolute; - z-index: 2; - line-height: 16px; - border: 1px solid @border-color__base; - text-align: center; - padding: 7px 10px; - @_shadow: inset 0 1px 0 0 @color-white, inset 0 -1px 0 0 fade(@border-color__base, 30); - .lib-css(background-color, @toolbar-element-background); - .lib-css(box-shadow, @_shadow); - border-radius: 3px; - font-weight: 400; - top: 0; - left: 0; - &[data-count]:after { - content: attr(data-count); - display: inline-block; - border-radius: 2px; - padding: 2px; - font-size: .8em; - margin: 0 5px; - .lib-css(color, @color-white); - min-width: 1em; - line-height: 1; - background: @color-orange-red4; - } - &.disabled { - opacity: .5; + .lib-css(background-color, @toolbar-element-background); + .lib-css(box-shadow, @_shadow); + border-radius: 3px; + border: 1px solid @border-color__base; + font-weight: 400; + left: 0; + line-height: 16px; + padding: 7px @indent__s; + position: absolute; + text-align: center; + top: 0; + z-index: 2; + &[data-count]:after { + .lib-css(color, @color-white); + background: @color-orange-red4; + border-radius: 2px; + content: attr(data-count); + display: inline-block; + font-size: .8em; + line-height: 1; + margin: 0 @indent__xs; + min-width: 1em; + padding: 2px; + } + &.disabled { + opacity: .5; + } } } - } - .block-subtitle { - font-weight: @font-weight__semibold; - padding: @indent__s @indent__s @indent__base; - font-size: @font-size__base; - line-height: 1em; - border-bottom: @border-width__base solid @border-color__base; - } - &-subtitle { - display: none; - } - &-current { - margin: 0; - .items { - padding: @indent__xs @indent__s; + .block-subtitle { + border-bottom: @border-width__base solid @border-color__base; + font-size: @font-size__base; + font-weight: @font-weight__semibold; + line-height: 1em; + padding: @indent__s @indent__s @indent__base; } - .item { - position: relative; - z-index: 1; - padding-left: 17px; + &-subtitle { + display: none; } - .filter &-subtitle { - display: block; - border: none; - padding-bottom: @indent__s; + &-current { + margin: 0; + .items { + padding: @indent__xs @indent__s; + } + .item { + padding-left: 17px; + position: relative; + z-index: 1; + } + .filter &-subtitle { + border: none; + display: block; + padding-bottom: @indent__s; + } + .action.remove { + &:extend(.abs-remove-button-for-blocks all); + left: -2px; + position: absolute; + top: -1px; + } } - .action.remove { - &:extend(.abs-remove-button-for-blocks all); - position: absolute; - left: -2px; - top: -1px; + &-actions { + margin-bottom: @indent__m; + padding: 0 @indent__s; } - } - &-actions { - padding: 0 @indent__s; - margin-bottom: @indent__m; - } - &-label { - font-weight: @font-weight__bold; - &:after { - content: ": "; + &-label { + font-weight: @font-weight__bold; + &:after { + content: ': '; + } } - } - &-value { - .lib-css(color, @filter-quantity); - } - &-options { - display: none; - margin: 0; - &-item { - border-bottom: @border-width__base solid @border-color__base; - padding-bottom: @indent__s; + &-value { + .lib-css(color, @filter-quantity); } - &-title { - cursor: pointer; - font-weight: @font-weight__semibold; + &-options { + display: none; margin: 0; - overflow: hidden; - padding: @indent__s 20px+@indent__s 0 @indent__s; - position: relative; - z-index: 1; - text-transform: uppercase; - - .lib-icon-font( + &-item { + border-bottom: @border-width__base solid @border-color__base; + padding-bottom: @indent__s; + } + &-title { + cursor: pointer; + font-weight: @font-weight__semibold; + margin: 0; + overflow: hidden; + padding: @indent__s 20px+@indent__s 0 @indent__s; + position: relative; + text-transform: uppercase; + z-index: 1; + .lib-icon-font( @_icon-font-content: @icon-down, @_icon-font-size: 13px, @_icon-font-position: after, @_icon-font-display: block - ); - &:after { - position: absolute; - right: 13px; - top: 9px; - } - &:hover { - .lib-css(color, @filter-link-hover); - } - .active > & { - .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: after ); - } - } - &-content { - margin: 0; - padding: @indent__s; - .item { - margin: @indent__s 0; - line-height: 1.5em; - } - a { - .lib-css(color, @filter-link); - margin-right: -5px; - padding-left: 5px; - margin-left: -5px; - padding-right: 7px; + + &:after { + position: absolute; + right: 13px; + top: 9px; + } &:hover { - background-color: @color-gray91; - text-decoration: none; - & + .count { + .lib-css(color, @filter-link-hover); + } + .active > & { + .lib-icon-font-symbol( + @_icon-font-content: @icon-up, + @_icon-font-position: after + ); + } + } + &-content { + margin: 0; + padding: @indent__s; + .item { + margin: @indent__s 0; + line-height: 1.5em; + } + a { + .lib-css(color, @filter-link); + margin-left: -5px; + margin-right: -5px; + padding-left: 5px; + padding-right: 7px; + &:hover { background-color: @color-gray91; + text-decoration: none; + & + .count { + background-color: @color-gray91; + } } } - } - .count { - .lib-css(color, @filter-quantity); - padding-right: 5px; - &:before { - content: "("; + .count { + .lib-css(color, @filter-quantity); + padding-right: 5px; + &:before { + content: '('; + } + &:after { + content: ')'; + } } - &:after { - content: ")"; + .filter-count-label { + &:extend(.abs-visually-hidden all); } } - .filter-count-label { - &:extend(.abs-visually-hidden all); - } } } } -} - // -// Mobile -//-------------------------------------- +// Mobile +// _____________________________________________ .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { - body.filter-active { - .page-wrapper { - visibility: hidden; - height: 0; - margin-top: -999999em; - } - .columns { - z-index: 999; + body { + &.filter-active { + .page-wrapper { + height: 0; + margin-top: -999999em; + visibility: hidden; + } + .columns { + z-index: 999; + } } } .filter { &.active { position: relative; - z-index: 99; visibility: visible; + z-index: 99; .filter-options-item:last-child { margin-bottom: @indent__xl; } .filter-title { + border-bottom: 1px solid @border-color__base; + height: 48px; + left: 0; position: fixed; - top: 0; right: 0; - left: 0; - height: 48px; + top: 0; z-index: 2; - border-bottom: 1px solid @border-color__base; strong { - right: 3px; - left: auto; - top: 10px; - border: 0; - background: none; - .lib-css(box-shadow, none); - color: transparent; - .lib-icon-font( - @icon-remove, - @_icon-font-color: @text__color__muted, - @_icon-font-size: 16px, - @_icon-font-position: after - ); + .lib-css(box-shadow, none); + background: none; + border: 0; + color: transparent; + left: auto; + right: 3px; + top: 10px; + .lib-icon-font( + @icon-remove, + @_icon-font-color: @text__color__muted, + @_icon-font-size: 16px, + @_icon-font-position: after + ); } } .filter-subtitle { + .lib-css(background, @toolbar-background); display: block; + height: 50px; + left: 0; + line-height: 32px; position: fixed; - top: 0; right: 0; - left: 0; - height: 50px; - .lib-css(background, @toolbar-background); + top: 0; z-index: 1; - line-height: 32px; } .filter-options { + .lib-css(background, @color-white); + bottom: 0; display: block; - position: fixed; - top: 50px; left: 0; - right: 0; - bottom: 0; overflow: scroll; - .lib-css(background, @color-white); + position: fixed; + right: 0; + top: 50px; z-index: 10; } } @@ -253,36 +254,23 @@ padding: @indent__xs @indent__s; } } - .filter-no-options { - .filter-title:before { - content: ""; - width: 100px; - height: 40px; - background: rgba(255,255,255,.5); - display: block; - position: relative; - z-index: 99; - margin-top: -40px; - left: -15px; - } - } .filter .filter-current { - margin: @indent__xs -@indent__s 0; border: solid @border-color__base; border-width: 1px 0; + margin: @indent__xs -@indent__s 0; .items { display: none; } &-subtitle { - text-transform: uppercase; position: relative; + text-transform: uppercase; z-index: 1; .lib-icon-font( - @_icon-font-content: @icon-down, - @_icon-font-size: 13px, - @_icon-font-position: before, - @_icon-font-display: block + @_icon-font-content: @icon-down, + @_icon-font-size: 13px, + @_icon-font-position: before, + @_icon-font-display: block ); &:before { position: absolute; @@ -291,17 +279,17 @@ } &:after { + .lib-css(color, @text__color__muted); content:' (' attr(data-count) ')'; font-size:.9em; - .lib-css(color, @text__color__muted); } } &.active { padding-bottom: 30px; .block-subtitle { .lib-icon-font-symbol( - @_icon-font-content: @icon-up, - @_icon-font-position: before + @_icon-font-content: @icon-up, + @_icon-font-position: before ); } .items { @@ -315,6 +303,31 @@ display: none; } } + .filter-no-options { + .filter-title { + &:before { + background: rgba(255,255,255,.5); + content: ''; + display: block; + height: 40px; + left: -15px; + margin-top: -60px; + position: relative; + width: 100px; + z-index: 99; + } + } + .filter-content { + margin-bottom: @indent__base; + } + } + .page-with-filter { + .columns { + .sidebar-main { + .lib-vendor-prefix-order(0); + } + } + } } .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__s) { @@ -336,11 +349,11 @@ } &.active &-options, &-options { + background: transparent; clear: both; - position: static; - overflow: initial; display: block; - background: transparent; + overflow: initial; + position: static; } &-subtitle { position: static; @@ -357,9 +370,9 @@ position: static; } &.page-with-filter .column.main { + padding-top: 45px; position: relative; z-index: 1; - padding-top: 45px; } .filter { &.block { @@ -373,8 +386,8 @@ } &-options { &-item { - display: inline-block; border: 0; + display: inline-block; margin-right: @indent__m; &.active { position: relative; @@ -384,14 +397,14 @@ } &:after, &:before { - content: ""; - display: block; .lib-arrow(up, 8px, @color-black); - position: absolute; - left: 50%; bottom: -1px; + content: ''; + display: block; + left: 50%; + margin-left: -@indent__base; + position: absolute; z-index: 3; - margin-left: -20px; } &:after { .lib-css(border-bottom-color, @color-white); @@ -401,7 +414,7 @@ } } &-title { - padding: 0 20px 0 0; + padding: 0 @indent__base 0 0; &:after { right: 2px; top: 3px; @@ -409,15 +422,16 @@ } } &-content { - position: absolute; - z-index: 2; + @_shadow: 0 3px 5px 0 rgba(50, 50, 50, .75); + .lib-css(background, @color-white); - width: 180px; - top: 100%; + .lib-css(box-shadow, @_shadow, 1); border: 1px solid @border-color__base; padding: @indent__xs 0; - @_shadow: 0 3px 5px 0 rgba(50, 50, 50, .75); - .lib-css(box-shadow, @_shadow, 1); + position: absolute; + top: 100%; + width: 180px; + z-index: 2; .item { padding: @indent__xs; margin:0; @@ -434,13 +448,13 @@ display: inline; line-height: 35px; &-subtitle { - display: inline; - padding: 0; .lib-css(color, @text__color__muted); + display: inline; font-size: @font-size__base; font-weight: normal; + padding: 0; &:after { - content: ":"; + content: ':'; } } .item, diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache.php index be0e3f829e2eb6eb668972e7143aa8e4e4dc35cb..eac82f0b3dcd31f844bc7a3ebeac7b8da1d29526 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Cache.php @@ -68,7 +68,7 @@ class Cache extends Block */ public function isStorageCacheFlushed() { - return $this->getMessagesBlock()->getSuccessMessages() == $this->messagesText['cache_storage_flushed']; + return $this->getMessagesBlock()->getSuccessMessage() == $this->messagesText['cache_storage_flushed']; } /** @@ -78,7 +78,7 @@ class Cache extends Block */ public function isMagentoCacheFlushed() { - return $this->getMessagesBlock()->getSuccessMessages() == $this->messagesText['cache_magento_flushed']; + return $this->getMessagesBlock()->getSuccessMessage() == $this->messagesText['cache_magento_flushed']; } /** diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php index 586f0d9205f9ea6643a7b1e1f6f385260b89064c..8cfce3edc4ca9ac1b4140074b7685cfe1423bf11 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Messages.php @@ -21,6 +21,13 @@ class Messages extends Block */ protected $successMessage = '[data-ui-id$=message-success]'; + /** + * Last success message selector. + * + * @var string + */ + protected $lastSuccessMessage = '[data-ui-id$=message-success]:last-child'; + /** * Message link. * @@ -62,7 +69,7 @@ class Messages extends Block /** * Get all success messages which are present on the page. * - * @return string|array + * @return array */ public function getSuccessMessages() { @@ -74,7 +81,19 @@ class Messages extends Block $messages[] = $element->getText(); } - return count($messages) > 1 ? $messages : $messages[0]; + return $messages; + } + + /** + * Get last success message which is present on the page. + * + * @return string + */ + public function getSuccessMessage() + { + $this->waitForElementVisible($this->successMessage); + + return $this->_rootElement->find($this->lastSuccessMessage)->getText(); } /** @@ -96,11 +115,11 @@ class Messages extends Block } /** - * Get all error messages which are present on the page. + * Get all error message which is present on the page. * * @return string */ - public function getErrorMessages() + public function getErrorMessage() { return $this->_rootElement ->find($this->errorMessage, Locator::SELECTOR_CSS) @@ -108,13 +127,13 @@ class Messages extends Block } /** - * Click on link in the messages which are present on the page. + * Click on link in the message which is present on the page. * * @param string $messageType * @param string $linkText * @return void */ - public function clickLinkInMessages($messageType, $linkText) + public function clickLinkInMessage($messageType, $linkText) { if ($this->isVisibleMessage($messageType)) { $this->_rootElement @@ -162,7 +181,7 @@ class Messages extends Block * * @return string */ - public function getNoticeMessages() + public function getNoticeMessage() { $this->waitForElementVisible($this->noticeMessage); return $this->_rootElement->find($this->noticeMessage)->getText(); @@ -173,7 +192,7 @@ class Messages extends Block * * @return string */ - public function getWarningMessages() + public function getWarningMessage() { $this->waitForElementVisible($this->warningMessage); return $this->_rootElement->find($this->warningMessage)->getText(); 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 65017b9c85d99fec33b811997c6aec9d17848d67..5952f4690c1c996296a65ed64cf505c9b6fede95 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 @@ -189,7 +189,7 @@ abstract class Grid extends Block protected $rowPattern = '//tbody/tr[%s]'; /** - * Selector for confirm. + * Selector for confirm. * * @var string */ diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php index 5492c69ef0b27568f4289cab588a9f8894a5d925..76ab1d8b104c74b5ceee50faf13970c143813cd8 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheIsRefreshableAndInvalidated.php @@ -41,7 +41,7 @@ class AssertCacheIsRefreshableAndInvalidated extends AbstractConstraint \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_MESSAGE, count($items)), - $adminCache->getMessagesBlock()->getSuccessMessages(), + $adminCache->getMessagesBlock()->getSuccessMessage(), 'Cache is Invalid and refreshable.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheManagementAction.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheManagementAction.php index 5ca1e4e677bbf7f3fa1ecf19f25114a19e547a2e..1be33c03244280bc59ebd442bb3fbe501680dd64 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheManagementAction.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertCacheManagementAction.php @@ -25,7 +25,7 @@ class AssertCacheManagementAction extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( $successMessage, - $adminCache->getMessagesBlock()->getSuccessMessages(), + $adminCache->getMessagesBlock()->getSuccessMessage(), 'Action is not successful.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php index 6af0253e217e3f51e47e9a5b4021869037bb00c2..df04b06cb442cce34c174d067fe40ff104591984 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Category/Edit/CategoryForm.php @@ -31,7 +31,7 @@ class CategoryForm extends FormTabs protected $dropdownBlock = '.dropdown'; /** - * Selector for confirm. + * Selector for confirm. * * @var string */ @@ -51,9 +51,9 @@ class CategoryForm extends FormTabs $store = $fixture->getStoreId(); $storeSwitcherBlock = $this->browser->find($this->storeSwitcherBlock); $storeSwitcherBlock->find($this->dropdownBlock, Locator::SELECTOR_CSS, 'liselectstore')->setValue($store); - $element = $this->browser->find($this->confirmModal); + $modalElement = $this->browser->find($this->confirmModal); /** @var \Magento\Ui\Test\Block\Adminhtml\Modal $modal */ - $modal = $this->blockFactory->create('Magento\Ui\Test\Block\Adminhtml\Modal', ['element' => $element]); + $modal = $this->blockFactory->create('Magento\Ui\Test\Block\Adminhtml\Modal', ['element' => $modalElement]); $modal->acceptAlert(); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php index 4dfc6d203b3f945c520bc8fadfff384600d1b20d..7d85ae5b237c01549832c92c601f4ad0a5f2a5f0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/CustomAttribute.php @@ -19,7 +19,7 @@ class CustomAttribute extends SimpleElement * * @var string */ - protected $inputSelector = '.control [data-ui-id][name]'; + protected $inputSelector = '.control [name]:not([type="hidden"]), table'; /** * Attribute class to element type reference. @@ -45,7 +45,9 @@ class CustomAttribute extends SimpleElement $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); $element = $this->getElementByClass($this->getElementClass()); $value = is_array($data) ? $data['value'] : $data; - $this->find($this->inputSelector, Locator::SELECTOR_CSS, $element)->setValue($value); + if ($value !== null) { + $this->find($this->inputSelector, Locator::SELECTOR_CSS, $element)->setValue($value); + } } /** diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php index c7c48a1847c784ab2dc885b98fe3c3640c73549d..4754efe1f1bfcfe93081670cae1605a1a669a28b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/ProductTab.php @@ -9,7 +9,6 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit; use Magento\Mtf\Client\Locator; use Magento\Backend\Test\Block\Widget\Tab; use Magento\Catalog\Test\Block\Adminhtml\Product\Attribute\Edit; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; /** * General class for tabs on product FormTabs with "Add attribute" button. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php index 93e96cf4e28ebcd26cd1029086c5abf846a8fa71..2ecde06b84bc3773ac4572c095c5ef74fe8914e0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/AttributeSet.php @@ -7,6 +7,7 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab\ProductDetails; use Magento\Mtf\Client\Element\SuggestElement; +use Magento\Mtf\Client\Locator; /** * Class AttributeSet @@ -35,6 +36,13 @@ class AttributeSet extends SuggestElement */ protected $loader = '[data-role="loader"]'; + /** + * Page header selector. + * + * @var string + */ + protected $header = 'header'; + /** * Set value * @@ -44,8 +52,27 @@ class AttributeSet extends SuggestElement public function setValue($value) { if ($value !== $this->find($this->actionToggle)->getText()) { + $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); $this->find($this->actionToggle)->click(); - parent::setValue($value); + $this->clear(); + if ($value == '') { + return; + } + foreach (str_split($value) as $symbol) { + $this->keys([$symbol]); + $searchedItem = $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH); + if ($searchedItem->isVisible()) { + try { + $searchedItem->hover(); + $this->driver->find($this->header)->hover(); + $searchedItem->click(); + break; + } catch (\Exception $e) { + // In parallel run on windows change the focus is lost on element + // that causes disappearing of category suggest list. + } + } + } } // Wait loader $element = $this->driver; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php index 7e4608bc008a1acf44807ac3937d283844f24fcc..9fcea9e345614a72f5489684d31a02ec5acd83ad 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/View/CustomOptions.php @@ -30,14 +30,14 @@ class CustomOptions extends Form * * @var string */ - protected $optionElement = '#product-options-wrapper .field'; + protected $optionElement = '#product-options-wrapper > * > .field'; /** * Selector for title of option * * @var string */ - protected $title = 'label'; + protected $title = 'label > span:nth-child(1), legend > span:nth-child(1)'; /** * Selector for required option @@ -381,7 +381,7 @@ class CustomOptions extends Form */ protected function parseOptionText($optionText) { - preg_match('`^(.*?)\+\$(\d.*?)$`', $optionText, $match); + preg_match('`^(.*?) \+ ?\$([\d\.,]*?)$`', $optionText, $match); $optionPrice = isset($match[2]) ? str_replace(',', '', $match[2]) : 0; $optionTitle = isset($match[1]) ? trim($match[1]) : $optionText; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php index c1c55d90030bf7dc120e288ca10ce3acfac3df58..8da7dc6bd271f975b3f50d249971b9d512ef420c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php @@ -28,7 +28,7 @@ class AssertAttributeSetSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CatalogProductSetIndex $productSetIndex) { - $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php index 3a61e2de49606d9dbbd84ea4b540b8981a00cec6..789c2806091c11ff7853baf990a51f60dd3768f4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php @@ -28,7 +28,7 @@ class AssertAttributeSetSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CatalogProductSetIndex $productSetIndex) { - $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php index 454379830cd060168582a3f7067beb2fb5f22137..c983a5afc6e5b3fe9adff454cfacb4e7e4f97d3a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySaveMessage.php @@ -28,7 +28,7 @@ class AssertCategorySaveMessage extends AbstractConstraint */ public function processAssert(CatalogCategoryEdit $catalogCategoryEdit) { - $actualMessage = $catalogCategoryEdit->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $catalogCategoryEdit->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php index bb77a39089fe91bc5cb9394eed042d5017c83e8a..dbc9db525560f2fd294ecd5d81ed39118552770d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php @@ -28,7 +28,7 @@ class AssertCategorySuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CatalogCategoryEdit $categoryEdit) { - $actualMessage = $categoryEdit->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $categoryEdit->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertMassProductUpdateSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertMassProductUpdateSuccessMessage.php index 4aa368dcf71a14752ded095cc80e64ecd5d2b200..04639082d289d1466ebf5196cc699c6b31c76f18 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertMassProductUpdateSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertMassProductUpdateSuccessMessage.php @@ -30,7 +30,7 @@ class AssertMassProductUpdateSuccessMessage extends AbstractConstraint { $countProducts = count($products) ? count($products) : 1; $expectedMessage = sprintf(self::SUCCESS_MESSAGE, $countProducts); - $actualMessage = $productGrid->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $productGrid->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php index 96b39d0d964311cb38903bf3a3a9b52ce33cb5c4..97dab27640a02bffaa38f20ed772f2ba5f582cea 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSaveMessage.php @@ -14,6 +14,9 @@ use Magento\Mtf\Constraint\AbstractConstraint; */ class AssertProductAttributeSaveMessage extends AbstractConstraint { + /** + * Product attribute success save message. + */ const SUCCESS_MESSAGE = 'You saved the product attribute.'; /** @@ -24,12 +27,13 @@ class AssertProductAttributeSaveMessage extends AbstractConstraint */ public function processAssert(CatalogProductAttributeIndex $attributeIndex) { + $actualMessage = $attributeIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $attributeIndex->getMessagesBlock()->getSuccessMessages(), + $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE - . "\nActual: " . $attributeIndex->getMessagesBlock()->getSuccessMessages() + . "\nActual: " . $actualMessage ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php index e41e1b4ab6dd1a5990d28626bb999524a6c87fdc..c911e7f7b574c8b402728a16713114f5a297fe97 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeSuccessDeleteMessage.php @@ -25,12 +25,13 @@ class AssertProductAttributeSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CatalogProductAttributeIndex $attributeIndex) { + $actualMessage = $attributeIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $attributeIndex->getMessagesBlock()->getSuccessMessages(), + $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . self::SUCCESS_MESSAGE - . "\nActual: " . $attributeIndex->getMessagesBlock()->getSuccessMessages() + . "\nActual: " . $actualMessage ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php index 733c8b726597606c1a79be502085fb1eebafe0d7..20f0ee59b380c2afd6935cb68fcdfc2250bd0ff0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php @@ -31,7 +31,7 @@ class AssertProductCompareSuccessAddMessage extends AbstractConstraint public function processAssert(CatalogProductView $catalogProductView, FixtureInterface $product) { $successMessage = sprintf(self::SUCCESS_MESSAGE, $product->getName()); - $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( $successMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php index 9fe455b2f260a7bbf2ec0239f3c92a73b683a51b..bd63bb17bb8c86be4eb840534ca4ac81af59af72 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php @@ -24,7 +24,7 @@ class AssertProductCompareSuccessRemoveAllProductsMessage extends AbstractConstr */ public function processAssert(CatalogProductView $catalogProductView) { - $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php index dfe1e7530b8682a84f6eb3d14a9d317300c52379..64fa8a851e7b869e053e1b580c798d5f19a3526f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveMessage.php @@ -28,7 +28,7 @@ class AssertProductCompareSuccessRemoveMessage extends AbstractConstraint public function processAssert(CatalogProductCompare $catalogProductCompare, FixtureInterface $product) { $successMessage = sprintf(self::SUCCESS_MESSAGE, $product->getName()); - $actualMessage = $catalogProductCompare->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $catalogProductCompare->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals($successMessage, $actualMessage, 'Wrong success message is displayed.'); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php index 4c79e9f1a32629527c440a534c96722e6158acd0..1e034ca00527084dffb2572949f54f51018a5daa 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateMessage.php @@ -28,7 +28,6 @@ class AssertProductDuplicateMessage extends AbstractConstraint public function processAssert(CatalogProductEdit $productPage) { $actualMessages = $productPage->getMessagesBlock()->getSuccessMessages(); - $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages]; \PHPUnit_Framework_Assert::assertContains( self::DUPLICATE_MESSAGE, $actualMessages, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php index 21c5c2353c69563ccb7c4c1613295b0a127a6a20..fa73d7abeba62e53f623df53d784f81ebed65169 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSaveMessage.php @@ -28,7 +28,6 @@ class AssertProductSaveMessage extends AbstractConstraint public function processAssert(CatalogProductEdit $productPage) { $actualMessages = $productPage->getMessagesBlock()->getSuccessMessages(); - $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages]; \PHPUnit_Framework_Assert::assertContains( self::SUCCESS_MESSAGE, $actualMessages, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php index eb40dd8d4450c5281f01127f7f943f9b0c5263c5..17927acc9be86e4bf439a3fa25abfe4efee594b0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSuccessDeleteMessage.php @@ -31,7 +31,7 @@ class AssertProductSuccessDeleteMessage extends AbstractConstraint { $products = is_array($product) ? $product : [$product]; $deleteMessage = sprintf(self::SUCCESS_DELETE_MESSAGE, count($products)); - $actualMessage = $productPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $productPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( $deleteMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php index bfd1c1bd9194ef96a2390bcd258b81a8143a0f1b..ce954986fa22ebc71b36afdcd6cf040e6adaf04e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUsedSuperAttributeImpossibleDeleteMessages.php @@ -30,7 +30,7 @@ class AssertUsedSuperAttributeImpossibleDeleteMessages extends AbstractConstrain { \PHPUnit_Framework_Assert::assertEquals( self::ERROR_DELETE_MESSAGE, - $newPage->getMessagesBlock()->getErrorMessages(), + $newPage->getMessagesBlock()->getErrorMessage(), 'Wrong impossible to delete message is not displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php index 1e9a5690533baef1822206cfdfa4f2d57ce134a5..d41542b0e75ac6b078ffba321f888b3c7865e6b0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomAttribute.php @@ -35,7 +35,12 @@ class CustomAttribute extends DataSource /** @var CatalogProductAttribute $data */ $data = $fixtureFactory->createByCode('catalogProductAttribute', ['dataset' => $data['dataset']]); } - $this->data['value'] = $this->getDefaultAttributeValue($data); + if (is_array($data) && isset($data['value'])) { + $this->data['value'] = $data['value']; + $data = $data['attribute']; + } else { + $this->data['value'] = $this->getDefaultAttributeValue($data); + } $this->data['code'] = $data->hasData('attribute_code') == false ? $this->createAttributeCode($data) : $data->getAttributeCode(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.xml index 7e106eb611f86ddb15c13da1611ed7bbbc64d3f0..2aa04810e18e1a326aeb75c87ff6995f70d97511 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest.xml @@ -21,7 +21,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductComparePage" /> </variation> <variation name="AddCompareProductsTestVariation3"> - <data name="products" xsi:type="string">configurableProduct::default</data> + <data name="products" xsi:type="string">configurableProduct::configurable_with_qty_1</data> <data name="isCustomerLoggedIn" xsi:type="string">Yes</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductCompareItemsLink" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductComparePage" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml index 007e25239d731a8a14631bec029e21a85411bcb3..d58f5e1afefbbfde16f9e47a9f562dfe561ed152 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest.xml @@ -41,6 +41,9 @@ <data name="attribute/data/is_global" xsi:type="string">Global</data> <data name="attribute/data/is_filterable" xsi:type="string">Filterable (with results)</data> <data name="attribute/data/is_filterable_in_search" xsi:type="string">Yes</data> + <data name="assertProduct/data/name" xsi:type="string">Product name</data> + <data name="assertProduct/data/sku" xsi:type="string">product-sku</data> + <data name="assertProduct/data/price" xsi:type="string">25</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterable" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterableInSearch" /> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertProductAttributeIsConfigurable" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml index 0274ac1132fb7e40a0591841020499780d0a51d7..328d270d0c9f0fdb3dea6fad1dcad9e40044fe30 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml @@ -126,6 +126,9 @@ <data name="productAttribute/data/is_visible_on_front" xsi:type="string">Yes</data> <data name="productAttribute/data/used_in_product_listing" xsi:type="string">Yes</data> <data name="productAttribute/data/used_for_sort_by" xsi:type="string">Yes</data> + <data name="assertProduct/data/name" xsi:type="string">Product name</data> + <data name="assertProduct/data/sku" xsi:type="string">product-sku</data> + <data name="assertProduct/data/price" xsi:type="string">25</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> @@ -154,10 +157,10 @@ <data name="productAttribute/data/is_comparable" xsi:type="string">No</data> <data name="productAttribute/data/is_filterable" xsi:type="string">Filterable (with results)</data> <data name="productAttribute/data/is_filterable_in_search" xsi:type="string">Yes</data> + <data name="attributeValue" xsi:type="number">15</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> - <constraint name="Magento\CatalogSearch\Test\Constraint\AssertAttributeSearchableByLabel" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeDisplayingOnSearchForm" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterable" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsFilterableInSearch" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml index f864cc8afa7c47a2b04b9c19e2a7f5470a5b52ce..64961fdd6d4f3a50fbe0db726d29b4a8af1d1ee8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml @@ -18,6 +18,9 @@ <variation name="DeleteAssignedToTemplateProductAttributeTestVariation2"> <data name="attributeSet/dataset" xsi:type="string">default</data> <data name="attributeSet/data/assigned_attributes/dataset" xsi:type="string">attribute_type_text_field</data> + <data name="assertProduct/data/name" xsi:type="string">Product name</data> + <data name="assertProduct/data/sku" xsi:type="string">product-sku</data> + <data name="assertProduct/data/price" xsi:type="string">25</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSuccessDeleteMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInGrid" /> <constraint name="Magento\ConfigurableProduct\Test\Constraint\AssertProductAttributeAbsenceInVariationsSearch" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php index c956fda4cffc3381af93b772fee29737fd676b37..44126f9a153115cf82bb4374a6f78da7ccee93c5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php @@ -62,6 +62,13 @@ class AddAttributeToAttributeSetStep implements TestStepInterface */ protected $catalogProductEdit; + /** + * Custom attribute value to set while product creation. + * + * @var mixed + */ + protected $attributeValue; + /** * @constructor * @param CatalogProductSetIndex $catalogProductSetIndex @@ -71,6 +78,7 @@ class AddAttributeToAttributeSetStep implements TestStepInterface * @param FixtureFactory $fixtureFactory * @param CatalogProductIndex $catalogProductIndex * @param CatalogProductEdit $catalogProductEdit + * @param mixed $attributeValue [optional] */ public function __construct( CatalogProductSetIndex $catalogProductSetIndex, @@ -79,7 +87,8 @@ class AddAttributeToAttributeSetStep implements TestStepInterface CatalogAttributeSet $attributeSet, FixtureFactory $fixtureFactory, CatalogProductIndex $catalogProductIndex, - CatalogProductEdit $catalogProductEdit + CatalogProductEdit $catalogProductEdit, + $attributeValue = null ) { $this->catalogProductSetIndex = $catalogProductSetIndex; $this->catalogProductSetEdit = $catalogProductSetEdit; @@ -88,6 +97,7 @@ class AddAttributeToAttributeSetStep implements TestStepInterface $this->fixtureFactory = $fixtureFactory; $this->catalogProductIndex = $catalogProductIndex; $this->catalogProductEdit = $catalogProductEdit; + $this->attributeValue = $attributeValue; } /** @@ -103,13 +113,17 @@ class AddAttributeToAttributeSetStep implements TestStepInterface $this->catalogProductSetEdit->getPageActions()->save(); // Create product with attribute set mentioned above: + $customAttribute = $this->attribute; + if ($this->attributeValue !== null) { + $customAttribute = ['value' => $this->attributeValue, 'attribute' => $customAttribute]; + } $product = $this->fixtureFactory->createByCode( 'catalogProductSimple', [ 'dataset' => 'product_with_category_with_anchor', 'data' => [ 'attribute_set_id' => ['attribute_set' => $this->attributeSet], - 'custom_attribute' => $this->attribute + 'custom_attribute' => $customAttribute ], ] ); diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php index 889735d7f2eabbe38d02c2ba382023820e2e5d6a..813711e273f3da69b8094cc4eae19b69d85cf782 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php @@ -28,7 +28,7 @@ class AssertCatalogPriceRuleNoticeMessage extends AbstractConstraint public function processAssert( CatalogRuleIndex $pageCatalogRuleIndex ) { - $actualMessage = $pageCatalogRuleIndex->getMessagesBlock()->getNoticeMessages(); + $actualMessage = $pageCatalogRuleIndex->getMessagesBlock()->getNoticeMessage(); \PHPUnit_Framework_Assert::assertEquals( self::NOTICE_MESSAGE_RULES . self::NOTICE_MESSAGE_APPLY, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php index f8531c5540c3ff4acb4dd8bdff33042766153cec..9b0f07e848f450bf61528b61abbc72778ca9a58d 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertCatalogPriceRuleSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CatalogRuleIndex $pageCatalogRuleIndex) { - $actualMessage = $pageCatalogRuleIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $pageCatalogRuleIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php index a1cdb0e31bd9f1ebb4e32b957d011af5dd4224f4..23418a8638b558323ebc8f4c183b9598e933ba0a 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php @@ -25,9 +25,6 @@ class AssertCatalogPriceRuleSuccessSaveMessage extends AbstractConstraint public function processAssert(CatalogRuleIndex $pageCatalogRuleIndex) { $actualMessages = $pageCatalogRuleIndex->getMessagesBlock()->getSuccessMessages(); - if (!is_array($actualMessages)) { - $actualMessages = [$actualMessages]; - } \PHPUnit_Framework_Assert::assertContains( self::SUCCESS_MESSAGE, $actualMessages, diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php index 0177e5d8860f9307eb70b795272d727d3ec36c6b..8531933cebe683d5c1baf866f8eb5a369d274afe 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessDeleteMessage.php @@ -32,11 +32,13 @@ class AssertSearchTermSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CatalogSearchIndex $indexPage) { - $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, 'Wrong success message is displayed.' + . "\nExpected: " . self::SUCCESS_DELETE_MESSAGE + . "\nActual: " . $actualMessage ); } diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php index 4a6a3623910a4d6edb8dbbac672d8ed230ef5f2c..425c019d942ecda02f9152cb924b06ef779e981f 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessMassDeleteMessage.php @@ -28,12 +28,14 @@ class AssertSearchTermSuccessMassDeleteMessage extends AbstractConstraint */ public function processAssert(array $searchTerms, CatalogSearchIndex $indexPage) { - $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessages(); - $successMessages = sprintf(self::SUCCESS_MESSAGE, count($searchTerms)); + $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessage(); + $expectedMessage = sprintf(self::SUCCESS_MESSAGE, count($searchTerms)); \PHPUnit_Framework_Assert::assertEquals( - $successMessages, + $expectedMessage, $actualMessage, 'Wrong success message is displayed.' + . "\nExpected: " . $expectedMessage + . "\nActual: " . $actualMessage ); } diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php index d80a6eab3d89d3f5164f81f97b6477f58637cc1b..7316f846b6cb67d5abe8de3e86c4f099845af5f1 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php @@ -28,7 +28,7 @@ class AssertSearchTermSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CatalogSearchIndex $indexPage) { - $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $indexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar/Item.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar/Item.php index 43dbd23499a0d866f2fdf999c086716d20d79a4d..f49a19118ed2526cd7e4ec9666523bc5a5f8cf46 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar/Item.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Sidebar/Item.php @@ -47,6 +47,7 @@ class Item extends Sidebar /** @var \Magento\Ui\Test\Block\Adminhtml\Modal $modal */ $modal = $this->blockFactory->create('Magento\Ui\Test\Block\Adminhtml\Modal', ['element' => $element]); $modal->acceptAlert(); + $modal->waitModalWindowToDisappear(); } /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php index af0f03c0247ee993f1d54f7ac3a4addcc2157507..80f275de861285aa1760d6a6c56760b0da46d187 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertAddedProductToCartSuccessMessage.php @@ -32,7 +32,7 @@ class AssertAddedProductToCartSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $checkoutCart->getMessagesBlock()->getSuccessMessages() + $checkoutCart->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php index eb57e0ac4719d8257841954818bc18de7ad62d78..f3b0e8cbae186de1952c854463d71ea8ac28912d 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessDeleteMessage.php @@ -30,7 +30,7 @@ class AssertTermSuccessDeleteMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, - $agreementIndex->getMessagesBlock()->getSuccessMessages(), + $agreementIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success delete message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php index ba715ffa968962e59c6d8a4866341dd14fb1226a..c55619144c7033dd5d59d11b6be6acc2ec0fd9c8 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermSuccessSaveMessage.php @@ -30,7 +30,7 @@ class AssertTermSuccessSaveMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_SAVE_MESSAGE, - $agreementIndex->getMessagesBlock()->getSuccessMessages(), + $agreementIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php index 965b7fe07cc7b0eabce9f99a47f54cca093bcdd9..edd10f3fe5086cc71f6098128dc4e7542fb17362 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockDeleteMessage.php @@ -24,7 +24,7 @@ class AssertCmsBlockDeleteMessage extends AbstractConstraint */ public function processAssert(CmsBlockIndex $cmsBlockIndex) { - $actualMessage = $cmsBlockIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $cmsBlockIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php index 1c2696d6ed3c527b3d1cb0addc79095bf025342e..374c9b98527b49f02235f1f2735f53885499c0b5 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertCmsBlockSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CmsBlockIndex $cmsBlockIndex) { - $actualMessage = $cmsBlockIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $cmsBlockIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_SAVE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php index ff01fa41f99e1990308af033ed5ba5b4c94d5ae9..7139477fb9703e264b094d8aa8b065df77f50bcd 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php @@ -24,7 +24,7 @@ class AssertCmsPageDeleteMessage extends AbstractConstraint */ public function processAssert(CmsPageIndex $cmsIndex) { - $actualMessage = $cmsIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $cmsIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php index 97e5247f658a8ce1d47dd5fdd62aaffb5b14ad9c..bd0af6ef0a3a2f029d09298acd64e1090a508f0c 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDuplicateErrorMessage.php @@ -24,7 +24,7 @@ class AssertCmsPageDuplicateErrorMessage extends AbstractConstraint */ public function processAssert(CmsPageIndex $cmsIndex) { - $message = $cmsIndex->getMessagesBlock()->getErrorMessages(); + $message = $cmsIndex->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_SAVE_MESSAGE, $message, diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php index c57528db3735163ef8a94fdf34e6370ddaf8426b..957ec384c4325ab368452c357adffa37ffaadde8 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertCmsPageSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CmsPageIndex $cmsIndex) { - $actualMessage = $cmsIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $cmsIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_SAVE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index 846c920cd94396e9334c550295e5506257157133..ec16f30dfc1d2344bebc302d5ec4eb178ddc855a 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -98,7 +98,7 @@ class Config extends Tab foreach ($attributesValue as $key => $value) { $attributesValue[$key] = array_merge($value, $attributes['attributes_data'][$key]); } - $this->_rootElement->find($this->createConfigurationsButton)->click(); + $this->createConfigurations(); $this->getAttributeBlock()->fillAttributes($attributesValue); if (!empty($attributes['matrix'])) { $this->generateVariations(); @@ -122,6 +122,16 @@ class Config extends Tab } } + /** + * Click 'Create Configurations' button. + * + * @return void + */ + public function createConfigurations() + { + $this->_rootElement->find($this->createConfigurationsButton)->click(); + } + /** * Generate variations. * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php index be8653668f1d5b4e9acda2c83d357a73b8d5e762..e12f036a49ba2848728bc4c03bdbf84cd90e3bd3 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php @@ -181,7 +181,7 @@ class Attribute extends Form /** * @return \Magento\Ui\Test\Block\Adminhtml\DataGrid */ - protected function getAttributesGrid() + public function getAttributesGrid() { return $this->blockFactory->create( 'Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\AttributesGrid', diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php index 4d2bf2cb8268168557df928f63a3cb0b8cde12c8..e41ef61382f754f87f1f142616f2d5974cd0d540 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute/AttributeSelector.php @@ -7,7 +7,6 @@ namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config\Attribute; use Magento\Mtf\Client\Element\SuggestElement; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; /** * Form Attribute Search on Product page. @@ -32,15 +31,4 @@ class AttributeSelector extends SuggestElement // that causes disappearing of result suggest list. } } - - /** - * Checking exist configurable attribute in search result. - * - * @param CatalogProductAttribute $productAttribute - * @return bool - */ - public function isExistAttributeInSearchResult(CatalogProductAttribute $productAttribute) - { - return $this->isExistValueInSearchResult($productAttribute->getFrontendLabel()); - } } diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php index 192296493baa48c69b110759e7ed7837f91cead8..e2adc6353c3157e4cc0c94c9e2861764bd4d0a72 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeAbsenceInVariationsSearch.php @@ -11,29 +11,31 @@ use Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Conf use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertProductAttributeAbsenceInVariationsSearch - * Check that deleted attribute can't be added to attribute set on Product Page via Add Attribute control + * Check that deleted attribute can't be added to attribute set on Product Page via Add Attribute control. */ class AssertProductAttributeAbsenceInVariationsSearch extends AbstractConstraint { /** - * Label "Variations" tab + * Label "Variations" tab. */ const TAB_VARIATIONS = 'variations'; /** - * Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control + * Assert that deleted attribute can't be added to attribute set on Product Page via Add Attribute control. * * @param CatalogProductAttribute $productAttribute + * @param ConfigurableProduct $assertProduct * @param CatalogProductIndex $productGrid * @param CatalogProductNew $newProductPage * @return void */ public function processAssert( CatalogProductAttribute $productAttribute, + ConfigurableProduct $assertProduct, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage ) { @@ -41,18 +43,19 @@ class AssertProductAttributeAbsenceInVariationsSearch extends AbstractConstraint $productGrid->getGridPageActionBlock()->addProduct('simple'); /** @var VariationsTab $variationsTab */ + $newProductPage->getProductForm()->fill($assertProduct); $variationsTab = $newProductPage->getProductForm()->getTab(self::TAB_VARIATIONS); $variationsTab->showContent(); - /** @var AttributeBlock $attributesBlock */ - $attributesBlock = $variationsTab->getAttributeBlock(); + $variationsTab->createConfigurations(); + $attributesGrid = $variationsTab->getAttributeBlock()->getAttributesGrid(); \PHPUnit_Framework_Assert::assertFalse( - $attributesBlock->getAttributeSelector()->isExistAttributeInSearchResult($productAttribute), + $attributesGrid->isRowVisible(['frontend_label' => $productAttribute->getFrontendLabel()]), "Product attribute found in Attribute Search form." ); } /** - * Text absent Product Attribute in Attribute Search form + * Text absent Product Attribute in Attribute Search form. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php index e088a33cf703d48927bed5a0bcb4ca8597713438..2c9d735450f50f9070d96233a2e35acafe70abae 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertProductAttributeIsConfigurable.php @@ -10,6 +10,7 @@ use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; use Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config as TabVariation; +use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct; use Magento\Mtf\Constraint\AbstractConstraint; /** @@ -21,23 +22,27 @@ class AssertProductAttributeIsConfigurable extends AbstractConstraint * Assert check whether the attribute is used to create a configurable products. * * @param CatalogProductAttribute $attribute + * @param ConfigurableProduct $assertProduct * @param CatalogProductIndex $productGrid * @param CatalogProductNew $newProductPage */ public function processAssert( CatalogProductAttribute $attribute, + ConfigurableProduct $assertProduct, CatalogProductIndex $productGrid, CatalogProductNew $newProductPage ) { $productGrid->open(); $productGrid->getGridPageActionBlock()->addProduct('configurable'); $productBlockForm = $newProductPage->getProductForm(); + $productBlockForm->fill($assertProduct); $productBlockForm->openTab('variations'); - /** @var TabVariation $tabVariation */ - $tabVariation = $productBlockForm->getTab('variations'); - $configurableAttributeSelector = $tabVariation->getAttributeBlock()->getAttributeSelector(); + /** @var \Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Tab\Super\Config $variationsTab */ + $variationsTab = $productBlockForm->getTab('variations'); + $variationsTab->createConfigurations(); + $attributesGrid = $variationsTab->getAttributeBlock()->getAttributesGrid(); \PHPUnit_Framework_Assert::assertTrue( - $configurableAttributeSelector->isExistAttributeInSearchResult($attribute), + $attributesGrid->isRowVisible(['frontend_label' => $attribute->getFrontendLabel()]), "Product attribute is absent on the product page." ); } diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php index 912106f71bb7542d0f0ffb5339e73657b65d23f2..113e4774672ea446a80443a923e4ed79f42698bc 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php @@ -25,7 +25,7 @@ class AssertCurrencySymbolSuccessSaveMessage extends AbstractConstraint */ public function processAssert(SystemCurrencySymbolIndex $currencySymbolIndex) { - $actualMessage = $currencySymbolIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $currencySymbolIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_SAVE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/CustomerGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/CustomerGrid.php index c82af6b00edfd7d847fc37ce5be745a4f7e4b243..93b3d1b7c16b73921e70c0ed31ad61e769b9544f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/CustomerGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/CustomerGrid.php @@ -39,10 +39,10 @@ class CustomerGrid extends DataGrid 'input' => 'select', ], 'entity_id_from' => [ - 'selector' => '[name="filters[entity_id][from]"]', + 'selector' => '[name="entity_id[from]"]', ], 'entity_id_to' => [ - 'selector' => '[name="filters[entity_id][to]"]', + 'selector' => '[name="entity_id[to]"]', ], ]; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php index 48c58b1c316d96ceedc389c57252ce684f91e05a..cfe0d1f61cdddd23f3098dd98bee261a8d23130c 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertChangePasswordFailMessage.php @@ -30,7 +30,7 @@ class AssertChangePasswordFailMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::FAIL_MESSAGE, - $customerAccountEdit->getMessages()->getErrorMessages() + $customerAccountEdit->getMessages()->getErrorMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php index 9dbf30c353e9d1fde84b182da0a63f35123390b7..195f0df3ca3f628f4930e199b4ca04a86d2db969 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerAddressSuccessSaveMessage.php @@ -28,7 +28,7 @@ class AssertCustomerAddressSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CustomerAccountIndex $customerAccountIndex) { - $successMessage = $customerAccountIndex->getMessages()->getSuccessMessages(); + $successMessage = $customerAccountIndex->getMessages()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $successMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php index 27394f8e074ecc7fc0238a58285d8d4ed364fd16..f17dbafe7e21948bc48fa552780c794b0b54319a 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerBackendDuplicateErrorMessage.php @@ -27,7 +27,7 @@ class AssertCustomerBackendDuplicateErrorMessage extends AbstractConstraint */ public function processAssert(CustomerIndex $customerIndexPage) { - $actualMessage = $customerIndexPage->getMessagesBlock()->getErrorMessages(); + $actualMessage = $customerIndexPage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_SAVE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php index 2cb983b4bbc3a8b7a33b1acce819b91f35bf9fef..a37e68ed7f12f893060514bb9f2e0e6e4363f87a 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php @@ -22,7 +22,7 @@ class AssertCustomerFailRegisterMessage extends AbstractConstraint */ public function processAssert(CustomerAccountCreate $registerPage) { - $errorMessage = $registerPage->getMessagesBlock()->getErrorMessages(); + $errorMessage = $registerPage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertNotEmpty( $errorMessage, 'No error message is displayed.' diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForgotPasswordSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForgotPasswordSuccessMessage.php index 318b5e531a92e1ac37715a2e724bdac4f3277e78..c06a121ff20e3a051148efdfad3dcd347b25a0df 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForgotPasswordSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForgotPasswordSuccessMessage.php @@ -29,14 +29,9 @@ class AssertCustomerForgotPasswordSuccessMessage extends AbstractConstraint CustomerAccountLogin $customerLogin, Customer $customer ) { - $message = sprintf( - self::SUCCESS_MESSAGE, - $customer->getEmail() - ); - \PHPUnit_Framework_Assert::assertEquals( - $message, - $customerLogin->getMessages()->getSuccessMessages(), + sprintf(self::SUCCESS_MESSAGE, $customer->getEmail()), + $customerLogin->getMessages()->getSuccessMessage(), 'Wrong forgot password message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php index 6796c9aa0874f79897c424739b68817eed3595d5..50982fc8a6aa9c1d5d5ff41583972443127688fd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php @@ -24,7 +24,7 @@ class AssertCustomerGroupAlreadyExists extends AbstractConstraint */ public function processAssert(CustomerGroupNew $customerGroupNew) { - $actualMessage = $customerGroupNew->getMessagesBlock()->getErrorMessages(); + $actualMessage = $customerGroupNew->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php index 81b3fc72b63d9cfdfaf3cbc15b50a6f8e3a40f97..8173d3cde87760debb60da3e9f866850f8e7785c 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessDeleteMessage.php @@ -24,12 +24,13 @@ class AssertCustomerGroupSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CustomerGroupIndex $customerGroupIndex) { + $actualMessage = $customerGroupIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, - $customerGroupIndex->getMessagesBlock()->getSuccessMessages(), + $actualMessage, 'Wrong message is displayed.' . "\nExpected: " . self::SUCCESS_DELETE_MESSAGE - . "\nActual: " . $customerGroupIndex->getMessagesBlock()->getSuccessMessages() + . "\nActual: " . $actualMessage ); } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php index 9069acfce812b0c2bd116eb486d1a0faa36b312f..6ae95ea7f4d7ace5f8e3817ce3c6d9620df7ac7f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertCustomerGroupSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CustomerGroupIndex $customerGroupIndex) { - $actualMessage = $customerGroupIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $customerGroupIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php index 6396afca4ba5dc0faa10e3f0bd6987d3baed04cd..6a8d9c06ee2bef2d885867c8d20312b4539fa397 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php @@ -28,7 +28,7 @@ class AssertCustomerInfoSuccessSavedMessage extends AbstractConstraint */ public function processAssert(CustomerAccountIndex $customerAccountIndex) { - $successMessage = $customerAccountIndex->getMessages()->getSuccessMessages(); + $successMessage = $customerAccountIndex->getMessages()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $successMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php index 37ad42ad921973e40c74b4549abf3923c876b6c7..922310e227e2cc99199bc056b2091ad8a593d38b 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInvalidEmail.php @@ -29,7 +29,7 @@ class AssertCustomerInvalidEmail extends AbstractConstraint public function processAssert(Customer $customer, CustomerIndexNew $pageCustomerIndexNew) { $expectMessage = str_replace('%email%', $customer->getEmail(), self::ERROR_EMAIL_MESSAGE); - $actualMessage = $pageCustomerIndexNew->getMessagesBlock()->getErrorMessages(); + $actualMessage = $pageCustomerIndexNew->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php index c18c312e8855b412a9b97a9b724cd460ddc5aaed..3ac60cd83f990978dc131f01dae0a955d3843d51 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteSuccessMessage.php @@ -31,7 +31,7 @@ class AssertCustomerMassDeleteSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_DELETE_MESSAGE, $customersQtyToDelete), - $customerIndexPage->getMessagesBlock()->getSuccessMessages(), + $customerIndexPage->getMessagesBlock()->getSuccessMessage(), 'Wrong delete message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php index 632ab54f8f34e12617258325ffe2cca6bd08d478..36474ed8b9a1ae6c0721a5b911d429183f5fc6fd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertCustomerSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(CustomerIndex $customerIndexPage) { - $actualMessage = $customerIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $customerIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php index bf70b9806347fbe9f410a2dba27ce1d283114b2f..7d6cc8d277861bf87b75b8009707228941cf4db2 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php @@ -24,7 +24,7 @@ class AssertCustomerSuccessRegisterMessage extends AbstractConstraint */ public function processAssert(CustomerAccountCreate $registerPage) { - $actualMessage = $registerPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $registerPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php index 47e8faddaf56033fe026bbf131bc95de8a3e40fc..ca217f7a63e47a421ff0598b95f3ba59dcbfc493 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php @@ -25,7 +25,7 @@ class AssertCustomerSuccessSaveMessage extends AbstractConstraint */ public function processAssert(CustomerIndex $pageCustomerIndex) { - $actualMessage = $pageCustomerIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $pageCustomerIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php index 1d14f0995f6dd5a409bb5968facd1a5534bc2f6e..8b3c727bd0e94a018c6642ec688da37877720442 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertMassActionSuccessUpdateMessage.php @@ -35,9 +35,8 @@ class AssertMassActionSuccessUpdateMessage extends AbstractConstraint public function processAssert($customer, CustomerIndex $pageCustomerIndex) { $customers = is_array($customer) ? $customer : [$customer]; - $customerCount = count($customers); - $actualMessage = $pageCustomerIndex->getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertEquals(sprintf(self::UPDATE_MESSAGE, $customerCount), $actualMessage); + $actualMessage = $pageCustomerIndex->getMessagesBlock()->getSuccessMessage(); + \PHPUnit_Framework_Assert::assertEquals(sprintf(self::UPDATE_MESSAGE, count($customers)), $actualMessage); } /** diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.xml index 7dfacbc495c1259f286bfca6677d7339e280503a..d491bb75ab488143e45e401d04b970f631e4d37a 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/Adminhtml/CustomerIndexEdit.xml @@ -7,11 +7,11 @@ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> <page name="CustomerIndexEdit" area="Adminhtml" mca="customer/index/edit" module="Magento_Customer"> - <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper .page-title" strategy="css selector"/> - <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/> - <block name="pageActionsBlock" class="Magento\Customer\Test\Block\Adminhtml\Edit\FormPageActions" locator=".page-main-actions" strategy="css selector"/> - <block name="customerForm" class="Magento\Customer\Test\Block\Adminhtml\Edit\CustomerForm" locator="[id='page:main-container']" strategy="css selector"/> - <block name="configureProductBlock" class="Magento\Catalog\Test\Block\Adminhtml\Product\Composite\Configure" locator="//*[@role='dialog' and ./*[@id='product_composite_configure'] and contains(@style,'display: block')]" strategy="xpath"/> - <block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal]" strategy="css selector"/> + <block name="titleBlock" class="Magento\Theme\Test\Block\Html\Title" locator=".page-title-wrapper .page-title" strategy="css selector" /> + <block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector" /> + <block name="pageActionsBlock" class="Magento\Customer\Test\Block\Adminhtml\Edit\FormPageActions" locator=".page-main-actions" strategy="css selector" /> + <block name="customerForm" class="Magento\Customer\Test\Block\Adminhtml\Edit\CustomerForm" locator="[id='page:main-container']" strategy="css selector" /> + <block name="configureProductBlock" class="Magento\Catalog\Test\Block\Adminhtml\Product\Composite\Configure" locator="[data-role='modal']._show" strategy="css selector" /> + <block name="modalBlock" class="Magento\Ui\Test\Block\Adminhtml\Modal" locator="._show[data-role=modal]" strategy="css selector" /> </page> </config> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php index d253c87f9ffad16877f91c2d79bc3127ab7112d8..fa144a9b396ebd58d5dd16d8d1246d547cc30f64 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassAssignCustomerGroupTest.php @@ -91,7 +91,8 @@ class MassAssignCustomerGroupTest extends Injectable $this->customerIndex->open(); $this->customerIndex->getCustomerGridBlock()->massaction( [['email' => $customer->getEmail()]], - [$this->customersGridActions => $customerGroup->getCustomerGroupCode()] + [$this->customersGridActions => $customerGroup->getCustomerGroupCode()], + true ); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php index 1bb9544c621d6a0a1591fe8edd7e186776e4b462..95684cb07b8761464ca50aec34f25aa341fbade6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.php @@ -13,15 +13,16 @@ use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for UpdateCustomerBackendEntity + * Precondition: + * 1. Create customer. * - * General Flow: - * 1. Login to backend as admin - * 2. Navigate to CUSTOMERS->All Customers - * 3. Open from grid test customer - * 4. Edit some values, if addresses fields are not presented click 'Add New Address' button - * 5. Click 'Save' button - * 6. Perform all assertions + * Steps: + * 1. Login to backend as admin. + * 2. Navigate to CUSTOMERS->All Customers. + * 3. Open from grid test customer. + * 4. Edit some values, if addresses fields are not presented click 'Add New Address' button. + * 5. Click 'Save' button. + * 6. Perform all assertions. * * @ZephyrId MAGETWO-23881 */ @@ -33,18 +34,25 @@ class UpdateCustomerBackendEntityTest extends Injectable /* end tags */ /** + * Customer grid page. + * * @var CustomerIndex */ protected $customerIndexPage; /** + * Customer edit page. + * * @var CustomerIndexEdit */ protected $customerIndexEditPage; /** + * Inject pages. + * * @param CustomerIndex $customerIndexPage * @param CustomerIndexEdit $customerIndexEditPage + * @return void */ public function __inject( CustomerIndex $customerIndexPage, @@ -55,19 +63,19 @@ class UpdateCustomerBackendEntityTest extends Injectable } /** + * Run update customer test. + * * @param Customer $initialCustomer * @param Customer $customer - * @param Address $address + * @param Address $address [optional] + * @return void */ public function testUpdateCustomerBackendEntity( Customer $initialCustomer, Customer $customer, - Address $address + Address $address = null ) { - // Prepare data - $address = $address->hasData() ? $address : null; - - // Preconditions: + // Precondition $initialCustomer->persist(); // Steps diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml index afe288811e96d22ab5a8aea245054f54154d0b6e..0193f9cb8fa9f5aed64cf77921d61a11168941d5 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest.xml @@ -19,37 +19,13 @@ <data name="customer/data/dob" xsi:type="string">01/08/1986</data> <data name="customer/data/taxvat" xsi:type="string">123456789001</data> <data name="customer/data/gender" xsi:type="string">Male</data> - <data name="address/data/prefix" xsi:type="string">-</data> - <data name="address/data/firstname" xsi:type="string">-</data> - <data name="address/data/middlename" xsi:type="string">-</data> - <data name="address/data/lastname" xsi:type="string">-</data> - <data name="address/data/suffix" xsi:type="string">-</data> - <data name="address/data/company" xsi:type="string">-</data> - <data name="address/data/street" xsi:type="string">-</data> - <data name="address/data/city" xsi:type="string">-</data> - <data name="address/data/country_id" xsi:type="string">-</data> - <data name="address/data/region_id" xsi:type="string">-</data> - <data name="address/data/region" xsi:type="string">-</data> - <data name="address/data/postcode" xsi:type="string">-</data> - <data name="address/data/telephone" xsi:type="string">-</data> - <data name="address/data/fax" xsi:type="string">-</data> - <data name="address/data/vat_id" xsi:type="string">-</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForm" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerInGrid" /> </variation> <variation name="UpdateCustomerBackendEntityTestVariation2"> <data name="initialCustomer/dataset" xsi:type="string">default</data> - <data name="customer/data/group_id/dataset" xsi:type="string">-</data> - <data name="customer/data/prefix" xsi:type="string">-</data> - <data name="customer/data/firstname" xsi:type="string">-</data> - <data name="customer/data/middlename" xsi:type="string">-</data> - <data name="customer/data/lastname" xsi:type="string">-</data> - <data name="customer/data/suffix" xsi:type="string">-</data> <data name="customer/data/email" xsi:type="string">-</data> - <data name="customer/data/dob" xsi:type="string">-</data> - <data name="customer/data/taxvat" xsi:type="string">-</data> - <data name="customer/data/gender" xsi:type="string">-</data> <data name="address/data/prefix" xsi:type="string">Prefix%isolation%_</data> <data name="address/data/firstname" xsi:type="string">Doe%isolation%</data> <data name="address/data/middlename" xsi:type="string">Middle Name %isolation%</data> @@ -60,10 +36,8 @@ <data name="address/data/city" xsi:type="string">Dothan</data> <data name="address/data/country_id" xsi:type="string">United States</data> <data name="address/data/region_id" xsi:type="string">Alabama</data> - <data name="address/data/region" xsi:type="string">-</data> <data name="address/data/postcode" xsi:type="string">36303</data> <data name="address/data/telephone" xsi:type="string">334-200-4060</data> - <data name="address/data/fax" xsi:type="string">555-666-777-8910</data> <data name="address/data/vat_id" xsi:type="string">U1234567890</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForm" /> @@ -90,11 +64,9 @@ <data name="address/data/street" xsi:type="string">39 Northgate Street</data> <data name="address/data/city" xsi:type="string">BICKTON</data> <data name="address/data/country_id" xsi:type="string">United Kingdom</data> - <data name="address/data/region_id" xsi:type="string">-</data> <data name="address/data/region" xsi:type="string">PINMINNOCH</data> <data name="address/data/postcode" xsi:type="string">KA26 1PF</data> <data name="address/data/telephone" xsi:type="string">999-777-111-2345</data> - <data name="address/data/fax" xsi:type="string">-</data> <data name="address/data/vat_id" xsi:type="string">987654321</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerForm" /> diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.xml index 8d70104f70ab7b6fbe4dc11a009750e9e6498090..9398ab7ae74257ca7fc32ada8079b06dd2ae85aa 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.xml @@ -19,9 +19,7 @@ <data name="address/data/city" xsi:type="string">City %isolation%</data> <data name="address/data/country_id" xsi:type="string">United States</data> <data name="address/data/region_id" xsi:type="string">Colorado</data> - <data name="address/data/region" xsi:type="string">-</data> <data name="address/data/telephone" xsi:type="string">555-888-111-999</data> - <data name="address/data/fax" xsi:type="string">161-999-8888</data> <data name="address/data/postcode" xsi:type="string">12345</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerAddressSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerDefaultAddresses" /> @@ -37,10 +35,8 @@ <data name="address/data/street" xsi:type="string">Some street %isolation%</data> <data name="address/data/city" xsi:type="string">City %isolation%</data> <data name="address/data/country_id" xsi:type="string">United Kingdom</data> - <data name="address/data/region_id" xsi:type="string">-</data> <data name="address/data/region" xsi:type="string">Region %isolation%</data> <data name="address/data/telephone" xsi:type="string">0123456789-02134567</data> - <data name="address/data/fax" xsi:type="string">5555-874-99634</data> <data name="address/data/postcode" xsi:type="string">12345</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerAddressSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerDefaultAddresses" /> @@ -57,9 +53,7 @@ <data name="address/data/city" xsi:type="string">Quintin</data> <data name="address/data/country_id" xsi:type="string">France</data> <data name="address/data/region_id" xsi:type="string">Côtes-d'Armor</data> - <data name="address/data/region" xsi:type="string">-</data> <data name="address/data/telephone" xsi:type="string">555-888-111-999</data> - <data name="address/data/fax" xsi:type="string">161-999-8888</data> <data name="address/data/postcode" xsi:type="string">12345</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerAddressSuccessSaveMessage" /> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerDefaultAddresses" /> @@ -75,9 +69,7 @@ <data name="address/data/city" xsi:type="string">Culver City</data> <data name="address/data/country_id" xsi:type="string">United States</data> <data name="address/data/region_id" xsi:type="string">California</data> - <data name="address/data/region" xsi:type="string">-</data> <data name="address/data/telephone" xsi:type="string">555-55-555-55</data> - <data name="address/data/fax" xsi:type="string">-</data> <data name="address/data/postcode" xsi:type="string">90230</data> <data name="tag" xsi:type="string">test_type:acceptance_test</data> <constraint name="Magento\Customer\Test\Constraint\AssertCustomerAddressSuccessSaveMessage" /> diff --git a/dev/tests/functional/tests/app/Magento/Directory/Test/Constraint/AssertCurrencyRateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Directory/Test/Constraint/AssertCurrencyRateSuccessSaveMessage.php index 3a9f7e82a3943e73ece72d72fbefb3bc2e720ca5..2ce8cb0878d660a9433f756c52e02432a5495215 100644 --- a/dev/tests/functional/tests/app/Magento/Directory/Test/Constraint/AssertCurrencyRateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Directory/Test/Constraint/AssertCurrencyRateSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertCurrencyRateSuccessSaveMessage extends AbstractConstraint */ public function processAssert(SystemCurrencyIndex $currencyIndexPage) { - $actualMessage = $currencyIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $currencyIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml index 1924503587941faaae969c94b103b69fb2eb541a..57aef81a070fa60cd4ba149a3d16509a29e09698 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Block/Adminhtml/Product/ProductForm.xml @@ -8,7 +8,7 @@ <tabs> <downloadable_information> <class>\Magento\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable</class> - <selector>#product_info_tabs_downloadable_items</selector> + <selector>#product_info_tabs_product-details</selector> <strategy>css selector</strategy> </downloadable_information> </tabs> diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php index 20dd5579d0e28a11fb03d5f80fffd6a078c9e0d1..7fd9a4523240ac00dc671189ce795593fa8823b6 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable.php @@ -66,6 +66,7 @@ abstract class AbstractAssertTaxRuleIsAppliedToAllPricesDownloadable extends Abs $actualPrices = $this->getProductPagePrices($actualPrices); $catalogProductView->getViewBlock()->clickAddToCart(); $catalogProductView->getMessagesBlock()->waitSuccessMessage(); + $checkoutCart->open(); $actualPrices = $this->getCartPrices($product, $actualPrices); $actualPrices = $this->getTotals($actualPrices); //Prices verification diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View.php index fd8184a473a931c9b2504de28c5226000842ffd9..b17f829fac64ae116a64996321b7ac980f8f1e51 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Catalog/Product/View.php @@ -81,8 +81,7 @@ class View extends ParentView */ public function getOptions(FixtureInterface $product) { - $groupedOptions = $this->getGroupedProductBlock()->getOptions($product); - return ['grouped_options' => $groupedOptions] + parent::getOptions($product); + return ['grouped_options' => $this->getGroupedProductBlock()->getOptions($product)]; } /** diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php index 9c25994a869647e89195d2c271c6adb4839318b7..2436c28e37cebc723b9d5b2fcb70b9ec26636ac6 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/ResourcesPopup.php @@ -23,7 +23,7 @@ class ResourcesPopup extends Form * * @var string */ - protected $allowButtonSelector = '[data-row-dialog="tokens"][role="button"]'; + protected $allowButtonSelector = '[data-row-dialog="tokens"][type="button"]'; /** * Selector for "Reauthorize" button. diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php index e7307befb7482bb4d7774ddc5857989d9731aadc..2fecf03fc4db9effda32c84e59d5b4f0e8c02a1c 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Block/Adminhtml/Integration/IntegrationGrid/TokensPopup.php @@ -18,7 +18,7 @@ class TokensPopup extends Form * * @var string */ - protected $doneButtonSelector = '.action-primary[role="button"]'; + protected $doneButtonSelector = '.action-primary[type="button"]'; /** * Click Done button on Integration tokens popup window. diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNameDuplicationErrorMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNameDuplicationErrorMessage.php index 99613bf462381746c8b9d377ae059439d3c30d60..c3d21a5f0a421ff473cb7633b0ba0f6d271d8186 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNameDuplicationErrorMessage.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNameDuplicationErrorMessage.php @@ -29,7 +29,7 @@ class AssertIntegrationNameDuplicationErrorMessage extends AbstractConstraint Integration $integration ) { $expectedMessage = sprintf(self::ERROR_DUPLICATE_INTEGRATION_NAME, $integration->getName()); - $actualMessage = $integrationIndexPage->getMessagesBlock()->getErrorMessages(); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php index ea11e6add5dcbc136dce6349d672232ee044bf1f..f4df100da9484332661344bfb24a1e64af984e43 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessActivationMessage.php @@ -30,7 +30,7 @@ class AssertIntegrationSuccessActivationMessage extends AbstractConstraint Integration $integration ) { $expectedMessage = sprintf(self::SUCCESS_ACTIVATION_MESSAGE, $integration->getName()); - $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php index 65bc5bb66afabcfe808f4c5d400332055af1fbed..8cefafe433dccb6695dbd0cebf08bfa2b0a25002 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessDeleteMessage.php @@ -28,7 +28,7 @@ class AssertIntegrationSuccessDeleteMessage extends AbstractConstraint public function processAssert(IntegrationIndex $integrationIndexPage, Integration $integration) { $expectedMessage = sprintf(self::SUCCESS_DELETE_MESSAGE, $integration->getName()); - $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php index 485acdb7c321f81dd3f11af50947daa65b495731..71960784c17d593ac6b0666affe598b1eea57c1f 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessReauthorizeMessage.php @@ -34,7 +34,7 @@ class AssertIntegrationSuccessReauthorizeMessage extends AbstractConstraint ) { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_REAUTHORIZE_MESSAGE, $integration->getName()), - $integrationIndexPage->getMessagesBlock()->getSuccessMessages(), + $integrationIndexPage->getMessagesBlock()->getSuccessMessage(), "Wrong success message is displayed." ); } diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php index 02563ed4cc2db74013b04f758bf95adf939b65a8..ca55d860c72267072ce6fbac8f6bd427ae14f9ed 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessage.php @@ -35,7 +35,7 @@ class AssertIntegrationSuccessSaveMessage extends AbstractConstraint ? $initialIntegration->getName() : $integration->getName(); $expectedMessage = sprintf(self::SUCCESS_SAVE_MESSAGE, $name); - $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessageNotPresent.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessageNotPresent.php index ac23f60261388be7ae31bb5bdb1b019c7f4327c9..ab9f15ae7b9d443c60afebaf19f7c53c3534cbfe 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessageNotPresent.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationSuccessSaveMessageNotPresent.php @@ -26,7 +26,7 @@ class AssertIntegrationSuccessSaveMessageNotPresent extends AbstractConstraint $noSuccessMessage = false; if ($integrationIndex->getMessagesBlock()->isVisible()) { try { - $integrationIndex->getMessagesBlock()->getSuccessMessages(); + $integrationIndex->getMessagesBlock()->getSuccessMessage(); } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { $noSuccessMessage = true; } diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php index 0a71b2cc8ae57f78277e7df3e469c1f44bd9f3f2..0a006d9cb5d8162fd62289c790773edef75ce431 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterSuccessCreateMessage.php @@ -29,7 +29,7 @@ class AssertNewsletterSuccessCreateMessage extends AbstractConstraint */ public function processAssert(TemplateIndex $templateIndex) { - $actualMessage = $templateIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $templateIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php index 0bf83c62bc8a22e1a9d4c797632e680857921a66..c8efec8aec2585d309722d6796d70e84a8cd95c5 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertInvoiceReportResult.php @@ -55,7 +55,7 @@ abstract class AbstractAssertInvoiceReportResult extends AbstractConstraint protected function searchInInvoiceReportGrid(array $invoiceReport) { $this->salesInvoiceReport->open(); - $this->salesInvoiceReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $this->salesInvoiceReport->getMessagesBlock()->clickLinkInMessage('notice', 'here'); $this->salesInvoiceReport->getFilterForm()->viewsReport($invoiceReport); $this->salesInvoiceReport->getActionBlock()->showReport(); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertSalesReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertSalesReportResult.php index 16af632c450ab59a2e803b609454d6d832064d32..d4f5bdda3b2f6074bb6519263f70843d114d8c42 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertSalesReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertSalesReportResult.php @@ -39,7 +39,7 @@ abstract class AbstractAssertSalesReportResult extends AbstractConstraint protected function searchInSalesReportGrid(array $salesReport) { $this->salesReportPage->open(); - $this->salesReportPage->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $this->salesReportPage->getMessagesBlock()->clickLinkInMessage('notice', 'here'); $this->salesReportPage->getFilterBlock()->viewsReport($salesReport); $this->salesReportPage->getActionBlock()->showReport(); } diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php index 1ad8d1b3356f731e3c677d3bced986eabe846662..dc532d027d518fd5990f088304c2a3950aad4ad9 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/BestsellerProductsReportEntityTest.php @@ -64,7 +64,7 @@ class BestsellerProductsReportEntityTest extends Injectable // Preconditions $order->persist(); $this->bestsellers->open(); - $this->bestsellers->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $this->bestsellers->getMessagesBlock()->clickLinkInMessage('notice', 'here'); // Steps $this->bestsellers->getFilterBlock()->viewsReport($bestsellerReport); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php index 895f48a9ecac2c44f74b7f3171305e6f40cc327b..1bc9125d8c747158ddcbdee4c6c93b4f11a11816 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest.php @@ -52,7 +52,7 @@ class SalesInvoiceReportEntityTest extends Injectable { // Preconditions $salesInvoiceReport->open(); - $salesInvoiceReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $salesInvoiceReport->getMessagesBlock()->clickLinkInMessage('notice', 'here'); $salesInvoiceReport->getFilterForm()->viewsReport($invoiceReport); $salesInvoiceReport->getActionBlock()->showReport(); $initialInvoiceResult = $salesInvoiceReport->getGridBlock()->getLastResult(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php index ec395cc8e3fd6a3cb27e4188198d6482fc7de0ae..7dde2c26f72f28b2d6998a175aef9fc5d7a839e3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest.php @@ -69,7 +69,7 @@ class SalesOrderReportEntityTest extends Injectable { // Preconditions $this->salesReport->open(); - $this->salesReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $this->salesReport->getMessagesBlock()->clickLinkInMessage('notice', 'here'); $this->salesReport->getFilterBlock()->viewsReport($salesReport); $this->salesReport->getActionBlock()->showReport(); $initialSalesResult = $this->salesReport->getGridBlock()->getLastResult(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php index f174f4243cd5f2e978ebd2963725c5d9f565a380..f41995615c7583b088f7a704c460ddcd4ccb28ae 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest.php @@ -68,7 +68,7 @@ class SalesRefundsReportEntityTest extends Injectable { // Preconditions $this->refundsReport->open(); - $this->refundsReport->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $this->refundsReport->getMessagesBlock()->clickLinkInMessage('notice', 'here'); $this->refundsReport->getFilterBlock()->viewsReport($refundsReport); $this->refundsReport->getActionBlock()->showReport(); $initialRefundsResult = $this->refundsReport->getGridBlock()->getLastResult(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php index 6a75582c9a76c7990bab54c1634aa83037147419..93e38fd650b7bec8268e647ef088076d2e235fad 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php @@ -100,7 +100,7 @@ class ViewedProductsReportEntityTest extends Injectable $productsList = $this->prepareProducts($products); $this->openProducts($productsList, $total); $this->productReportView->open(); - $this->productReportView->getMessagesBlock()->clickLinkInMessages('notice', 'here'); + $this->productReportView->getMessagesBlock()->clickLinkInMessage('notice', 'here'); // Steps $this->productReportView->getFilterBlock()->viewsReport($viewsReport); diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php index 55975ed6c27e89febdbe99e0f906d444bd072206..b8d61581e43905a953bbc15426ead2ecaa175f64 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertProductRatingSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(RatingIndex $ratingIndex) { - $actualMessage = $ratingIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $ratingIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php index c443e4be423e41713febcca715cbbdeef2c1715f..355f480d1cac437a909ec9a52a559386d847de5a 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertProductRatingSuccessSaveMessage extends AbstractConstraint */ public function processAssert(RatingIndex $ratingIndex) { - $actualMessage = $ratingIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $ratingIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php index f4491856b535a8a2aef8a886ec73818f861e8c94..851cd6baebfbda234ae7379053c931706a5e627f 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewBackendSuccessSaveMessage.php @@ -30,7 +30,7 @@ class AssertProductReviewBackendSuccessSaveMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $reviewIndex->getMessagesBlock()->getSuccessMessages(), + $reviewIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php index cf57f87ba429c9e5774e75163ce75c5403ab5da9..7d7acd1c1b1fb6f6ec5c92042ad4f2bbca2f08dc 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessDeleteMessage.php @@ -38,7 +38,7 @@ class AssertProductReviewMassActionSuccessDeleteMessage extends AbstractConstrai $deleteMessage = sprintf(self::SUCCESS_DELETE_MESSAGE, count($reviews)); \PHPUnit_Framework_Assert::assertEquals( $deleteMessage, - $reviewIndex->getMessagesBlock()->getSuccessMessages(), + $reviewIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php index af2b135f82f08f080aa13f8b48468612e25e5dbf..8bed779b1ad4e0cef91a51d8826006cd328a0896 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewMassActionSuccessMessage.php @@ -34,7 +34,7 @@ class AssertProductReviewMassActionSuccessMessage extends AbstractConstraint $successMessage = sprintf(self::SUCCESS_MESSAGE, count($reviews)); \PHPUnit_Framework_Assert::assertEquals( $successMessage, - $reviewIndex->getMessagesBlock()->getSuccessMessages(), + $reviewIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php index a5b7e25733f420421ffd57e851a0a9fda9ffa063..c582f325845cbdaa18e2f85a4371a1ba0d44fa71 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php @@ -27,7 +27,7 @@ class AssertReviewCreationSuccessMessage extends AbstractConstraint */ public function processAssert(CatalogProductView $catalogProductView) { - $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php index 6804156e9d589738e0efe3b17a7d9bb8e5fbdae1..a8b1ebe03117763411dfb7e11833ac6278d539ad 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertReviewSuccessSaveMessage extends AbstractConstraint */ public function processAssert(ReviewIndex $reviewIndex) { - $actualMessage = $reviewIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $reviewIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php index 0dad1ed84c3b2484dde3660cf131e98f63c9463f..9138b869cad40c889d84eeac1459e569f43ea568 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/CreditMemo/Grid.php @@ -25,16 +25,16 @@ class Grid extends \Magento\Ui\Test\Block\Adminhtml\DataGrid */ protected $filters = [ 'id' => [ - 'selector' => 'input[name="filters[increment_id]"]', + 'selector' => 'input[name="increment_id"]', ], 'order_id' => [ - 'selector' => 'input[name="filters[order_increment_id]"]', + 'selector' => 'input[name="order_increment_id"]', ], 'grand_total_from' => [ - 'selector' => 'input[name="filters[base_grand_total][from]"]', + 'selector' => 'input[name="base_grand_total[from]"]', ], 'grand_total_to' => [ - 'selector' => 'input[name="filters[base_grand_total][to]"]', + 'selector' => 'input[name="base_grand_total[to]"]', ], ]; } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php index 7c2761340796d9158f9de223a92c8dffe8e68b68..2a38e9d0d3426840fe551da97f0293446f65157b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Invoice/Grid.php @@ -18,16 +18,16 @@ class Grid extends \Magento\Ui\Test\Block\Adminhtml\DataGrid */ protected $filters = [ 'id' => [ - 'selector' => 'input[name="filters[increment_id]"]', + 'selector' => 'input[name="increment_id"]', ], 'order_id' => [ - 'selector' => 'input[name="filters[order_increment_id]"]', + 'selector' => 'input[name="order_increment_id"]', ], 'grand_total_from' => [ - 'selector' => 'input[name="filters[grand_total][from]"]', + 'selector' => 'input[name="grand_total[from]"]', ], 'grand_total_to' => [ - 'selector' => 'input[name="filters[grand_total][to]"]', + 'selector' => 'input[name="grand_total[to]"]', ], ]; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php index ef323a4757680d2052e0bc3e283c946f87bc36b2..561694c682f30f520a12b25a8e5ef1266d58cfb4 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php @@ -29,7 +29,7 @@ class AssertInvoiceSuccessCreateMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_CREATE_MESSAGE, - $salesOrderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php index 871f4f3616077701974e5c91a224bca7c1b052cd..47d1bd6e6de6316778d36493440c9ee6346a6d65 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php @@ -29,7 +29,7 @@ class AssertInvoiceWithShipmentSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $salesOrderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php index 45b0e38c91731ea99677a353605816c59e37d1d4..da0c9e71baec2887923c6a499dba2c13a153c29b 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionFailMessage.php @@ -30,7 +30,7 @@ class AssertOrderCancelMassActionFailMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::FAIL_CANCEL_MESSAGE, - $orderIndex->getMessagesBlock()->getErrorMessages() + $orderIndex->getMessagesBlock()->getErrorMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php index 6aa1f29bcbd481b2bb8056a887030817b63420cc..30e2417ac69cca3a601e0117d42184e3934d49e1 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelMassActionSuccessMessage.php @@ -31,7 +31,7 @@ class AssertOrderCancelMassActionSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_CANCEL_MESSAGE, $ordersCount), - $orderIndex->getMessagesBlock()->getSuccessMessages() + $orderIndex->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php index fe5bc74d63c8d6c3e66e685cfc16dff1ab50f2e3..7672d7296106ab5be56509f5a50c5b680602baa6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php @@ -29,7 +29,7 @@ class AssertOrderCancelSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_CANCEL_MESSAGE, - $salesOrderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php index 1f1508c0c422ae9e061dfcc4cd6f005bbd1a914b..d3ae442b81e92bf33285f8dcc9c4bd173818481a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderMassOnHoldSuccessMessage.php @@ -35,7 +35,7 @@ class AssertOrderMassOnHoldSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_ON_HOLD_MESSAGE, $ordersCount), - $orderIndex->getMessagesBlock()->getSuccessMessages() + $orderIndex->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php index f86e9757adf419d706b22e423ab14429ce580a44..7a016fc7be8cade905d5e680b0791d622e7c2e83 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldFailMessage.php @@ -30,7 +30,7 @@ class AssertOrderOnHoldFailMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::FAIL_ON_HOLD_MESSAGE, - $orderIndex->getMessagesBlock()->getErrorMessages() + $orderIndex->getMessagesBlock()->getErrorMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php index 38d9ff38c11a4c93434c20511d5361444194daca..befab64fec1ed4a51f3631bb6e6f4561793ac081 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderOnHoldSuccessMessage.php @@ -44,7 +44,7 @@ class AssertOrderOnHoldSuccessMessage extends AbstractConstraint \PHPUnit_Framework_Assert::assertEquals( $successOnHoldMessage, - $orderIndex->getMessagesBlock()->getSuccessMessages() + $orderIndex->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php index 26b1fadf28eff554b9c0fcff053e3bf0da886054..ccd34d2cc7492762471edbe00ef77a0cdc7b4fdb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseFailMessage.php @@ -30,7 +30,7 @@ class AssertOrderReleaseFailMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::FAIL_RELEASE_MESSAGE, - $orderIndex->getMessagesBlock()->getErrorMessages() + $orderIndex->getMessagesBlock()->getErrorMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php index 5ceebe7a11de8d1341dca68553d6e67d882baa92..4de44d6b18a588817c64863ce55a9037eafe9074 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderReleaseSuccessMessage.php @@ -31,7 +31,7 @@ class AssertOrderReleaseSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_RELEASE_MESSAGE, $ordersCount), - $orderIndex->getMessagesBlock()->getSuccessMessages() + $orderIndex->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php index 4ab58755f5ea3ac1d3ae5cafabf22356400407e5..eeed99ee0c85b1071a28801bbb752a7918582a95 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusDuplicateStatus.php @@ -25,7 +25,7 @@ class AssertOrderStatusDuplicateStatus extends AbstractConstraint */ public function processAssert(OrderStatusNew $orderStatusNewPage) { - $actualMessage = $orderStatusNewPage->getMessagesBlock()->getErrorMessages(); + $actualMessage = $orderStatusNewPage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::DUPLICATE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php index b20839bba30cd73e682177330a2bfb000b4f369e..cd9c9249ac485a2b8064fdb1c6c697f1701d0b2e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessAssignMessage.php @@ -30,7 +30,7 @@ class AssertOrderStatusSuccessAssignMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $orderStatusIndexPage->getMessagesBlock()->getSuccessMessages() + $orderStatusIndexPage->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php index 0e6e63eb9f18507493187c9b7d1311d9455b25d4..f7f63595f92618b0c4238dfb54449be4380a0b4d 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessCreateMessage.php @@ -29,7 +29,7 @@ class AssertOrderStatusSuccessCreateMessage extends AbstractConstraint */ public function processAssert(OrderStatusIndex $orderStatusIndexPage) { - $actualMessage = $orderStatusIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $orderStatusIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php index 1526b66c4a76f56c4366a422b491f892e410160c..9ba8c02a704717ba2a910ad5dc45f66d8b24eed9 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusSuccessUnassignMessage.php @@ -30,7 +30,7 @@ class AssertOrderStatusSuccessUnassignMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $orderStatusIndexPage->getMessagesBlock()->getSuccessMessages() + $orderStatusIndexPage->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php index 16315c537bf0f3b775190fd965ca7e762f1c8b17..cc24dcbabcb86005b93eddd4b23db7b5b4665586 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderSuccessCreateMessage.php @@ -33,7 +33,7 @@ class AssertOrderSuccessCreateMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $salesOrderView->getMessagesBlock()->getSuccessMessages(), + $salesOrderView->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php index 9131c7e77eb032abfa73cb8be40aabbf6a8d012b..b425142c00a692683c48db88b643df029ec9ff78 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundSuccessCreateMessage.php @@ -29,7 +29,7 @@ class AssertRefundSuccessCreateMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_CREATE_MESSAGE, - $salesOrderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Webapi.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Webapi.php index a1e89784737ae43635a12599a3ff534ed65c86c4..bdfbc3b5d157ddb23c3b4b9fab69c1abf2d27738 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Webapi.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Handler/OrderInjectable/Webapi.php @@ -31,6 +31,7 @@ class Webapi extends AbstractWebapi implements OrderInjectableInterface ], 'country_id' => [ 'United States' => 'US', + 'United Kingdom' => 'GB', ], ]; diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php index 2cf4cfb37d7591c67c41fb0a4db26eec88ec3860..be22d6b72bb536097a5e8119def9748b75f70d61 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php @@ -28,7 +28,7 @@ class AssertCartPriceRuleSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(PromoQuoteIndex $promoQuoteIndex) { - $actualMessage = $promoQuoteIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $promoQuoteIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php index 6c0484f965e26af8788efebd59abcd6a6527af5b..278952390ad481c88bfe0c9162dcf29ad02ac74b 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertCartPriceRuleSuccessSaveMessage extends AbstractConstraint */ public function processAssert(PromoQuoteIndex $promoQuoteIndex) { - $actualMessage = $promoQuoteIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $promoQuoteIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php index b77443423773ba216acc535fecde78adae54dd59..d094c186e3108382afd5d1f99df76409650fe124 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Block/Adminhtml/Shipment/Grid.php @@ -27,16 +27,16 @@ class Grid extends GridInterface */ protected $filters = [ 'id' => [ - 'selector' => 'input[name="filters[increment_id]"]', + 'selector' => 'input[name="increment_id"]', ], 'order_id' => [ - 'selector' => 'input[name="filters[order_increment_id]"]', + 'selector' => 'input[name="order_increment_id"]', ], 'total_qty_from' => [ - 'selector' => 'input[name="filters[total_qty][from]"]', + 'selector' => 'input[name="total_qty[from]"', ], 'total_qty_to' => [ - 'selector' => 'input[name="filters[total_qty][to]"]', + 'selector' => 'input[name="total_qty][to]"', ], ]; } diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php index f2fcaf7697c5692da1ad95d0698f796316879af3..4c09a5d1ca7da213006d86e9357268d88bb1e08f 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php @@ -29,7 +29,7 @@ class AssertShipmentSuccessCreateMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $salesOrderView->getMessagesBlock()->getSuccessMessages() + $salesOrderView->getMessagesBlock()->getSuccessMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php index da7884f1f17ee3aabcf65809fa4a9bde1d536ada..8f27a314d13b4840c3119afab5ccc32435f3026c 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php @@ -26,7 +26,7 @@ class AssertSitemapFailFolderSaveMessage extends AbstractConstraint */ public function processAssert(SitemapIndex $sitemapPage, Sitemap $sitemap) { - $actualMessage = $sitemapPage->getMessagesBlock()->getErrorMessages(); + $actualMessage = $sitemapPage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( sprintf(self::FAIL_FOLDER_MESSAGE, $sitemap->getSitemapPath()), $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php index 82217a2d958c40b30c02a1c9f56e0c3dbfc6e5f0..8a188d6880eb7f82a1de27045826921b43a994e1 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php @@ -26,7 +26,7 @@ class AssertSitemapFailPathSaveMessage extends AbstractConstraint */ public function processAssert(SitemapIndex $sitemapPage, Sitemap $sitemap) { - $actualMessage = $sitemapPage->getMessagesBlock()->getErrorMessages(); + $actualMessage = $sitemapPage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( sprintf(self::FAIL_PATH_MESSAGE, $sitemap->getSitemapFilename()), $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php index 0209c3f0a7659e98be796329a23705070ff61edb..f02734b53949517da91d125039602bce6c820fc8 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertSitemapSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(SitemapIndex $sitemapPage) { - $actualMessage = $sitemapPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $sitemapPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php index 77e58ce48e148638de09e08d987d87efd097bc31..b8178bf6b85ac1e5e97a1ae5ad88111db5d580a5 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessGenerateMessage.php @@ -32,7 +32,7 @@ class AssertSitemapSuccessGenerateMessage extends AbstractConstraint SitemapIndex $sitemapPage, Sitemap $sitemap ) { - $actualMessage = $sitemapPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $sitemapPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_GENERATE_MESSAGE, $sitemap->getSitemapFilename()), $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php index e0e4efc80694dfa9901040e5b5ffec1610424782..e25e8eec6bdbbe10184d52e37db04e7b7e6920a3 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertSitemapSuccessSaveMessage extends AbstractConstraint */ public function processAssert(SitemapIndex $sitemapPage) { - $actualMessage = $sitemapPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $sitemapPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php index ea9be6f761b102f359cc1edd0a5ee16564c077f2..d74e39c143582c62bb18100953230a8dac75b1c2 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteMessage.php @@ -30,7 +30,7 @@ class AssertStoreGroupSuccessDeleteMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, - $storeIndex->getMessagesBlock()->getSuccessMessages(), + $storeIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success delete message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php index 5be639d9d9279bca28978d4af48012a9ab2722a8..f9d2aafc57a6ea4cb7d3ffbab491be53b7de6d33 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php @@ -30,7 +30,7 @@ class AssertStoreGroupSuccessSaveMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $storeIndex->getMessagesBlock()->getSuccessMessages(), + $storeIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php index 82dd5459f8ba49c1d9e98ce71cd79d002438b07f..957357f71e5e55a055f6beda12fc65c822bfb35d 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteMessage.php @@ -30,7 +30,7 @@ class AssertStoreSuccessDeleteMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, - $storeIndex->getMessagesBlock()->getSuccessMessages(), + $storeIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success delete message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php index cf467e88cb587ebfe66c9c9049448a8eb1208b67..ac66a3412b7a499bf46dcbb1d977e205fcd98cfc 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessSaveMessage.php @@ -30,7 +30,7 @@ class AssertStoreSuccessSaveMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $storeIndex->getMessagesBlock()->getSuccessMessages(), + $storeIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php index 11d54478e8df7fbb28c202d1b62fffb54a59e162..076d7daaa32616977e2a7edaff83673f7ce70492 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteMessage.php @@ -30,7 +30,7 @@ class AssertWebsiteSuccessDeleteMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, - $storeIndex->getMessagesBlock()->getSuccessMessages(), + $storeIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success delete message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php index 2078e611262bc4022a42a8f0d37fc09d8534dbaf..60dde78e3eb59139ec70f184be88361a91943f3e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessSaveMessage.php @@ -30,7 +30,7 @@ class AssertWebsiteSuccessSaveMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $storeIndex->getMessagesBlock()->getSuccessMessages(), + $storeIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php index f956e5c82b97bd87c08c3fec8f158fd995dfb9cb..f8ae7822c5783859ecd0a255a56c4ba7249c5cec 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertTaxRateSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(TaxRateIndex $taxRateIndex) { - $actualMessage = $taxRateIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $taxRateIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php index 165e9a7aeb65f2be2fd5a9a13903e6e793fae7ee..79a9b63ea942da615336b45dd42d04ddf24e6bb4 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertTaxRateSuccessSaveMessage extends AbstractConstraint */ public function processAssert(TaxRateIndex $taxRateIndexPage) { - $actualMessage = $taxRateIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $taxRateIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php index 44c3367d48e34c54f0f4b534f4f34c7600190691..5a7872a6373c2c5ca03ee0a43f8e0c10d37f5893 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertTaxRuleSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(TaxRuleIndex $taxRuleIndex) { - $actualMessage = $taxRuleIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $taxRuleIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php index 73e32f4f8b151902bef7d3702bc9462b25080852..8234673ee1cdefdc70911cbdfd531bba2f96fe62 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php @@ -28,7 +28,7 @@ class AssertTaxRuleSuccessSaveMessage extends AbstractConstraint */ public function processAssert(TaxRuleIndex $taxRuleIndex) { - $actualMessage = $taxRuleIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $taxRuleIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml index c54201720c84b9766e0fb00f52f673e9ee4ec7f6..52dea03715a3677a424eddae35e4a7bf4eee26ec 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/ApplyTaxBasedOnVatIdTest.xml @@ -19,7 +19,7 @@ <data name="customerGroup" xsi:type="string">valid_intra_union_group</data> <data name="cart/data/subtotal" xsi:type="string">10</data> <data name="cart/data/tax_amount" xsi:type="string">2</data> - <data name="cart/data/grand_total" xsi:type="string">12</data> + <data name="cart/data/grand_total" xsi:type="string">17</data> <data name="prices" xsi:type="array"> <item name="grandTotal" xsi:type="string">17</item> </data> diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php index 5757bf446e6eecf0bf13ea8c2e9253e3166ae137..13545de8f49237b9ec856cdd8426e59e3efa877a 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/DataGrid.php @@ -128,6 +128,20 @@ class DataGrid extends Grid */ protected $alertModal = '._show[data-role=modal]'; + /** + * Locator for 'Sort' link. + * + * @var string + */ + protected $sortLink = "//th[contains(@class, '%s')]/span[contains(text(), '%s')]"; + + /** + * Current page input. + * + * @var string + */ + protected $currentPage = '#pageCurrent'; + /** * Clear all applied Filters. * @@ -239,23 +253,23 @@ class DataGrid extends Grid if ($this->_rootElement->find($this->noRecords)->isVisible()) { return; } - if (!is_array($action)) { - $action = [$action => '-']; - } - foreach ($items as $item) { - $this->searchAndSelect($item); - } + $this->selectItems($items); if ($massActionSelection) { $this->_rootElement->find($this->massActionToggleButton)->click(); $this->_rootElement ->find(sprintf($this->massActionToggleList, $massActionSelection), Locator::SELECTOR_XPATH) ->click(); } - $actionType = key($action); + $actionType = is_array($action) ? key($action) : $action; $this->_rootElement->find($this->massActionButton)->click(); $this->_rootElement ->find(sprintf($this->massActionToggleList, $actionType), Locator::SELECTOR_XPATH) ->click(); + if (is_array($action)) { + $this->_rootElement + ->find(sprintf($this->massActionToggleList, end($action)), Locator::SELECTOR_XPATH) + ->click(); + } if ($acceptAlert) { $element = $this->browser->find($this->alertModal); /** @var \Magento\Ui\Test\Block\Adminhtml\Modal $modal */ @@ -264,6 +278,49 @@ class DataGrid extends Grid } } + /** + * Select items without using grid search. + * + * @param array $items + * @return void + * @throws \Exception + */ + protected function selectItems(array $items) + { + $this->sortGridByField('ID'); + foreach ($items as $item) { + $this->_rootElement->find($this->currentPage)->setValue(''); + $this->waitLoader(); + $selectItem = $this->getRow($item)->find($this->selectItem); + do { + if ($selectItem->isVisible()) { + $selectItem->click(); + break; + } + } while ($this->nextPage()); + if (!$selectItem->isVisible()) { + throw new \Exception('Searched item was not found.'); + } + } + } + + /** + * Sort grid by field. + * + * @param string $field + * @param string $sort + * @return void + */ + public function sortGridByField($field, $sort = "desc") + { + $reverseSort = $sort == 'desc' ? 'asc' : 'desc'; + $sortBlock = $this->_rootElement->find(sprintf($this->sortLink, $reverseSort, $field), Locator::SELECTOR_XPATH); + if ($sortBlock->isVisible()) { + $sortBlock->click(); + $this->waitLoader(); + } + } + /** * @param string $columnLabel */ diff --git a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/Modal.php b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/Modal.php index 96ed46ae296cd0ec50cb90259929c9d87d068e5d..f2ecfee702bdf66380b8ce8a7a3a9a6af5e9222f 100644 --- a/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/Modal.php +++ b/dev/tests/functional/tests/app/Magento/Ui/Test/Block/Adminhtml/Modal.php @@ -41,6 +41,13 @@ class Modal extends Block */ protected $inputFieldSelector = '[data-role="promptField"]'; + /** + * Modal overlay selector. + * + * @var string + */ + protected $modalOverlay = '.modals-overlay'; + /** * Press OK on an alert, confirm, prompt a dialog. * @@ -91,4 +98,18 @@ class Modal extends Block { $this->_rootElement->find($this->inputFieldSelector)->setValue($text); } + + /** + * Wait until modal window will disapper. + * + * @return void + */ + public function waitModalWindowToDisappear() + { + $this->browser->waitUntil( + function () { + return $this->browser->find($this->modalOverlay)->isVisible() == false ? true : null; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php index ac453e2ebdc40642ed3d948c5663aaec5bd9d9a7..c27afd627bfb8250014f6142b13b2a31afdda6a7 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteDeletedMessage.php @@ -28,7 +28,7 @@ class AssertUrlRewriteDeletedMessage extends AbstractConstraint */ public function processAssert(UrlRewriteIndex $index) { - $actualMessage = $index->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $index->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php index 97d8c67ce5e53fe5a918ef914a5e8f9e258b1054..5d3e4a547d5f613cb57bf1a64cb800b71aac28ac 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSaveMessage.php @@ -25,7 +25,7 @@ class AssertUrlRewriteSaveMessage extends AbstractConstraint */ public function processAssert(UrlRewriteIndex $index) { - $actualMessage = $index->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $index->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Block/Adminhtml/Role/Tab/User/Grid.php b/dev/tests/functional/tests/app/Magento/User/Test/Block/Adminhtml/Role/Tab/User/Grid.php index ab1ea537ea6431ed7aaa7fd9b5a352b6b5bf0edc..ec0c365b817127c7f08b869a2e531d7090336e9c 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Block/Adminhtml/Role/Tab/User/Grid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Block/Adminhtml/Role/Tab/User/Grid.php @@ -30,5 +30,5 @@ class Grid extends AbstractGrid * * @var string */ - protected $selectItem = '.col-in_role_users > input'; + protected $selectItem = '.col-in_role_users input'; } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php index b8110526b398ecc7a2697da3dd0aac72c4881801..58920c5edeec0612f80af4e4759f7373889c51de 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertAccessTokensErrorRevokeMessage.php @@ -30,7 +30,7 @@ class AssertAccessTokensErrorRevokeMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::ERROR_MESSAGE, - $userEdit->getMessagesBlock()->getErrorMessages() + $userEdit->getMessagesBlock()->getErrorMessage() ); } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php index 89169bcf80ef342c0cfb63250e486c3cfa793ffe..b66e275b4795c6e24c4c11bf5058c6b0d16dcd6e 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnAccount.php @@ -24,7 +24,7 @@ class AssertImpossibleDeleteYourOwnAccount extends AbstractConstraint */ public function processAssert(UserEdit $userEdit) { - $errorMessage = $userEdit->getMessagesBlock()->getErrorMessages(); + $errorMessage = $userEdit->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_MESSAGE, $errorMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php index c469966dc940a9b08cd70f1a051881c3d2495321..06d525e2b4a666ba0b6cb5237c19b61207a32b49 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertImpossibleDeleteYourOwnRole.php @@ -24,7 +24,7 @@ class AssertImpossibleDeleteYourOwnRole extends AbstractConstraint */ public function processAssert(UserRoleEditRole $rolePage) { - $errorMessage = $rolePage->getMessagesBlock()->getErrorMessages(); + $errorMessage = $rolePage->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_MESSAGE, $errorMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php index 943acd3b521fcc50631d1c6310c82f77138297a2..8d828ceb237b860ed2d8c8cfb6a98e2928b02a0e 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertRoleSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(UserRoleIndex $rolePage) { - $successMessage = $rolePage->getMessagesBlock()->getSuccessMessages(); + $successMessage = $rolePage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $successMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php index 4487b76954a4f6b6d5ea4974bf30aed9712cee72..402234f7b48a36e3b267a29c93beaab13fa9aeec 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertRoleSuccessSaveMessage extends AbstractConstraint */ public function processAssert(UserRoleIndex $rolePage) { - $successMessage = $rolePage->getMessagesBlock()->getSuccessMessages(); + $successMessage = $rolePage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $successMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php index 66e1d6b432aa6447126165e1002b939895cdc8b0..99c6e89ad0a35e7194f2bc8e929f4e63fa5f9dcb 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserDuplicateMessage.php @@ -24,7 +24,7 @@ class AssertUserDuplicateMessage extends AbstractConstraint */ public function processAssert(UserEdit $userEdit) { - $failedMessage = $userEdit->getMessagesBlock()->getErrorMessages(); + $failedMessage = $userEdit->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_MESSAGE, $failedMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php index db943e911a3d0c3c695cecd9e7372f4e86ebf869..2454f53eb0f6a0d6e3793e51dc387aae35a10dfe 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginByPermissionMessage.php @@ -32,7 +32,7 @@ class AssertUserFailedLoginByPermissionMessage extends AbstractConstraint \PHPUnit_Framework_Assert::assertEquals( self::FAILED_LOGIN_MESSAGE, - $adminAuth->getMessagesBlock()->getErrorMessages(), + $adminAuth->getMessagesBlock()->getErrorMessage(), 'Message "' . self::FAILED_LOGIN_MESSAGE . '" is not visible.' ); } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php index e01aa9a9cd0cdfe0af16c3c74c6f32cfdbe8f669..c57af1f5abb1a186b2c6136505812161a1aa0d1a 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserFailedLoginMessage.php @@ -34,7 +34,7 @@ class AssertUserFailedLoginMessage extends AbstractConstraint \PHPUnit_Framework_Assert::assertEquals( self::FAILED_LOGIN_MESSAGE, - $adminAuth->getMessagesBlock()->getErrorMessages(), + $adminAuth->getMessagesBlock()->getErrorMessage(), 'Message "' . self::FAILED_LOGIN_MESSAGE . '" is not visible.' ); } diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailHostnameMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailHostnameMessage.php index 74af3f80cd78f038dcd04a1e76d4a23dd0013fe3..117857a23fc2352dcb6c386ed83c6f276d3db8c8 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailHostnameMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailHostnameMessage.php @@ -33,7 +33,7 @@ class AssertUserInvalidEmailHostnameMessage extends AbstractConstraint $email = $user->getEmail(); $hostname = substr($email, strpos($email, '@')+1); $expectedMessage = sprintf(self::ERROR_MESSAGE, $hostname, $email); - $actualMessage = $userEdit->getMessagesBlock()->getErrorMessages(); + $actualMessage = $userEdit->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php index 431b9f13c71cc8838efebd393e61f2b311276733..f9c878f6889a98e16b770f931989a31e9392cf9f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInvalidEmailMessage.php @@ -31,7 +31,7 @@ class AssertUserInvalidEmailMessage extends AbstractConstraint public function processAssert(UserEdit $userEdit, User $user) { $expectedMessage = sprintf(self::ERROR_MESSAGE, $user->getEmail()); - $actualMessage = $userEdit->getMessagesBlock()->getErrorMessages(); + $actualMessage = $userEdit->getMessagesBlock()->getErrorMessage(); \PHPUnit_Framework_Assert::assertEquals( $expectedMessage, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php index c6f7e9e69495c0d3530e7db93cd670b00490a279..a6ba344c97fb76200f62a6069b1dc0a9cbd98701 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessDeleteMessage.php @@ -28,7 +28,7 @@ class AssertUserSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(UserIndex $userIndex) { - $successMessage = $userIndex->getMessagesBlock()->getSuccessMessages(); + $successMessage = $userIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $successMessage, diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php index e8f4e5f55715a9968559d193c3c49c5e12cec5a3..8cf031d5694da7ca29d553d4ba72465bb4c75a14 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertUserSuccessSaveMessage extends AbstractConstraint */ public function processAssert(UserIndex $userIndex) { - $successMessage = $userIndex->getMessagesBlock()->getSuccessMessages(); + $successMessage = $userIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $successMessage, diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php index 596577190cab66e24fd31bac364975fdbcc263b2..d4a73859e76cb28fb4d397443b6876ef025fc614 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php @@ -24,7 +24,7 @@ class AssertCustomVariableSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(SystemVariableIndex $systemVariableIndexPage) { - $actualMessage = $systemVariableIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $systemVariableIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php index dd723c012ab74497e12a3fcb10f853d8ed8e49f7..67117ed950bacaefb62f16544f8f9a4a4a400421 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php @@ -24,7 +24,7 @@ class AssertCustomVariableSuccessSaveMessage extends AbstractConstraint */ public function processAssert(SystemVariableIndex $systemVariableIndexPage) { - $actualMessage = $systemVariableIndexPage->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $systemVariableIndexPage->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_SAVE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml index c78a826e8500caf6b191ff38d58a0c84d7d7c76e..95d06f6d4074a56ab81a458d552c424ab698bd47 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Repository/ConfigData.xml @@ -92,19 +92,19 @@ <field name="tax/weee/display_list" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display_sales" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/apply_vat" xsi:type="array"> @@ -242,19 +242,19 @@ <field name="tax/weee/display_list" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display_sales" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/apply_vat" xsi:type="array"> @@ -392,19 +392,19 @@ <field name="tax/weee/display_list" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display_sales" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/apply_vat" xsi:type="array"> @@ -467,19 +467,19 @@ <field name="tax/weee/display_list" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display_sales" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/apply_vat" xsi:type="array"> @@ -542,19 +542,19 @@ <field name="tax/weee/display_list" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/display_sales" xsi:type="array"> <item name="scope" xsi:type="string">tax</item> <item name="scope_id" xsi:type="number">1</item> - <item name="label" xsi:type="string">Excluding FPT, FPT description, final price</item> + <item name="label" xsi:type="string">Excluding FPT. Including FPT description and final price</item> <item name="value" xsi:type="number">2</item> </field> <field name="tax/weee/apply_vat" xsi:type="array"> diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessDeleteMessage.php index 57b6aa9da7af7d99f866c253d16378166dc0ac51..687205faabf60d5d45c33a0fac5919b919077af8 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessDeleteMessage.php @@ -31,7 +31,7 @@ class AssertWidgetSuccessDeleteMessage extends AbstractConstraint */ public function processAssert(WidgetInstanceIndex $widgetInstanceIndex) { - $actualMessage = $widgetInstanceIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $widgetInstanceIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::DELETE_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php index dae56dc5d3e44a9c7bf7b249e3f288b7d480464d..4ebfac7c9cf6e9ed3a7c35597df11ae358323f26 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php @@ -31,7 +31,7 @@ class AssertWidgetSuccessSaveMessage extends AbstractConstraint */ public function processAssert(WidgetInstanceIndex $widgetInstanceIndex) { - $actualMessage = $widgetInstanceIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $widgetInstanceIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php index ead94063b609e1b9b3f162859196441aded573db..3199d2a356ab8ed3932a1855a0dfe6872c75c970 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php @@ -36,7 +36,7 @@ class AssertAddProductToWishlistSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $wishlistIndex->getMessagesBlock()->getSuccessMessages(), + $wishlistIndex->getMessagesBlock()->getSuccessMessage(), "Expected success message doesn't match actual." ); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php index 88a588fe6309f0f7aa70c7bf380598a8effad1ed..fe4fc287c831aa59088d443610f6899e2242ee61 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php @@ -32,7 +32,7 @@ class AssertMoveProductToWishlistSuccessMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $wishlistIndex->getMessagesBlock()->getSuccessMessages(), + $wishlistIndex->getMessagesBlock()->getSuccessMessage(), "Expected success move to wish list message doesn't match actual." ); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php index 7013691e59cbf853b1fe18f596ea5375c3576638..5d7e9dc5f2bd40183194f8f3f448af95ec9632ab 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistShareMessage.php @@ -34,7 +34,7 @@ class AssertWishlistShareMessage extends AbstractConstraint { \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, - $wishlistIndex->getMessagesBlock()->getSuccessMessages(), + $wishlistIndex->getMessagesBlock()->getSuccessMessage(), 'Wrong success message is displayed.' ); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php index 007c4939d78885013937f86f1424a8f2f8ab71e9..664fdee21987253770e0160a6d31e00009677cc3 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/AttributeTest.php @@ -7,6 +7,7 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; /** * @magentoAppArea adminhtml + * @magentoDbIsolation enabled */ class AttributeTest extends \Magento\TestFramework\TestCase\AbstractBackendController { diff --git a/lib/internal/Magento/Framework/Pricing/Adjustment/Calculator.php b/lib/internal/Magento/Framework/Pricing/Adjustment/Calculator.php index cf7e2eda9be1d2ec37872b965d42ada8f75e6dbe..6140e7c2581be6d5ea2dbd15be8e352ec0eeb773 100644 --- a/lib/internal/Magento/Framework/Pricing/Adjustment/Calculator.php +++ b/lib/internal/Magento/Framework/Pricing/Adjustment/Calculator.php @@ -40,6 +40,7 @@ class Calculator implements CalculatorInterface public function getAmount($amount, SaleableInterface $saleableItem, $exclude = null, $context = []) { $baseAmount = $fullAmount = $amount; + $previousAdjustments = 0; $adjustments = []; foreach ($saleableItem->getPriceInfo()->getAdjustments() as $adjustment) { $code = $adjustment->getAdjustmentCode(); @@ -51,7 +52,7 @@ class Calculator implements CalculatorInterface $adjust = $adjustment->extractAdjustment($baseAmount, $saleableItem, $context); $baseAmount -= $adjust; $fullAmount = $adjustment->applyAdjustment($fullAmount, $saleableItem, $context); - $adjust = $fullAmount - $baseAmount; + $adjust = $fullAmount - $baseAmount - $previousAdjustments; if (!$toExclude) { $adjustments[$code] = $adjust; } @@ -63,6 +64,7 @@ class Calculator implements CalculatorInterface $adjust = $newAmount - $fullAmount; $adjustments[$code] = $adjust; $fullAmount = $newAmount; + $previousAdjustments += $adjust; } } diff --git a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php index 9aa6eccbe0922a693cb25aab9a1a3e8195ac78ee..7865cf7db856610c537c797a992f0b68ee283710 100644 --- a/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php +++ b/lib/internal/Magento/Framework/Pricing/Test/Unit/Adjustment/CalculatorTest.php @@ -40,39 +40,30 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase */ public function testGetAmount() { - $amount = 10; - $fullAmount = $amount; - $newAmount = 15; - $taxAdjustmentCode = 'tax'; + $amountInclTax = 10; + $taxAdjustment = 2; + $weeeAdjustment = 5; + $totalAmount = $amountInclTax + $weeeAdjustment; + $weeeAdjustmentCode = 'weee'; - $adjustment = 5; + $taxAdjustmentCode = 'tax'; $expectedAdjustments = [ - $taxAdjustmentCode => $adjustment, - $weeeAdjustmentCode => $adjustment, + $weeeAdjustmentCode => $weeeAdjustment, + $taxAdjustmentCode => $taxAdjustment, ]; - $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + $amountBaseMock = $this->getMockBuilder('Magento\Framework\Pricing\Amount\Base') ->disableOriginalConstructor() - ->setMethods(['getPriceInfo', '__wakeup']) ->getMock(); + $this->amountFactoryMock->expects($this->once()) + ->method('create') + ->with($this->equalTo($totalAmount), $this->equalTo($expectedAdjustments)) + ->will($this->returnValue($amountBaseMock)); - $taxAdjustmentMock = $this->getMockBuilder('Magento\Tax\Pricing\Adjustment') + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') ->disableOriginalConstructor() + ->setMethods(['getPriceInfo', '__wakeup']) ->getMock(); - $taxAdjustmentMock->expects($this->once()) - ->method('getAdjustmentCode') - ->will($this->returnValue($taxAdjustmentCode)); - $taxAdjustmentMock->expects($this->once()) - ->method('isIncludedInBasePrice') - ->will($this->returnValue(true)); - $taxAdjustmentMock->expects($this->once()) - ->method('extractAdjustment') - ->with($this->equalTo($amount), $this->equalTo($productMock)) - ->will($this->returnValue($adjustment)); - $taxAdjustmentMock->expects($this->once()) - ->method('applyAdjustment') - ->with($this->equalTo($fullAmount), $this->equalTo($productMock)) - ->will($this->returnValue($amount)); $weeeAdjustmentMock = $this->getMockBuilder('Magento\Weee\Pricing\Adjustment') ->disableOriginalConstructor() @@ -85,15 +76,33 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(false)); $weeeAdjustmentMock->expects($this->once()) ->method('isIncludedInDisplayPrice') - ->with($this->equalTo($productMock)) ->will($this->returnValue(true)); $weeeAdjustmentMock->expects($this->once()) ->method('applyAdjustment') - ->with($this->equalTo($fullAmount), $this->equalTo($productMock)) - ->will($this->returnValue($newAmount)); + ->with($this->equalTo($amountInclTax), $this->equalTo($productMock)) + ->will($this->returnValue($weeeAdjustment + $amountInclTax)); - $adjustments = [$taxAdjustmentMock, $weeeAdjustmentMock]; + $taxAdjustmentMock = $this->getMockBuilder('Magento\Tax\Pricing\Adjustment') + ->disableOriginalConstructor() + ->getMock(); + $taxAdjustmentMock->expects($this->once()) + ->method('getAdjustmentCode') + ->will($this->returnValue($taxAdjustmentCode)); + $taxAdjustmentMock->expects($this->once()) + ->method('isIncludedInBasePrice') + ->will($this->returnValue(true)); + $taxAdjustmentMock->expects($this->once()) + ->method('extractAdjustment') + ->with($this->equalTo($amountInclTax), $this->equalTo($productMock)) + ->will($this->returnValue($taxAdjustment)); + $taxAdjustmentMock->expects($this->once()) + ->method('applyAdjustment') + ->with($this->equalTo($totalAmount), $this->equalTo($productMock)) + ->will($this->returnValue($totalAmount)); + $taxAdjustmentMock->expects($this->never()) + ->method('isIncludedInDisplayPrice'); + $adjustments = [$weeeAdjustmentMock, $taxAdjustmentMock]; $priceInfoMock = $this->getMockBuilder('\Magento\Framework\Pricing\PriceInfo\Base') ->disableOriginalConstructor() ->getMock(); @@ -105,15 +114,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase ->method('getPriceInfo') ->will($this->returnValue($priceInfoMock)); - $amountBaseMock = $this->getMockBuilder('Magento\Framework\Pricing\Amount\Base') - ->disableOriginalConstructor() - ->getMock(); - - $this->amountFactoryMock->expects($this->once()) - ->method('create') - ->with($this->equalTo($newAmount), $this->equalTo($expectedAdjustments)) - ->will($this->returnValue($amountBaseMock)); - $result = $this->model->getAmount($amount, $productMock); + $result = $this->model->getAmount($amountInclTax, $productMock); $this->assertInstanceOf('Magento\Framework\Pricing\Amount\AmountInterface', $result); } diff --git a/lib/internal/Magento/Framework/Xml/Security.php b/lib/internal/Magento/Framework/Xml/Security.php index 1fade0a2aec7e0a48389168536a452559f1f0222..87c5f271a5bb5a422e4358c8d2a7541e3b713f13 100644 --- a/lib/internal/Magento/Framework/Xml/Security.php +++ b/lib/internal/Magento/Framework/Xml/Security.php @@ -21,7 +21,7 @@ class Security */ private function heuristicScan($xmlContent) { - return strpos($xmlContent, '<!ENTITY') !== false; + return strpos($xmlContent, '<!ENTITY') === false; } /**