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/Adminhtml/Product/Attribute/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php index 96d204f7400e01651de1a2b2e75af3cec9c569a4..29f7d7227a290bac1a230be877481c0d9f3d4094 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php @@ -54,9 +54,9 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container $this->addButton( 'save_in_new_set', [ - 'label' => __('Save in New Product Template'), + 'label' => __('Save in New Attribute Set'), 'class' => 'save', - 'onclick' => 'saveAttributeInNewSet(\'' . __('Enter Name for New Product Template') . '\')' + 'onclick' => 'saveAttributeInNewSet(\'' . __('Enter Name for New Attribute Set') . '\')' ], 100 ); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php index 34025f7fc5bcfbe5df6880ae4738c98acc19bd25..9215bdb305f892d29bfa6613dd9732f27d8b95dc 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -129,7 +129,7 @@ class Main extends \Magento\Backend\Block\Template 'label' => __('Delete'), 'onclick' => 'deleteConfirm(\'' . $this->escapeJsQuote( __( - 'You are about to delete all products in this product template. ' + 'You are about to delete all products in this attribute set. ' . 'Are you sure you want to do that?' ) ) . '\', \'' . $this->getUrl( @@ -187,7 +187,7 @@ class Main extends \Magento\Backend\Block\Template */ protected function _getHeader() { - return __("Edit Product Template '%1'", $this->_getAttributeSet()->getAttributeSetName()); + return __("Edit Attribute Set '%1'", $this->_getAttributeSet()->getAttributeSetName()); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php index ab4bcab4dbf1d7602d34cc7a9c42a542c94ab0e6..ecfdb19e430251c3d84185273801787e569b7a42 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php @@ -43,7 +43,7 @@ class Formset extends \Magento\Backend\Block\Widget\Form\Generic /** @var \Magento\Framework\Data\Form $form */ $form = $this->_formFactory->create(); - $fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Product Template Name')]); + $fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Attribute Set Name')]); $fieldset->addField( 'attribute_set_name', 'text', diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php index 42434c7094c6464bc98657e856416e5109e80a36..f4f6dc467ca0d47cc86b782a7f55f7cd6befcada 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Add.php @@ -57,7 +57,7 @@ class Add extends \Magento\Backend\Block\Template */ protected function _getHeader() { - return __('Add New Product Template'); + return __('Add New Attribute Set'); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php index cedf419205b6f704b1ebc4dd60009ea20beb4b55..a04f09439e1bc8811373dae7106817af955b421b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php @@ -27,7 +27,7 @@ class Main extends \Magento\Backend\Block\Template 'addButton', 'Magento\Backend\Block\Widget\Button', [ - 'label' => __('Add Product Template'), + 'label' => __('Add Attribute Set'), 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/add') . '\')', 'class' => 'add primary add-set' ] @@ -48,7 +48,7 @@ class Main extends \Magento\Backend\Block\Template */ protected function _getHeader() { - return __('Product Templates'); + return __('Attribute Sets'); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php index 5b8bb9a77fa3bc10528129cfa5097d3350776ddd..df7a36b961a3432f25387f9d332dbaabf333ca9f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php @@ -42,7 +42,7 @@ class AttributeSet extends \Magento\Backend\Block\Widget\Form public function getSelectorOptions() { return [ - 'source' => $this->getUrl('catalog/product/suggestProductTemplates'), + 'source' => $this->getUrl('catalog/product/suggestAttributeSets'), 'className' => 'category-select', 'showRecent' => true, 'storageKey' => 'product-template-key', diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php index 8f6c08bb52bca13d6ded0f70f31ab034c9549d2f..09fbbd9b2a292c037815df8e1720a54f3e1b0bb9 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php @@ -249,7 +249,7 @@ class Crosssell extends Extended $this->addColumn( 'set_name', [ - 'header' => __('Product Template'), + 'header' => __('Attribute Set'), 'index' => 'attribute_set_id', 'type' => 'options', 'options' => $sets, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php index 0e87290ec2729752ef2b35adcffa418ad3d8da9c..af104d601ac4e9a2d04dc08b7c27a3496ecbea30 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php @@ -243,7 +243,7 @@ class Related extends Extended $this->addColumn( 'set_name', [ - 'header' => __('Product Template'), + 'header' => __('Attribute Set'), 'index' => 'attribute_set_id', 'type' => 'options', 'options' => $sets, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php index cad5aafe5d0ccfd2c4ee561e8f425a6d9695ea32..2ea563292e69c8bb8ccebcd77f96da2d20c2d76e 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php @@ -239,7 +239,7 @@ class Upsell extends \Magento\Backend\Block\Widget\Grid\Extended $this->addColumn( 'set_name', [ - 'header' => __('Product Template'), + 'header' => __('Attribute Set'), 'index' => 'attribute_set_id', 'type' => 'options', 'options' => $sets, diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php index e6f12259918729648a443e1310e05b196f2e7b25..e426c08e70a44e9ee178993f204901976683ba9f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php @@ -263,7 +263,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended $this->addColumn( 'set_name', [ - 'header' => __('Product Template'), + 'header' => __('Attribute Set'), 'index' => 'attribute_set_id', 'type' => 'options', 'options' => $sets, diff --git a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php index 0fa415acf082b57e582d31793fa67e84a9a73006..e2cb3d356a6f40e6cd1e17b46aae73615b249565 100644 --- a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php +++ b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php @@ -54,7 +54,7 @@ class TemplateSelector extends \Magento\Framework\View\Element\Template } /** - * Retrieve list of product templates with search part contained in label + * Retrieve list of attribute sets with search part contained in label * * @param string $labelPart * @return array 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/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php index 7d337411b0a234f947c20f243bce508de82a8481..26fea5b4039fdcf5b10dc72f2bd17f9ef501ac3e 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php @@ -27,7 +27,7 @@ class AddAttributeToTemplate extends \Magento\Catalog\Controller\Adminhtml\Produ $this->resultJsonFactory = $resultJsonFactory; } /** - * Add attribute to product template + * Add attribute to attribute set * * @return \Magento\Framework\Controller\Result\Json */ diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Add.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Add.php index 81f61ec8362a54a1e3e094902ef15365e78ab056..7e4bee7a769130c5bee46b3ec708192811e79d7b 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Add.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Add.php @@ -37,7 +37,7 @@ class Add extends \Magento\Catalog\Controller\Adminhtml\Product\Set /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); $resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets'); - $resultPage->getConfig()->getTitle()->prepend(__('New Product Template')); + $resultPage->getConfig()->getTitle()->prepend(__('New Attribute Set')); $resultPage->addContent( $resultPage->getLayout()->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Add') ); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Delete.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Delete.php index 9849dc6884732048424f4b95adc8782eca6954c9..9585bce699f5faa9b579089f3fbbd8313344b346 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Delete.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Delete.php @@ -36,7 +36,7 @@ class Delete extends \Magento\Catalog\Controller\Adminhtml\Product\Set $resultRedirect = $this->resultRedirectFactory->create(); try { $this->attributeSetRepository->deleteById($setId); - $this->messageManager->addSuccess(__('The product template has been removed.')); + $this->messageManager->addSuccess(__('The attribute set has been removed.')); $resultRedirect->setPath('catalog/*/'); } catch (\Exception $e) { $this->messageManager->addError(__('We can\'t delete this set right now.')); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php index d40982a5d5641e8d2c3a3099015686f5435e52b8..8f7dafbf28892ece98cc1c430d81d92f3ab536cf 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php @@ -45,7 +45,7 @@ class Edit extends \Magento\Catalog\Controller\Adminhtml\Product\Set /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); $resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets'); - $resultPage->getConfig()->getTitle()->prepend(__('Product Templates')); + $resultPage->getConfig()->getTitle()->prepend(__('Attribute Sets')); $resultPage->getConfig()->getTitle()->prepend( $attributeSet->getId() ? $attributeSet->getAttributeSetName() : __('New Set') ); diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Index.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Index.php index 7b9edb21c7e2f8951643e51963411f2252b655a9..2e1e1a4b642f660595911445bc12a35777f82cf4 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Index.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Index.php @@ -37,9 +37,9 @@ class Index extends \Magento\Catalog\Controller\Adminhtml\Product\Set /** @var \Magento\Backend\Model\View\Result\Page $resultPage */ $resultPage = $this->resultPageFactory->create(); $resultPage->setActiveMenu('Magento_Catalog::catalog_attributes_sets'); - $resultPage->getConfig()->getTitle()->prepend(__('Product Templates')); + $resultPage->getConfig()->getTitle()->prepend(__('Attribute Sets')); $resultPage->addBreadcrumb(__('Catalog'), __('Catalog')); - $resultPage->addBreadcrumb(__('Manage Product Templates'), __('Product Templates')); + $resultPage->addBreadcrumb(__('Manage Attribute Sets'), __('Attribute Sets')); return $resultPage; } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php index 5870190db02b73a9bbae7b804d0ad1e75b8acfe5..480a079d53d7ee70d77f3f7f0c048a31d2cdaac6 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Save.php @@ -82,7 +82,7 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set } if (!$model->getId()) { throw new \Magento\Framework\Exception\LocalizedException( - __('This product template no longer exists.') + __('This attribute set no longer exists.') ); } $data = $this->_objectManager->get('Magento\Framework\Json\Helper\Data') @@ -100,12 +100,12 @@ class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Set $model->initFromSkeleton($this->getRequest()->getParam('skeleton_set')); } $model->save(); - $this->messageManager->addSuccess(__('You saved the product template.')); + $this->messageManager->addSuccess(__('You saved the attribute set.')); } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->messageManager->addError($e->getMessage()); $hasError = true; } catch (\Exception $e) { - $this->messageManager->addException($e, __('Something went wrong while saving the product template.')); + $this->messageManager->addException($e, __('Something went wrong while saving the attribute set.')); $hasError = true; } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestProductTemplates.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestAttributeSets.php similarity index 92% rename from app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestProductTemplates.php rename to app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestAttributeSets.php index d28b72799e770cebf089341b9749125141baefdf..456a579c6191d9a284e0cf7f5f16a99d38e317d3 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestProductTemplates.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/SuggestAttributeSets.php @@ -6,7 +6,7 @@ */ namespace Magento\Catalog\Controller\Adminhtml\Product; -class SuggestProductTemplates extends \Magento\Backend\App\Action +class SuggestAttributeSets extends \Magento\Backend\App\Action { /** * @var \Magento\Framework\Controller\Result\JsonFactory @@ -34,7 +34,7 @@ class SuggestProductTemplates extends \Magento\Backend\App\Action } /** - * Action for product template selector + * Action for attribute set selector * * @return \Magento\Framework\Controller\Result\Json */ diff --git a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php index a54b13b3d6fbc9742cfc1f9571bb9981b11c6849..b88dac52725b279759f938ea53cb5d789c5dfa5f 100644 --- a/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php +++ b/app/code/Magento/Catalog/Helper/Product/Flat/Indexer.php @@ -204,7 +204,7 @@ class Indexer extends \Magento\Framework\App\Helper\AbstractHelper 'unsigned' => true, 'nullable' => false, 'default' => '0', - 'comment' => 'Product Template ID', + 'comment' => 'Attribute Set ID', ]; $columns['type_id'] = [ 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, diff --git a/app/code/Magento/Catalog/Model/Product/AttributeSet/Build.php b/app/code/Magento/Catalog/Model/Product/AttributeSet/Build.php index 7c5be52e6d7e89e9d387a0d6c5e5d63f66af9d61..a70ae163575947f344ad368f1b56f950f56fe6b7 100644 --- a/app/code/Magento/Catalog/Model/Product/AttributeSet/Build.php +++ b/app/code/Magento/Catalog/Model/Product/AttributeSet/Build.php @@ -79,7 +79,7 @@ class Build $attributeSet = $this->attributeSetFactory->create(); $attributeSet->setEntityTypeId($this->entityTypeId)->load($this->name, 'attribute_set_name'); if ($attributeSet->getId()) { - throw new AlreadyExistsException(__('Product Template already exists.')); + throw new AlreadyExistsException(__('Attribute Set already exists.')); } $attributeSet->setAttributeSetName($this->name)->validate(); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product.php b/app/code/Magento/Catalog/Model/ResourceModel/Product.php index b4d5298035dadab55cb0158a5ef72d64226d4253..130cd77177306433c5a9202e3ae85906f03ed516 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product.php @@ -656,7 +656,7 @@ class Product extends AbstractResource $entityType = $this->typeFactory->create()->loadByCode(\Magento\Catalog\Model\Product::ENTITY); $attributeSet = $this->setFactory->create()->load($object->getAttributeSetId()); if ($attributeSet->getEntityTypeId() != $entityType->getId()) { - return ['attribute_set' => 'Invalid product template entity type']; + return ['attribute_set' => 'Invalid attribute set entity type']; } return parent::validate($object); diff --git a/app/code/Magento/Catalog/Setup/InstallSchema.php b/app/code/Magento/Catalog/Setup/InstallSchema.php index c507f35db664497d5a59c4f45a5e458833dde4d2..927dd2596cb2951597bb2b81e98ec24cd2913702 100644 --- a/app/code/Magento/Catalog/Setup/InstallSchema.php +++ b/app/code/Magento/Catalog/Setup/InstallSchema.php @@ -42,7 +42,7 @@ class InstallSchema implements InstallSchemaInterface \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, null, ['unsigned' => true, 'nullable' => false, 'default' => '0'], - 'Product Template ID' + 'Attribute Set ID' ) ->addColumn( 'type_id', diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Media/AttributeManagementTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Media/AttributeManagementTest.php index 3e8a85a77166a9facfa71e6aa0b011cd07bde981..cc65bb7803ba8d52983564708deb9ee0cdb779f4 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Media/AttributeManagementTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Media/AttributeManagementTest.php @@ -58,7 +58,7 @@ class AttributeManagementTest extends \PHPUnit_Framework_TestCase public function testGetList() { - $attributeSetName = 'Default Product Template'; + $attributeSetName = 'Default Attribute Set'; $expectedResult = [ $this->getMock('\Magento\Catalog\Api\Data\ProductAttributeInterface'), ]; diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/ProductTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/ProductTest.php index 9967344b70e8da0c9f50a1995647fa7afb3fd96d..d3c8792274104fc65aabdc4c72fce36acfc411b3 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/ProductTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/ResourceModel/ProductTest.php @@ -56,7 +56,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase public function testValidateWrongAttributeSet() { $productTypeId = 4; - $expectedErrorMessage = ['attribute_set' => 'Invalid product template entity type']; + $expectedErrorMessage = ['attribute_set' => 'Invalid attribute set entity type']; $productMock = $this->getMock( '\Magento\Framework\DataObject', diff --git a/app/code/Magento/Catalog/etc/acl.xml b/app/code/Magento/Catalog/etc/acl.xml index 0811d1393129b0dc6ef29ae61fc8793474b6bd78..0fc34da2584446847da5ab5234563d05c0ee8d46 100644 --- a/app/code/Magento/Catalog/etc/acl.xml +++ b/app/code/Magento/Catalog/etc/acl.xml @@ -24,7 +24,7 @@ <resource id="Magento_Backend::stores_attributes"> <resource id="Magento_Catalog::attributes_attributes" title="Product" sortOrder="30" /> <resource id="Magento_Catalog::update_attributes" title="Update Attributes" sortOrder="35" /> - <resource id="Magento_Catalog::sets" title="Product Template" sortOrder="40"/> + <resource id="Magento_Catalog::sets" title="Attribute Set" sortOrder="40"/> </resource> </resource> </resource> diff --git a/app/code/Magento/Catalog/etc/adminhtml/menu.xml b/app/code/Magento/Catalog/etc/adminhtml/menu.xml index 0d9783b0fea0af781b38b548aa6a26cf8abf00d7..53db61bd3a1ccdf477672bc10d74c00c76e8156f 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/menu.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/menu.xml @@ -11,7 +11,7 @@ <add id="Magento_Catalog::catalog_products" title="Catalog" module="Magento_Catalog" sortOrder="10" parent="Magento_Catalog::inventory" action="catalog/product/" resource="Magento_Catalog::products"/> <add id="Magento_Catalog::catalog_categories" title="Categories" module="Magento_Catalog" sortOrder="20" parent="Magento_Catalog::inventory" action="catalog/category/" resource="Magento_Catalog::categories"/> <add id="Magento_Catalog::catalog_attributes_attributes" title="Product" module="Magento_Catalog" sortOrder="30" parent="Magento_Backend::stores_attributes" action="catalog/product_attribute/" resource="Magento_Catalog::attributes_attributes"/> - <add id="Magento_Catalog::catalog_attributes_sets" title="Product Template" module="Magento_Catalog" sortOrder="40" parent="Magento_Backend::stores_attributes" action="catalog/product_set/" resource="Magento_Catalog::sets"/> + <add id="Magento_Catalog::catalog_attributes_sets" title="Attribute Set" module="Magento_Catalog" sortOrder="40" parent="Magento_Backend::stores_attributes" action="catalog/product_set/" resource="Magento_Catalog::sets"/> <add id="Magento_Catalog::inventory" title="Inventory" module="Magento_Catalog" sortOrder="10" parent="Magento_Catalog::catalog" dependsOnModule="Magento_Catalog" resource="Magento_Catalog::catalog"/> </menu> diff --git a/app/code/Magento/Catalog/i18n/de_DE.csv b/app/code/Magento/Catalog/i18n/de_DE.csv index ecbd2cb02116bf9af5c3f6ac5bae02811a89a110..835c5a2fa1b3305b8fc0e01ebf16d18ae6fbd9e6 100644 --- a/app/code/Magento/Catalog/i18n/de_DE.csv +++ b/app/code/Magento/Catalog/i18n/de_DE.csv @@ -160,7 +160,7 @@ Empty,Leer "Based On","Basierend auf" "Add New Attribute Set","Neuer Eigenschaftensatz hinzufügen" "Add New Set","Neuen Satz hinzufügen" -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window","Fenster Schließen" "New Product","Neues Produkt" "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,Kategorien "This attribute set no longer exists.","Dieses Eigenschaftenset existiert nicht mehr." "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.","Beim Speichern des Eigenschaftensatzes ist ein Fehler aufgetreten." -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/i18n/en_US.csv b/app/code/Magento/Catalog/i18n/en_US.csv index 2cfe7083932dd18f5c4e4082eb80fe321b2ee809..e6583169c3b1a16c97bf0eca7337860fe333ffc2 100644 --- a/app/code/Magento/Catalog/i18n/en_US.csv +++ b/app/code/Magento/Catalog/i18n/en_US.csv @@ -160,7 +160,7 @@ Empty,Empty "Based On","Based On" "Add New Attribute Set","Add New Attribute Set" "Add New Set","Add New Set" -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window","Close Window" "New Product","New Product" "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,Categories "This attribute set no longer exists.","This attribute set no longer exists." "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.","An error occurred while saving the attribute set." -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/i18n/es_ES.csv b/app/code/Magento/Catalog/i18n/es_ES.csv index 83b48a5ad10cb4176b43d2cd321bb4e2a15c1e94..2c45038e94f15121b8bad82417b80686d512e8b0 100644 --- a/app/code/Magento/Catalog/i18n/es_ES.csv +++ b/app/code/Magento/Catalog/i18n/es_ES.csv @@ -160,7 +160,7 @@ Empty,VacÃo(a) "Based On","Basado en" "Add New Attribute Set","Agregar nuevo conjunto de atributos" "Add New Set","Agregar nuevo conjunto" -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window","Cerrar Ventana" "New Product","Nuevo producto" "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,CategorÃas "This attribute set no longer exists.","Este conjunto de atributos ya no existe." "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.","Se produjo un error mientras se guardaba el conjunto de atributos." -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/i18n/fr_FR.csv b/app/code/Magento/Catalog/i18n/fr_FR.csv index 62cb82be609505db81ff49c6c1300a2416c2ed6c..37740e1e7db80830df449d9616672fcba40c8ca2 100644 --- a/app/code/Magento/Catalog/i18n/fr_FR.csv +++ b/app/code/Magento/Catalog/i18n/fr_FR.csv @@ -160,7 +160,7 @@ Empty,Vide "Based On","Basé sur" "Add New Attribute Set","Ajouter un nouveau jeu d'attributs" "Add New Set","Ajouter une nouvelle série" -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window","Fermer la fenêtre" "New Product","Nouveau produit" "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,catégories "This attribute set no longer exists.","La série d'attributs n'existe plus." "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.","Une erreur est survenue pendant la sauvegarde de la série d'attributs." -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/i18n/nl_NL.csv b/app/code/Magento/Catalog/i18n/nl_NL.csv index ee1eb9baee9d9cad43ceabb2583b62b7a104c181..650ef8463833457672dacf24b1c669ff075b7cf7 100644 --- a/app/code/Magento/Catalog/i18n/nl_NL.csv +++ b/app/code/Magento/Catalog/i18n/nl_NL.csv @@ -160,7 +160,7 @@ Empty,Leeg "Based On","Gebaseerd op" "Add New Attribute Set","Voeg Nieuwe Attribuut Set toe" "Add New Set","Voeg Nieuwe Reeks Toe" -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window","Venster Sluiten" "New Product","Nieuw Product" "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,Categoriën "This attribute set no longer exists.","Deze attribuutset bestaat niet meer." "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.","Er is een fout opgetreden tijdens het opslaan van de attribuut set." -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/i18n/pt_BR.csv b/app/code/Magento/Catalog/i18n/pt_BR.csv index 3e0887c87547d57e94da6a9b472d1ee69de8e43a..d2c337913df3a40bf24326c1a74b11fc5b634ca0 100644 --- a/app/code/Magento/Catalog/i18n/pt_BR.csv +++ b/app/code/Magento/Catalog/i18n/pt_BR.csv @@ -160,7 +160,7 @@ Empty,Vazio "Based On","Baseado Em" "Add New Attribute Set","Adicionar Novo Conjunto de Atributos" "Add New Set","Adicionar Novo Conjunto" -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window","Fechar Janela" "New Product","Novo Produto" "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,Categorias "This attribute set no longer exists.","Este conjunto de atributos não existe mais." "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.","Ocorreu um erro ao salvar o conjunto de atributos." -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/i18n/zh_Hans_CN.csv b/app/code/Magento/Catalog/i18n/zh_Hans_CN.csv index 4774b64706d9a98e98551936c7629de04c5050ac..ed8938feb0f02af531fbbdf9916ff33521d5c849 100644 --- a/app/code/Magento/Catalog/i18n/zh_Hans_CN.csv +++ b/app/code/Magento/Catalog/i18n/zh_Hans_CN.csv @@ -160,7 +160,7 @@ Empty,空 "Based On",基于 "Add New Attribute Set",æ·»åŠ æ–°å±žæ€§é›† "Add New Set",æ·»åŠ æ–°é›† -"Product Templates","Product Templates" +"Attribute Sets","Attribute Sets" "Close Window",å…³é—çª—å£ "New Product",æ–°äº§å“ "Save & Edit","Save & Edit" @@ -280,7 +280,7 @@ Categories,分类 "This attribute set no longer exists.",该属性已ä¸å˜åœ¨ã€‚ "You saved the attribute set.","You saved the attribute set." "An error occurred while saving the attribute set.",ä¿å˜å±žæ€§é›†æ—¶å‘生错误。 -"New Product Template","New Product Template" +"New Attribute Set","New Attribute Set" "The attribute set has been removed.","The attribute set has been removed." "An error occurred while deleting this set.","An error occurred while deleting this set." "Search Terms","Search Terms" diff --git a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml index 06edcfbaa2588ae285fac4a456ec0ae5c05b8846..dc12f76eb2f1a5b6d1da56c4f63acee1ee27a716 100644 --- a/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml @@ -354,7 +354,7 @@ rightBeforeAppend : function(tree, nodeThis, node, newParent) { if (node.attributes.is_user_defined == 0) { alert({ - content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('You can\'t remove attributes from this product template.')) ?>' + content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('You can\'t remove attributes from this attribute set.')) ?>' }); return false; } else { @@ -370,7 +370,7 @@ if (node.attributes.is_unassignable == 0) { alert({ - content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('You can\'t remove attributes from this product template.')) ?>' + content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('You can\'t remove attributes from this attribute set.')) ?>' }); return false; } else { diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product.php b/app/code/Magento/CatalogImportExport/Model/Import/Product.php index a2a98fcdbc51ed0b8c57a0a779da126b43bdff50..24475736833f8cbcbda2528614e5f3d3573b2e53 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product.php @@ -207,7 +207,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity ValidatorInterface::ERROR_INVALID_SCOPE => 'Invalid value in Scope column', ValidatorInterface::ERROR_INVALID_WEBSITE => 'Invalid value in Website column (website does not exists?)', ValidatorInterface::ERROR_INVALID_STORE => 'Invalid value in Store column (store doesn\'t exist?)', - ValidatorInterface::ERROR_INVALID_ATTR_SET => 'Invalid value for Product Template column (set doesn\'t exist?)', + ValidatorInterface::ERROR_INVALID_ATTR_SET => 'Invalid value for Attribute Set column (set doesn\'t exist?)', ValidatorInterface::ERROR_INVALID_TYPE => 'Product Type is invalid or not supported', ValidatorInterface::ERROR_INVALID_CATEGORY => 'Category does not exists', ValidatorInterface::ERROR_VALUE_IS_REQUIRED => 'Please make sure attribute "%s" is not empty.', @@ -217,7 +217,7 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity ValidatorInterface::ERROR_CHANGE_TYPE => 'Product type change is not allowed', ValidatorInterface::ERROR_DUPLICATE_SCOPE => 'Duplicate scope', ValidatorInterface::ERROR_DUPLICATE_SKU => 'Duplicate SKU', - ValidatorInterface::ERROR_CHANGE_ATTR_SET => 'Product template change is not allowed', + ValidatorInterface::ERROR_CHANGE_ATTR_SET => 'Attribute set change is not allowed', ValidatorInterface::ERROR_TYPE_UNSUPPORTED => 'Product type is not supported', ValidatorInterface::ERROR_ROW_IS_ORPHAN => 'Orphan rows that will be skipped due default row errors', ValidatorInterface::ERROR_INVALID_TIER_PRICE_QTY => 'Tier Price data price or quantity value is invalid', diff --git a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/ProductTemplate/Form.php b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/AttributeSet/Form.php similarity index 93% rename from app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/ProductTemplate/Form.php rename to app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/AttributeSet/Form.php index 09370fdce3e72ac650a640a1096bf6b62b8582a4..65c88dd19a05faeac5fc7ef50208bd646d94ad34 100644 --- a/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/ProductTemplate/Form.php +++ b/app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/AttributeSet/Form.php @@ -7,7 +7,7 @@ /** * Product attribute set selector form */ -namespace Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\ProductTemplate; +namespace Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\AttributeSet; class Form extends \Magento\Backend\Block\Widget\Form\Generic { @@ -57,7 +57,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'radio', [ 'after_element_html' => __( - 'Add configurable attributes to the current Product Template ("%1")', + 'Add configurable attributes to the current Attribute Set ("%1")', sprintf('<span data-role="name-container">%s</span>', $this->getCurrentAttributeSetName()) ), 'name' => 'affected-attribute-set', @@ -70,7 +70,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'new-affected-attribute-set', 'radio', [ - 'after_element_html' => __('Add configurable attributes to the new Product Template based on current'), + 'after_element_html' => __('Add configurable attributes to the new Attribute Set based on current'), 'name' => 'affected-attribute-set', 'class' => 'admin__control-radio', 'value' => 'new' @@ -80,7 +80,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'new-attribute-set-name', 'text', [ - 'label' => __('New product template name'), + 'label' => __('New attribute set name'), 'name' => 'new-attribute-set-name', 'required' => true, 'css_class' => 'no-display', @@ -92,7 +92,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'existing-affected-attribute-set', 'radio', [ - 'after_element_html' => __('Add configurable attributes to the existing Product Template'), + 'after_element_html' => __('Add configurable attributes to the existing Attribute Set'), 'name' => 'affected-attribute-set', 'required' => true, 'class' => 'admin__control-radio no-display', @@ -103,7 +103,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'choose-affected-attribute-set', 'select', [ - 'label' => __('Choose existing Product Template'), + 'label' => __('Choose existing Attribute Set'), 'name' => 'attribute-set-name', 'required' => true, 'css_class' => 'no-display', diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml index b6683bdeca4a7f6866a9adc90581af1e59afc2f4..322360d8703f9e443d3537c72576dbd42b29d7a9 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/layout/catalog_product_new.xml @@ -16,7 +16,7 @@ </referenceContainer> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="affected-attribute-set-selector" template="Magento_ConfigurableProduct::product/configurable/affected-attribute-set-selector/form.phtml"> - <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\ProductTemplate\Form" name="affected-attribute-set-form" /> + <block class="Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\AttributeSet\Form" name="affected-attribute-set-form" /> </block> </referenceContainer> </body> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml index ea036bbf5d6c0eedfd3cb70d46125ac1d9c80938..c9aeeddfd2b308a70cf84347113ca4c3a5437a00 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/attribute/set/js.phtml @@ -40,7 +40,7 @@ editSet.submit = editSet.submit.wrap(function(original) { editSet.rightBeforeAppend = editSet.rightBeforeAppend.wrap(function(original, tree, nodeThis, node, newParent) { if (node.attributes.is_configurable == 1) { alert({ - content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('This attribute is used in configurable products. You cannot remove it from the product template.')) ?>' + content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>' }); return false; } @@ -50,7 +50,7 @@ editSet.rightBeforeAppend = editSet.rightBeforeAppend.wrap(function(original, tr editSet.rightBeforeInsert = editSet.rightBeforeInsert.wrap(function(original, tree, nodeThis, node, newParent) { if (node.attributes.is_configurable == 1) { alert({ - content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('This attribute is used in configurable products. You cannot remove it from the product template.')) ?>' + content: '<?php /* @escapeNotVerified */ echo $block->escapeJsQuote(__('This attribute is used in configurable products. You cannot remove it from the attribute set.')) ?>' }); return false; } diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml index 3f192bc072f9a7f9fa54393cf3eb22d9bc5eaa77..4716938b4a0942d305a2a529e2ea29d995dc8366 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/affected-attribute-set-selector/js.phtml @@ -48,7 +48,7 @@ $form .modal({ - title: '<?php /* @escapeNotVerified */ echo __('Choose Affected Product Template'); ?>', + title: '<?php /* @escapeNotVerified */ echo __('Choose Affected Attribute Set'); ?>', closed: function () { resetValidation(); }, 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/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php index df81fff83bd338742a921f399696ba8a58f9dcd2..f8b577df7c12c971b564084e76211ce3744ba1ca 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php @@ -8,20 +8,54 @@ namespace Magento\Paypal\Block\Adminhtml\Billing\Agreement\View\Tab; +use Magento\Paypal\Model\ResourceModel\Billing\Agreement as BillingAgreementResource; +use Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory; +use Magento\Backend\Block\Widget\Grid\Extended as ExtendedGrid; +use Magento\Backend\Block\Widget\Tab\TabInterface; +use Magento\Backend\Block\Template\Context as TemplateContext; +use Magento\Backend\Helper\Data as BackendHelper; +use Magento\Framework\Registry; + /** * Adminhtml billing agreement related orders tab */ -class Orders extends \Magento\Framework\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface +class Orders extends ExtendedGrid implements TabInterface { /** - * Initialize grid params - * - * @return void + * @var CollectionFactory */ - protected function _construct() - { - parent::_construct(); - $this->setId('billing_agreement_orders'); + protected $collectionFactory; + + /** + * @var Registry + */ + protected $coreRegistry; + + /** + * @var BillingAgreementResource + */ + protected $billingAgreementResource; + + /** + * @param TemplateContext $context + * @param BackendHelper $backendHelper + * @param CollectionFactory $collectionFactory + * @param Registry $coreRegistry + * @param BillingAgreementResource $billingAgreementResource + * @param array $data + */ + public function __construct( + TemplateContext $context, + BackendHelper $backendHelper, + CollectionFactory $collectionFactory, + Registry $coreRegistry, + BillingAgreementResource $billingAgreementResource, + array $data = [] + ) { + $this->coreRegistry = $coreRegistry; + $this->collectionFactory = $collectionFactory; + $this->billingAgreementResource = $billingAgreementResource; + parent::__construct($context, $backendHelper, $data); } /** @@ -55,4 +89,82 @@ class Orders extends \Magento\Framework\View\Element\Text\ListText implements \M { return false; } + + /** + * {@inheritdoc} + */ + protected function _construct() + { + parent::_construct(); + $this->setId('billing_agreement_orders'); + $this->setUseAjax(true); + } + + /** + * Apply various selection filters to prepare the sales order grid collection. + * + * @return $this + */ + protected function _prepareCollection() + { + $billingAgreement = $this->coreRegistry->registry('current_billing_agreement'); + if ($billingAgreement) { + $collection = $this->collectionFactory->getReport('sales_order_grid_data_source')->addFieldToSelect( + 'entity_id' + )->addFieldToSelect( + 'increment_id' + )->addFieldToSelect( + 'customer_id' + )->addFieldToSelect( + 'created_at' + )->addFieldToSelect( + 'grand_total' + )->addFieldToSelect( + 'order_currency_code' + )->addFieldToSelect( + 'store_id' + )->addFieldToSelect( + 'billing_name' + )->addFieldToSelect( + 'shipping_name' + ); + $this->billingAgreementResource->addOrdersFilter($collection, $billingAgreement->getId()); + $this->setCollection($collection); + } + return parent::_prepareCollection(); + } + + /** + * {@inheritdoc} + */ + protected function _prepareColumns() + { + $this->addColumn('increment_id', ['header' => __('Order'), 'width' => '100', 'index' => 'increment_id']); + + $this->addColumn( + 'created_at', + ['header' => __('Purchased'), 'index' => 'created_at', 'type' => 'datetime'] + ); + + $this->addColumn('billing_name', ['header' => __('Bill-to Name'), 'index' => 'billing_name']); + $this->addColumn('shipping_name', ['header' => __('Ship-to Name'), 'index' => 'shipping_name']); + + $this->addColumn( + 'grand_total', + [ + 'header' => __('Order Total'), + 'index' => 'grand_total', + 'type' => 'currency', + 'currency' => 'order_currency_code' + ] + ); + + if (!$this->_storeManager->isSingleStoreMode()) { + $this->addColumn( + 'store_id', + ['header' => __('Purchase Point'), 'index' => 'store_id', 'type' => 'store', 'store_view' => true] + ); + } + return parent::_prepareColumns(); + } } diff --git a/app/code/Magento/Paypal/Model/ResourceModel/Billing/Agreement.php b/app/code/Magento/Paypal/Model/ResourceModel/Billing/Agreement.php index 6f714ae437e605c3836c55a0aa430a845b1f23fd..5344091f837bf0664b7a817dcd849c53a66de105 100644 --- a/app/code/Magento/Paypal/Model/ResourceModel/Billing/Agreement.php +++ b/app/code/Magento/Paypal/Model/ResourceModel/Billing/Agreement.php @@ -39,11 +39,11 @@ class Agreement extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb /** * Add billing agreement filter on orders collection * - * @param \Magento\Sales\Model\ResourceModel\Order\Collection $orderCollection + * @param \Magento\Framework\Data\Collection\AbstractDb $orderCollection * @param string|int|array $agreementIds * @return $this */ - public function addOrdersFilter(\Magento\Sales\Model\ResourceModel\Order\Collection $orderCollection, $agreementIds) + public function addOrdersFilter(\Magento\Framework\Data\Collection\AbstractDb $orderCollection, $agreementIds) { $agreementIds = is_array($agreementIds) ? $agreementIds : [$agreementIds]; $orderCollection->getSelect()->joinInner( 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/Rule/Model/Condition/Product/AbstractProduct.php b/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php index c2184950d83e0ee967732fca8ded9c21e03655ac..784a78e5a4caeba2498b2451214d008e1acfd2ad 100644 --- a/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php +++ b/app/code/Magento/Rule/Model/Condition/Product/AbstractProduct.php @@ -153,7 +153,7 @@ abstract class AbstractProduct extends \Magento\Rule\Model\Condition\AbstractCon */ protected function _addSpecialAttributes(array &$attributes) { - $attributes['attribute_set_id'] = __('Product Template'); + $attributes['attribute_set_id'] = __('Attribute Set'); $attributes['category_ids'] = __('Category'); } diff --git a/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php b/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php index d7c1f067cc046997e5fedc2901a803dee5757aa7..bc8cda48f2b216ecb5a5f00a40bd049eb8848a1e 100644 --- a/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoCommentRepositoryInterface.php @@ -32,10 +32,10 @@ interface CreditmemoCommentRepositoryInterface * * Returns a credit memo comment search results interface. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\CreditmemoCommentSearchResultInterface Credit memo comment search results interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Deletes a specified credit memo comment. diff --git a/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php b/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php index b322cc7b68f48f26651dfd462ee085be56c5ac40..9921c53a8438537d65923d25cb153ecd11523b04 100644 --- a/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoItemRepositoryInterface.php @@ -27,10 +27,10 @@ interface CreditmemoItemRepositoryInterface /** * Lists credit memo items that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\CreditmemoItemSearchResultInterface Credit memo item search results interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Deletes a specified credit memo item. diff --git a/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php b/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php index 551f48488869ec27090402719588374cbb88cd0c..b2d7aab6eb09f3facf2f69e589cb9dfe3d7f721c 100644 --- a/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoManagementInterface.php @@ -48,12 +48,10 @@ interface CreditmemoManagementInterface * * @param \Magento\Sales\Api\Data\CreditmemoInterface $creditmemo * @param bool $offlineRequested - * @param bool $notifyCustomer * @return \Magento\Sales\Api\Data\CreditmemoInterface */ public function refund( \Magento\Sales\Api\Data\CreditmemoInterface $creditmemo, - $offlineRequested = false, - $notifyCustomer = false + $offlineRequested = false ); } diff --git a/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php b/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php index 8bb487d732299972229da96cbee376258ab580ad..e1577630215c42a3010af96f96e2fba988cedc39 100644 --- a/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/CreditmemoRepositoryInterface.php @@ -18,10 +18,10 @@ interface CreditmemoRepositoryInterface /** * Lists credit memos that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\CreditmemoSearchResultInterface Credit memo search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified credit memo. diff --git a/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php b/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php index f256bb88af2ab2fd0f57dc8c7603c7eea67ebeda..d9d698b987b61f99ef8c0e1f10d429dc92e48300 100644 --- a/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceCommentRepositoryInterface.php @@ -17,10 +17,10 @@ interface InvoiceCommentRepositoryInterface /** * Lists invoice comments that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\InvoiceCommentSearchResultInterface Invoice search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified invoice comment. diff --git a/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php b/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php index 90ae5cea092df03f80ce641764fe2141fb8211e8..510623d1932ba5258a4233efc2cd244e76150844 100644 --- a/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceItemRepositoryInterface.php @@ -16,10 +16,10 @@ interface InvoiceItemRepositoryInterface /** * Lists the invoice items that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria * @return \Magento\Sales\Api\Data\InvoiceItemSearchResultInterface */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified invoice item. diff --git a/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php b/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php index 0fa5f268be6429360a289232c6e49f0c56f9ae08..9b864ba2ea380b6c77d61fc311b245c370ab7df4 100644 --- a/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/InvoiceRepositoryInterface.php @@ -16,10 +16,10 @@ interface InvoiceRepositoryInterface /** * Lists invoices that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\InvoiceSearchResultInterface Invoice search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Return Invoice object diff --git a/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php index 5c3db02774762f0296206d736bb917d1d8078d82..8071ec0c4894c2372adace78d317302fdba3cc31 100644 --- a/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderAddressRepositoryInterface.php @@ -18,10 +18,10 @@ interface OrderAddressRepositoryInterface /** * Lists order addresses that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\OrderAddressSearchResultInterface Order address search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified order address. diff --git a/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php index e1832a09e5568c47194b0e79a32cc1a12b4746fc..6355db859bbcf2fd1ccd223375f5a31c41e888aa 100644 --- a/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderItemRepositoryInterface.php @@ -18,10 +18,10 @@ interface OrderItemRepositoryInterface /** * Lists order items that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\OrderItemSearchResultInterface Order item search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified order item. diff --git a/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php index e4ff2acf54ba627fcdedfa402021460c12e20020..005de16342db398b9e4e8afda49ff6f3ab21f7bd 100644 --- a/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderPaymentRepositoryInterface.php @@ -18,10 +18,10 @@ interface OrderPaymentRepositoryInterface /** * Lists order payments that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\OrderPaymentSearchResultInterface Order payment search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified order payment. diff --git a/app/code/Magento/Sales/Api/OrderRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderRepositoryInterface.php index d8420ce0da7294626a3567db9f2001ae54bd89ba..50a683b43715356ac8371146f42bae2cadf04e5f 100644 --- a/app/code/Magento/Sales/Api/OrderRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderRepositoryInterface.php @@ -18,10 +18,10 @@ interface OrderRepositoryInterface /** * Lists orders that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\OrderSearchResultInterface Order search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified order. diff --git a/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php b/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php index b99bf0dc2c729d7f97aef8560a7e0511769a4fb7..743f9aaa734e94ddc8a867071a40423685886294 100644 --- a/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/OrderStatusHistoryRepositoryInterface.php @@ -21,10 +21,10 @@ interface OrderStatusHistoryRepositoryInterface /** * Lists order status history comments that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface Order status history search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified order status comment. diff --git a/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php index e6605c9c5dd24267466d846eb82fd2a3e342d91a..9ca3bb336f268c515e91d4365fc2b9c01056bd14 100644 --- a/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentCommentRepositoryInterface.php @@ -17,10 +17,10 @@ interface ShipmentCommentRepositoryInterface /** * Lists shipment comments that match specific search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\ShipmentCommentSearchResultInterface Shipment comment search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified shipment comment. diff --git a/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php index 0db3adabf885cdd1fcf0c4059d19958151554530..5d2d3946a91971c23256a720b0258213ae1bcb58 100644 --- a/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentItemRepositoryInterface.php @@ -17,10 +17,10 @@ interface ShipmentItemRepositoryInterface /** * Lists shipment items that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\ShipmentItemSearchResultInterface Shipment item search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified shipment item. diff --git a/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php index 1cfa85d87e66facb2affe05c8541a8a96982c68f..858347a6f166d47255572bc92064924c3a42efc7 100644 --- a/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentRepositoryInterface.php @@ -17,10 +17,10 @@ interface ShipmentRepositoryInterface /** * Lists shipments that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\ShipmentSearchResultInterface Shipment search results interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified shipment. diff --git a/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php b/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php index 5d7817b0c828d997707e9b826c2a7890aa305bc2..ada64b54d862fbabdb3a514e03a73b29172be1e9 100644 --- a/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/ShipmentTrackRepositoryInterface.php @@ -17,10 +17,10 @@ interface ShipmentTrackRepositoryInterface /** * Lists shipment tracks that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\ShipmentTrackSearchResultInterface Shipment track search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified shipment track. diff --git a/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php b/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php index 7a256e7deaf7ccc55bfd07ec8baf8625d17529e1..be5315f1329cc64f18ca3a2e65459e33d62bc6e5 100644 --- a/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php +++ b/app/code/Magento/Sales/Api/TransactionRepositoryInterface.php @@ -16,10 +16,10 @@ interface TransactionRepositoryInterface /** * Lists transactions that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\TransactionSearchResultInterface Transaction search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria); + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria); /** * Loads a specified transaction. diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php index 1ee0386f871101b753d45cfd6814540cae15016c..4af19b69b136158103c391443fce0e8cc37163c0 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php @@ -160,8 +160,8 @@ class Address extends \Magento\Sales\Block\Adminhtml\Order\Create\Form\AbstractF ->setConditionType('eq') ->create(); $this->searchCriteriaBuilder->addFilters([$filter]); - $criteria = $this->searchCriteriaBuilder->create(); - $result = $this->addressService->getList($criteria); + $searchCriteria = $this->searchCriteriaBuilder->create(); + $result = $this->addressService->getList($searchCriteria); return $result->getItems(); } return []; diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php index e3d15fd93cdd6765c1c3aa3739603db07ac23f95..b10329e70d376ff7be228e65a9d99f5c686f42e0 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddressSave.php @@ -16,13 +16,20 @@ class AddressSave extends \Magento\Sales\Controller\Adminhtml\Order public function execute() { $addressId = $this->getRequest()->getParam('address_id'); - $address = $this->_objectManager->create('Magento\Sales\Model\Order\Address')->load($addressId); + /** @var $address \Magento\Sales\Api\Data\OrderAddressInterface|\Magento\Sales\Model\Order\Address */ + $address = $this->_objectManager->create('Magento\Sales\Api\Data\OrderAddressInterface')->load($addressId); $data = $this->getRequest()->getPostValue(); $resultRedirect = $this->resultRedirectFactory->create(); if ($data && $address->getId()) { $address->addData($data); try { $address->save(); + $this->_eventManager->dispatch( + 'admin_sales_order_address_update', + [ + 'order_id' => $address->getParentId() + ] + ); $this->messageManager->addSuccess(__('You updated the order address.')); return $resultRedirect->setPath('sales/*/view', ['order_id' => $address->getParentId()]); } catch (\Magento\Framework\Exception\LocalizedException $e) { diff --git a/app/code/Magento/Sales/Model/Order/AddressRepository.php b/app/code/Magento/Sales/Model/Order/AddressRepository.php index 2e4c9df86fa22c97348f932c07b1d8dc41d46d46..ec5a39bce3b6c290d88bf0569d5af6d8d5082ba5 100644 --- a/app/code/Magento/Sales/Model/Order/AddressRepository.php +++ b/app/code/Magento/Sales/Model/Order/AddressRepository.php @@ -14,6 +14,8 @@ use Magento\Framework\Exception\InputException; /** * Repository class for @see \Magento\Sales\Api\Data\OrderAddressInterface + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class AddressRepository implements \Magento\Sales\Api\OrderAddressRepositoryInterface { @@ -77,24 +79,24 @@ class AddressRepository implements \Magento\Sales\Api\OrderAddressRepositoryInte /** * Find order addresses by criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria * @return \Magento\Sales\Api\Data\OrderAddressInterface[] */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { //@TODO: fix search logic /** @var \Magento\Sales\Api\Data\OrderAddressSearchResultInterface $searchResult */ $searchResult = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $searchResult->setCurPage($criteria->getCurrentPage()); - $searchResult->setPageSize($criteria->getPageSize()); + $searchResult->setCurPage($searchCriteria->getCurrentPage()); + $searchResult->setPageSize($searchCriteria->getPageSize()); return $searchResult; } diff --git a/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php b/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php index 200a57a73fff5804e589b9688d1ecc443db061e1..c9621a7e668d34ec8ae53db42e0051c8e4e59c07 100644 --- a/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php +++ b/app/code/Magento/Sales/Model/Order/CreditmemoRepository.php @@ -87,21 +87,21 @@ class CreditmemoRepository implements \Magento\Sales\Api\CreditmemoRepositoryInt /** * Lists credit memos that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\CreditmemoSearchResultInterface Credit memo search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { /** @var \Magento\Sales\Api\Data\CreditmemoSearchResultInterface $searchResult */ $searchResult = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $searchResult->setCurPage($criteria->getCurrentPage()); - $searchResult->setPageSize($criteria->getPageSize()); + $searchResult->setCurPage($searchCriteria->getCurrentPage()); + $searchResult->setPageSize($searchCriteria->getPageSize()); return $searchResult; } diff --git a/app/code/Magento/Sales/Model/Order/InvoiceRepository.php b/app/code/Magento/Sales/Model/Order/InvoiceRepository.php index 04275723bda95706d78cf85f717bb195dbbbf6ff..6ac147108bb73a6da51fb8aeb22f803ef63c151c 100644 --- a/app/code/Magento/Sales/Model/Order/InvoiceRepository.php +++ b/app/code/Magento/Sales/Model/Order/InvoiceRepository.php @@ -83,21 +83,21 @@ class InvoiceRepository implements InvoiceRepositoryInterface /** * Find entities by criteria * - * @param \Magento\Framework\Api\SearchCriteria $criteria + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria * @return \Magento\Sales\Api\Data\InvoiceInterface[] */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { /** @var \Magento\Sales\Model\ResourceModel\Order\Invoice\Collection $collection */ $collection = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $collection->setCurPage($criteria->getCurrentPage()); - $collection->setPageSize($criteria->getPageSize()); + $collection->setCurPage($searchCriteria->getCurrentPage()); + $collection->setPageSize($searchCriteria->getPageSize()); return $collection; } diff --git a/app/code/Magento/Sales/Model/Order/ItemRepository.php b/app/code/Magento/Sales/Model/Order/ItemRepository.php index 776b862828658da8092d992697e790599941c770..983a87834fabfde0ba471c20c2a42ebbc6ca5b5c 100644 --- a/app/code/Magento/Sales/Model/Order/ItemRepository.php +++ b/app/code/Magento/Sales/Model/Order/ItemRepository.php @@ -114,16 +114,16 @@ class ItemRepository implements OrderItemRepositoryInterface /** * Find entities by criteria * - * @param SearchCriteria $criteria + * @param SearchCriteria $searchCriteria * @return OrderItemInterface[] */ - public function getList(SearchCriteria $criteria) + public function getList(SearchCriteria $searchCriteria) { /** @var OrderItemSearchResultInterface $searchResult */ $searchResult = $this->searchResultFactory->create(); - $searchResult->setSearchCriteria($criteria); + $searchResult->setSearchCriteria($searchCriteria); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); diff --git a/app/code/Magento/Sales/Model/Order/Payment/Repository.php b/app/code/Magento/Sales/Model/Order/Payment/Repository.php index 2517c4b9adbcc1aca5b648f7ad4974645624220c..ef3fb08b5daa1b4980a9ef2a34fd43bcd59fcd6b 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Repository.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Repository.php @@ -47,21 +47,21 @@ class Repository implements OrderPaymentRepositoryInterface /** * Lists order payments that match specified search criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria The search criteria. + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria The search criteria. * @return \Magento\Sales\Api\Data\OrderPaymentSearchResultInterface Order payment search result interface. */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { /** @var \Magento\Sales\Model\ResourceModel\Order\Payment\Collection $collection */ $collection = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $collection->setCurPage($criteria->getCurrentPage()); - $collection->setPageSize($criteria->getPageSize()); + $collection->setCurPage($searchCriteria->getCurrentPage()); + $collection->setPageSize($searchCriteria->getPageSize()); return $collection; } diff --git a/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php b/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php index 051ab5401d59fda4ded3f0af78bab2869e526617..a3550d6073ecd8f5040e230c5f350ea4ec0eb2ab 100644 --- a/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php +++ b/app/code/Magento/Sales/Model/Order/Payment/Transaction/Repository.php @@ -185,18 +185,18 @@ class Repository implements TransactionRepositoryInterface /** * {@inheritdoc} */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { /** @var TransactionResource\Collection $collection */ $collection = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $collection->setCurPage($criteria->getCurrentPage()); - $collection->setPageSize($criteria->getPageSize()); + $collection->setCurPage($searchCriteria->getCurrentPage()); + $collection->setPageSize($searchCriteria->getPageSize()); $collection->addPaymentInformation(['method']); $collection->addOrderInformation(['increment_id']); return $collection; diff --git a/app/code/Magento/Sales/Model/Order/ShipmentRepository.php b/app/code/Magento/Sales/Model/Order/ShipmentRepository.php index c44fa79ae56c7525b36bd8fa9a2f15ffa0206946..9cb32363b480fcdd1c69c673f37c3fd9cf5a54a6 100644 --- a/app/code/Magento/Sales/Model/Order/ShipmentRepository.php +++ b/app/code/Magento/Sales/Model/Order/ShipmentRepository.php @@ -14,6 +14,8 @@ use Magento\Framework\Exception\InputException; /** * Repository class for @see \Magento\Sales\Api\Data\ShipmentInterface + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class ShipmentRepository implements \Magento\Sales\Api\ShipmentRepositoryInterface { @@ -77,24 +79,24 @@ class ShipmentRepository implements \Magento\Sales\Api\ShipmentRepositoryInterfa /** * Find shipments by criteria. * - * @param \Magento\Framework\Api\SearchCriteria $criteria + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria * @return \Magento\Sales\Api\Data\ShipmentInterface[] */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { //@TODO: fix search logic /** @var \Magento\Sales\Api\Data\ShipmentSearchResultInterface $searchResult */ $searchResult = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $searchResult->setCurPage($criteria->getCurrentPage()); - $searchResult->setPageSize($criteria->getPageSize()); + $searchResult->setCurPage($searchCriteria->getCurrentPage()); + $searchResult->setPageSize($searchCriteria->getPageSize()); return $searchResult; } diff --git a/app/code/Magento/Sales/Model/OrderRepository.php b/app/code/Magento/Sales/Model/OrderRepository.php index 976a03486a4f1ead05696c96dfc28ba9652f2d68..1d4a7b8e66a9a72b902636aae8efc8ae919a3204 100644 --- a/app/code/Magento/Sales/Model/OrderRepository.php +++ b/app/code/Magento/Sales/Model/OrderRepository.php @@ -73,22 +73,22 @@ class OrderRepository implements \Magento\Sales\Api\OrderRepositoryInterface /** * Find entities by criteria * - * @param \Magento\Framework\Api\SearchCriteria $criteria + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria * @return \Magento\Sales\Api\Data\OrderInterface[] */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { //@TODO: fix search logic /** @var \Magento\Sales\Api\Data\OrderSearchResultInterface $searchResult */ $searchResult = $this->searchResultFactory->create(); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $searchResult->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $searchResult->setCurPage($criteria->getCurrentPage()); - $searchResult->setPageSize($criteria->getPageSize()); + $searchResult->setCurPage($searchCriteria->getCurrentPage()); + $searchResult->setPageSize($searchCriteria->getPageSize()); return $searchResult; } diff --git a/app/code/Magento/Sales/Model/ResourceModel/Order/Address.php b/app/code/Magento/Sales/Model/ResourceModel/Order/Address.php index 6df065f7ee30372b130c002875fb0518d266a8ca..625fe5e2b342f629ca0f62df308687c6d132c7e4 100644 --- a/app/code/Magento/Sales/Model/ResourceModel/Order/Address.php +++ b/app/code/Magento/Sales/Model/ResourceModel/Order/Address.php @@ -122,19 +122,4 @@ class Address extends SalesResource implements OrderAddressResourceInterface } return $this; } - - /** - * Update related grid table after object save - * - * @param \Magento\Framework\Model\AbstractModel|\Magento\Framework\DataObject $object - * @return \Magento\Framework\Model\ResourceModel\Db\AbstractDb - */ - protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) - { - $resource = parent::_afterSave($object); - if ($object->getParentId()) { - $this->gridPool->refreshByOrderId($object->getParentId()); - } - return $resource; - } } diff --git a/app/code/Magento/Sales/Model/Service/CreditmemoService.php b/app/code/Magento/Sales/Model/Service/CreditmemoService.php index ea0e1ed82d1b3321648f2507ae646098cc620c8d..1993e1d1cae54bd62b2c4a2d632589c89f28cfd9 100644 --- a/app/code/Magento/Sales/Model/Service/CreditmemoService.php +++ b/app/code/Magento/Sales/Model/Service/CreditmemoService.php @@ -108,8 +108,8 @@ class CreditmemoService implements \Magento\Sales\Api\CreditmemoManagementInterf $this->searchCriteriaBuilder->addFilters( [$this->filterBuilder->setField('parent_id')->setValue($id)->setConditionType('eq')->create()] ); - $criteria = $this->searchCriteriaBuilder->create(); - return $this->commentRepository->getList($criteria); + $searchCriteria = $this->searchCriteriaBuilder->create(); + return $this->commentRepository->getList($searchCriteria); } /** @@ -129,13 +129,11 @@ class CreditmemoService implements \Magento\Sales\Api\CreditmemoManagementInterf * * @param \Magento\Sales\Api\Data\CreditmemoInterface $creditmemo * @param bool $offlineRequested - * @param bool $notifyCustomer * @return \Magento\Sales\Api\Data\CreditmemoInterface */ public function refund( \Magento\Sales\Api\Data\CreditmemoInterface $creditmemo, - $offlineRequested = false, - $notifyCustomer = false + $offlineRequested = false ) { $this->validateForRefund($creditmemo); $creditmemo->setState(\Magento\Sales\Model\Order\Creditmemo::STATE_REFUNDED); diff --git a/app/code/Magento/Sales/Model/Service/InvoiceService.php b/app/code/Magento/Sales/Model/Service/InvoiceService.php index 5c07bf365e9fb1669804dd81b554c79af88d8a62..7352d0f221e330110014f371c5a62713b496addf 100644 --- a/app/code/Magento/Sales/Model/Service/InvoiceService.php +++ b/app/code/Magento/Sales/Model/Service/InvoiceService.php @@ -103,8 +103,8 @@ class InvoiceService implements InvoiceManagementInterface $this->criteriaBuilder->addFilters( [$this->filterBuilder->setField('parent_id')->setValue($id)->setConditionType('eq')->create()] ); - $criteria = $this->criteriaBuilder->create(); - return $this->commentRepository->getList($criteria); + $searchCriteria = $this->criteriaBuilder->create(); + return $this->commentRepository->getList($searchCriteria); } /** diff --git a/app/code/Magento/Sales/Model/Service/OrderService.php b/app/code/Magento/Sales/Model/Service/OrderService.php index 5df21bf9df691206d6bcd6f64fc4b9264c940e1a..29b719a1873a6144d7e83853d8a47316bc9349c7 100644 --- a/app/code/Magento/Sales/Model/Service/OrderService.php +++ b/app/code/Magento/Sales/Model/Service/OrderService.php @@ -44,6 +44,11 @@ class OrderService implements OrderManagementInterface */ protected $eventManager; + /** + * @var \Magento\Sales\Model\Order\Email\Sender\OrderCommentSender + */ + protected $orderCommentSender; + /** * Constructor * @@ -53,6 +58,7 @@ class OrderService implements OrderManagementInterface * @param \Magento\Framework\Api\FilterBuilder $filterBuilder * @param \Magento\Sales\Model\OrderNotifier $notifier * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\Sales\Model\Order\Email\Sender\OrderCommentSender $orderCommentSender */ public function __construct( \Magento\Sales\Api\OrderRepositoryInterface $orderRepository, @@ -60,7 +66,8 @@ class OrderService implements OrderManagementInterface \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder, \Magento\Framework\Api\FilterBuilder $filterBuilder, \Magento\Sales\Model\OrderNotifier $notifier, - \Magento\Framework\Event\ManagerInterface $eventManager + \Magento\Framework\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Order\Email\Sender\OrderCommentSender $orderCommentSender ) { $this->orderRepository = $orderRepository; $this->historyRepository = $historyRepository; @@ -68,6 +75,7 @@ class OrderService implements OrderManagementInterface $this->filterBuilder = $filterBuilder; $this->notifier = $notifier; $this->eventManager = $eventManager; + $this->orderCommentSender = $orderCommentSender; } /** @@ -98,8 +106,8 @@ class OrderService implements OrderManagementInterface $this->criteriaBuilder->addFilters( [$this->filterBuilder->setField('parent_id')->setValue($id)->setConditionType('eq')->create()] ); - $criteria = $this->criteriaBuilder->create(); - return $this->historyRepository->getList($criteria); + $searchCriteria = $this->criteriaBuilder->create(); + return $this->historyRepository->getList($searchCriteria); } /** @@ -114,6 +122,9 @@ class OrderService implements OrderManagementInterface $order = $this->orderRepository->get($id); $order->addStatusHistory($statusHistory); $this->orderRepository->save($order); + $notify = isset($statusHistory['is_customer_notified']) ? $statusHistory['is_customer_notified'] : false; + $comment = trim(strip_tags($statusHistory->getComment())); + $this->orderCommentSender->send($order, $notify, $comment); return true; } diff --git a/app/code/Magento/Sales/Model/Service/ShipmentService.php b/app/code/Magento/Sales/Model/Service/ShipmentService.php index 6523e8e83825e5112286d787a1f15bdff3e394bd..62593c1b1d0dc58165dafe3453291e13fcf0a123 100644 --- a/app/code/Magento/Sales/Model/Service/ShipmentService.php +++ b/app/code/Magento/Sales/Model/Service/ShipmentService.php @@ -91,8 +91,8 @@ class ShipmentService implements ShipmentManagementInterface $this->criteriaBuilder->addFilters( [$this->filterBuilder->setField('parent_id')->setValue($id)->setConditionType('eq')->create()] ); - $criteria = $this->criteriaBuilder->create(); - return $this->commentRepository->getList($criteria); + $searchCriteria = $this->criteriaBuilder->create(); + return $this->commentRepository->getList($searchCriteria); } /** diff --git a/app/code/Magento/Sales/Observer/GridProcessAddressChange.php b/app/code/Magento/Sales/Observer/GridProcessAddressChange.php new file mode 100644 index 0000000000000000000000000000000000000000..e053801290dbefb220c3e89af178495533ba24b4 --- /dev/null +++ b/app/code/Magento/Sales/Observer/GridProcessAddressChange.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Sales\Observer; + +use Magento\Framework\Event\Observer as EventObserver; +use Magento\Sales\Model\ResourceModel\GridPool; +use Magento\Framework\Event\ObserverInterface; + +/** + * Class GridProcessAddressChange + */ +class GridProcessAddressChange implements ObserverInterface +{ + + /** + * @var GridPool + */ + protected $gridPool; + + /** + * @param GridPool $gridPool + */ + public function __construct( + GridPool $gridPool + ) { + $this->gridPool= $gridPool; + } + + /** + * Refresh addresses in grids according to performed changed + * This is manual admin action, as result we perform this operation without delay + * + * @param EventObserver $observer + * @return void + */ + public function execute(EventObserver $observer) + { + $this->gridPool->refreshByOrderId($observer->getOrderId()); + } +} diff --git a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php index 4a2ef97a19764b757f6de4da62500cbfeee27653..0cb9a4dc715765cc8c9311d12218e244e28f0d72 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/InvoiceRepositoryTest.php @@ -148,10 +148,10 @@ class InvoiceRepositoryTest extends \PHPUnit_Framework_TestCase ->method('getFilters') ->willReturn([$filter]); - $criteria = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') + $searchCriteria = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') ->disableOriginalConstructor() ->getMock(); - $criteria->expects($this->once()) + $searchCriteria->expects($this->once()) ->method('getFilterGroups') ->willReturn($filterGroups); @@ -166,7 +166,7 @@ class InvoiceRepositoryTest extends \PHPUnit_Framework_TestCase ->method('create') ->willReturn($collection); - $this->assertEquals($collection, $this->invoice->getList($criteria)); + $this->assertEquals($collection, $this->invoice->getList($searchCriteria)); } public function testDelete() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressRepositoryTest.php index f943f6632225b1c026852e51ebfa4339444a999b..3dd1590bf72ad751cf18fbe81ba1c3951971a052 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/AddressRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/AddressRepositoryTest.php @@ -170,14 +170,14 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase ->method('getFilters') ->willReturn([$filter]); - $criteria = $this->getMock( + $searchCriteria = $this->getMock( 'Magento\Framework\Api\SearchCriteria', ['getFilterGroups'], [], '', false ); - $criteria->expects($this->once()) + $searchCriteria->expects($this->once()) ->method('getFilterGroups') ->willReturn([$filterGroup]); @@ -196,7 +196,7 @@ class AddressRepositoryTest extends \PHPUnit_Framework_TestCase ->method('create') ->willReturn($collection); - $this->assertEquals($collection, $this->subject->getList($criteria)); + $this->assertEquals($collection, $this->subject->getList($searchCriteria)); } public function testDelete() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php index cba7908dacd42bae57729dfe770587a2708c8f4a..25357bd65177fe791572664736220c8ae59161b1 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoRepositoryTest.php @@ -153,10 +153,10 @@ class CreditmemoRepositoryTest extends \PHPUnit_Framework_TestCase ->method('getFilters') ->willReturn([$filter]); - $criteria = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') + $searchCriteria = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') ->disableOriginalConstructor() ->getMock(); - $criteria->expects($this->once()) + $searchCriteria->expects($this->once()) ->method('getFilterGroups') ->willReturn($filterGroups); @@ -171,7 +171,7 @@ class CreditmemoRepositoryTest extends \PHPUnit_Framework_TestCase ->method('create') ->willReturn($collection); - $this->assertEquals($collection, $this->creditmemo->getList($criteria)); + $this->assertEquals($collection, $this->creditmemo->getList($searchCriteria)); } public function testDelete() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php index e2deb200dbcfcd930ae170dee2cd48819509a8f3..314271c3156963559230464f983dc06f2872e7e1 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ItemRepositoryTest.php @@ -200,10 +200,10 @@ class ItemRepositoryTest extends \PHPUnit_Framework_TestCase ->method('getFilters') ->willReturn([$filterMock]); - $criteriaMock = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') + $searchCriteriaMock = $this->getMockBuilder('Magento\Framework\Api\SearchCriteria') ->disableOriginalConstructor() ->getMock(); - $criteriaMock->expects($this->once()) + $searchCriteriaMock->expects($this->once()) ->method('getFilterGroups') ->willReturn([$filterGroupMock]); @@ -230,7 +230,7 @@ class ItemRepositoryTest extends \PHPUnit_Framework_TestCase ->willReturn($searchResultMock); $model = $this->getModel($orderItemMock, $productType); - $this->assertSame($searchResultMock, $model->getList($criteriaMock)); + $this->assertSame($searchResultMock, $model->getList($searchCriteriaMock)); } public function testDeleteById() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentRepositoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentRepositoryTest.php index 36a8360ee094fbf2c05b70ed871492d1b0b0d25b..f76732578da21856a34ef5a9edee3011256dd831 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentRepositoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/ShipmentRepositoryTest.php @@ -170,14 +170,14 @@ class ShipmentRepositoryTest extends \PHPUnit_Framework_TestCase ->method('getFilters') ->willReturn([$filter]); - $criteria = $this->getMock( + $searchCriteria = $this->getMock( 'Magento\Framework\Api\SearchCriteria', ['getFilterGroups'], [], '', false ); - $criteria->expects($this->once()) + $searchCriteria->expects($this->once()) ->method('getFilterGroups') ->willReturn([$filterGroup]); @@ -196,7 +196,7 @@ class ShipmentRepositoryTest extends \PHPUnit_Framework_TestCase ->method('create') ->willReturn($collection); - $this->assertEquals($collection, $this->subject->getList($criteria)); + $this->assertEquals($collection, $this->subject->getList($searchCriteria)); } public function testDelete() diff --git a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php index ffeb136782b1ce1b16873f54caa70ce3a1dbbb88..8ac891f47b43efca38e9efae9abf6e217fdb7fea 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/ResourceModel/Order/AddressTest.php @@ -40,11 +40,6 @@ class AddressTest extends \PHPUnit_Framework_TestCase */ protected $validatorMock; - /** - * @var \Magento\Sales\Model\ResourceModel\GridPool|\PHPUnit_Framework_MockObject_MockObject - */ - protected $gridPoolMock; - /** * @var \Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot|\PHPUnit_Framework_MockObject_MockObject */ @@ -87,13 +82,6 @@ class AddressTest extends \PHPUnit_Framework_TestCase '', false ); - $this->gridPoolMock = $this->getMock( - 'Magento\Sales\Model\ResourceModel\GridPool', - ['refreshByOrderId'], - [], - '', - false - ); $this->entitySnapshotMock = $this->getMock( 'Magento\Framework\Model\ResourceModel\Db\VersionControl\Snapshot', [], @@ -117,7 +105,6 @@ class AddressTest extends \PHPUnit_Framework_TestCase [ 'resource' => $this->appResourceMock, 'validator' => $this->validatorMock, - 'gridPool' => $this->gridPoolMock, 'entitySnapshot' => $this->entitySnapshotMock ] ); @@ -136,13 +123,9 @@ class AddressTest extends \PHPUnit_Framework_TestCase ->method('isModified') ->with($this->addressMock) ->willReturn(true); - $this->addressMock->expects($this->exactly(3)) + $this->addressMock->expects($this->once()) ->method('getParentId') ->will($this->returnValue(1)); - $this->gridPoolMock->expects($this->once()) - ->method('refreshByOrderId') - ->with($this->equalTo(1)) - ->will($this->returnSelf()); $this->addressResource->save($this->addressMock); } diff --git a/app/code/Magento/Sales/Test/Unit/Model/Service/OrderServiceTest.php b/app/code/Magento/Sales/Test/Unit/Model/Service/OrderServiceTest.php index dfbdd79bd337339cb1f54292df1f8c7ee3a36dd3..71a4bf2c0bb4819087bfeb07aa9a615a6d976545 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Service/OrderServiceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Service/OrderServiceTest.php @@ -14,51 +14,67 @@ class OrderServiceTest extends \PHPUnit_Framework_TestCase * @var \Magento\Sales\Model\Service\OrderService */ protected $orderService; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Api\OrderRepositoryInterface */ protected $orderRepositoryMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Api\OrderStatusHistoryRepositoryInterface */ protected $orderStatusHistoryRepositoryMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Api\SearchCriteriaBuilder */ protected $searchCriteriaBuilderMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Api\SearchCriteria */ protected $searchCriteriaMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Api\FilterBuilder */ protected $filterBuilderMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Api\Filter */ protected $filterMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\OrderNotifier */ protected $orderNotifierMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order */ protected $orderMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order\Status\History */ protected $orderStatusHistoryMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Api\Data\OrderStatusHistorySearchResultInterface */ protected $orderSearchResultMock; + /** * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Event\ManagerInterface */ protected $eventManagerMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order\Email\Sender\OrderCommentSender + */ + protected $orderCommentSender; + protected function setUp() { $this->orderRepositoryMock = $this->getMockBuilder( @@ -116,13 +132,20 @@ class OrderServiceTest extends \PHPUnit_Framework_TestCase ) ->disableOriginalConstructor() ->getMock(); + $this->orderCommentSender = $this->getMockBuilder( + 'Magento\Sales\Model\Order\Email\Sender\OrderCommentSender' + ) + ->disableOriginalConstructor() + ->getMock(); + $this->orderService = new \Magento\Sales\Model\Service\OrderService( $this->orderRepositoryMock, $this->orderStatusHistoryRepositoryMock, $this->searchCriteriaBuilderMock, $this->filterBuilderMock, $this->orderNotifierMock, - $this->eventManagerMock + $this->eventManagerMock, + $this->orderCommentSender ); } @@ -174,6 +197,7 @@ class OrderServiceTest extends \PHPUnit_Framework_TestCase public function testAddComment() { + $clearComment = "Comment text here..."; $this->orderRepositoryMock->expects($this->once()) ->method('get') ->with(123) @@ -182,10 +206,16 @@ class OrderServiceTest extends \PHPUnit_Framework_TestCase ->method('addStatusHistory') ->with($this->orderStatusHistoryMock) ->willReturn($this->orderMock); + $this->orderStatusHistoryMock->expects($this->once()) + ->method('getComment') + ->willReturn("<h1>" . $clearComment); $this->orderRepositoryMock->expects($this->once()) ->method('save') ->with($this->orderMock) ->willReturn([]); + $this->orderCommentSender->expects($this->once()) + ->method('send') + ->with($this->orderMock, false, $clearComment); $this->assertTrue($this->orderService->addComment(123, $this->orderStatusHistoryMock)); } diff --git a/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php b/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php new file mode 100644 index 0000000000000000000000000000000000000000..d6a8e5fab14f400a59d72ecf75aaddfe313577b6 --- /dev/null +++ b/app/code/Magento/Sales/Test/Unit/Observer/GridProcessAddressChangeTest.php @@ -0,0 +1,51 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ + +namespace Magento\Sales\Test\Unit\Observer; + +/** + * Class GridProcessAddressChangeTest + */ +class GridProcessAddressChangeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Sales\Observer\GridProcessAddressChange + */ + protected $observer; + + /** + * @var \Magento\Sales\Model\ResourceModel\GridPool|\PHPUnit_Framework_MockObject_MockObject + */ + protected $gridPoolMock; + + /** + * @var \Magento\Framework\Event\ObserverInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $eventObserverMock; + + public function setUp() + { + $this->gridPoolMock = $this->getMockBuilder('Magento\Sales\Model\ResourceModel\GridPool') + ->disableOriginalConstructor() + ->getMock(); + $this->eventObserverMock = $this->getMockBuilder('Magento\Framework\Event\Observer') + ->disableOriginalConstructor() + ->setMethods(['getOrderId']) + ->getMock(); + $this->observer = new \Magento\Sales\Observer\GridProcessAddressChange($this->gridPoolMock); + } + + public function testGridsReindex() + { + $this->eventObserverMock->expects($this->once()) + ->method('getOrderId') + ->willReturn(100500); + $this->gridPoolMock->expects($this->once()) + ->method('refreshByOrderId') + ->with(100500); + $this->assertNull($this->observer->execute($this->eventObserverMock)); + } +} diff --git a/app/code/Magento/Sales/etc/events.xml b/app/code/Magento/Sales/etc/events.xml index f02fcdd77a5bcfc8b4fdbce4414cb6c7f6886759..4dfe0d47c9c9a02372868b2602a6b4f3f0e2fcb3 100644 --- a/app/code/Magento/Sales/etc/events.xml +++ b/app/code/Magento/Sales/etc/events.xml @@ -33,6 +33,9 @@ <event name="sales_order_creditmemo_delete_after"> <observer name="sales_grid_order_creditmemo_sync_remove" instance="SalesCreditmemoIndexGridSyncRemove" /> </event> + <event name="admin_sales_order_address_update"> + <observer name="sales_grid_admin_refresh_grids" instance="Magento\Sales\Observer\GridProcessAddressChange" /> + </event> <event name="config_data_dev_grid_async_indexing_disabled"> <observer name="sales_grid_order_async_insert" instance="SalesOrderIndexGridAsyncInsertObserver" /> <observer name="sales_grid_order_invoice_async_insert" instance="SalesInvoiceIndexGridAsyncInsertObserver" /> diff --git a/app/code/Magento/SalesRule/Model/Plugin/Rule.php b/app/code/Magento/SalesRule/Model/Plugin/Rule.php index 7bf8cb3c43d8aad796e96c8aec699536466b0091..8aa29ffe419e73635fc8fb845a652d1bcc9af86e 100644 --- a/app/code/Magento/SalesRule/Model/Plugin/Rule.php +++ b/app/code/Magento/SalesRule/Model/Plugin/Rule.php @@ -13,7 +13,7 @@ class Rule * @return \Magento\SalesRule\Model\Rule * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function aroundLoadCouponCode( + public function aroundLoadRelations( \Magento\SalesRule\Model\Rule $subject, \Closure $proceed ) { diff --git a/app/code/Magento/SalesRule/Model/Rule.php b/app/code/Magento/SalesRule/Model/Rule.php index 200a836592c1c8bdfd1cf21d2330b23d7b609aca..4ecc75f77dd891ea1be1580e555c017ebda9da5d 100644 --- a/app/code/Magento/SalesRule/Model/Rule.php +++ b/app/code/Magento/SalesRule/Model/Rule.php @@ -231,11 +231,23 @@ class Rule extends \Magento\Rule\Model\AbstractModel */ protected function _afterLoad() { - $this->loadCouponCode(); + $this->loadRelations(); return parent::_afterLoad(); } /** + * Load all relative data + * + * @return void + */ + public function loadRelations() + { + $this->loadCouponCode(); + } + + /** + * Load coupon code + * * @return void */ public function loadCouponCode() diff --git a/app/code/Magento/SalesRule/Observer/SalesOrderAfterPlaceObserver.php b/app/code/Magento/SalesRule/Observer/SalesOrderAfterPlaceObserver.php index 1d1a6be10918d384aaaa5906b395c7f30f02c8e3..9ceb8221d17a2577af41219fc483601080e7cd11 100644 --- a/app/code/Magento/SalesRule/Observer/SalesOrderAfterPlaceObserver.php +++ b/app/code/Magento/SalesRule/Observer/SalesOrderAfterPlaceObserver.php @@ -77,6 +77,7 @@ class SalesOrderAfterPlaceObserver implements ObserverInterface $rule = $this->_ruleFactory->create(); $rule->load($ruleId); if ($rule->getId()) { + $rule->loadCouponCode(); $rule->setTimesUsed($rule->getTimesUsed() + 1); $rule->save(); diff --git a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php index fb788c5cf5b6f22efc7b99f421bb77d6267b69ce..a30a4acb36a0f29d55a4716a17cc33d770cdd82a 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Model/Plugin/RuleTest.php @@ -14,7 +14,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase protected $plugin; /**} - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\SalesRule\Model\Rule|\PHPUnit_Framework_MockObject_MockObject */ protected $subject; @@ -36,11 +36,11 @@ class RuleTest extends \PHPUnit_Framework_TestCase $this->plugin = $objectManager->getObject('Magento\SalesRule\Model\Plugin\Rule'); } - public function testLoadCouponCode() + public function testLoadRelations() { $this->assertEquals( $this->subject, - $this->plugin->aroundLoadCouponCode($this->subject, $this->genericClosure) + $this->plugin->aroundLoadRelations($this->subject, $this->genericClosure) ); } } 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/Theme/view/frontend/templates/html/pager.phtml b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml index e7835bee90cc63bb03928e2f24edeccd8cb17987..331903c8ced116e52835c475c43e26559f25e55e 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/pager.phtml @@ -116,7 +116,7 @@ <?php if ($block->isShowPerPage()): ?> <div class="limiter"> <strong class="limiter-label"><?php /* @escapeNotVerified */ echo __('Show') ?></strong> - <select id="limiter" data-mage-redirect="{'event':'change'}" class="limiter-options"> + <select id="limiter" data-mage-init='{"redirectUrl": {"event":"change"}}' class="limiter-options"> <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?> <option value="<?php /* @escapeNotVerified */ echo $block->getLimitUrl($_key) ?>"<?php if ($block->isLimitCurrent($_key)): ?> selected="selected"<?php endif ?>> 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/README.md b/app/code/Magento/Weee/README.md index 3fda5bbc12bb038acf560c52d48571ecfd587b4d..0218dcd85ed9cb433e21a52a44e856be287f8aaa 100644 --- a/app/code/Magento/Weee/README.md +++ b/app/code/Magento/Weee/README.md @@ -18,7 +18,7 @@ Magento_Weee module can be installed automatically (using native Magento install Magento installation with existing products with FPT: * Disable FPT on the backend * Remove all products with FPT -* Remove all FPT attributes from product templates +* Remove all FPT attributes from attribute sets * Delete all FPT attributes * Remove module directory from the code base * New Magento installation: 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/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/_module.less index 16606bb518d0a486f728d432bc957e385edf9e83..3d25c7dbf0b6731c2cffeaeff881d293dcefae95 100644 --- a/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_ConfigurableProduct/web/css/source/_module.less @@ -11,7 +11,7 @@ @import 'module/components/_navigation-bar.less'; // Navigation Bar @import 'module/components/_grid.less'; // Grid styles @import 'module/components/_currency-addon.less'; // Currency Addon Styles -@import 'module/components/_attributes_template_popup.less'; // Choose Affected Product Template popup +@import 'module/components/_attributes_template_popup.less'; // Choose Affected Attribute Set popup // Main Steps @import 'module/steps/_select-attributes.less'; 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/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php index 72005876cc595da0a6d1a2ae85a258464b07781f..5944edff812c676dcaba7654e4c76d695dc7d6a3 100644 --- a/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Bundle/Api/OrderItemRepositoryTest.php @@ -76,7 +76,7 @@ class OrderItemRepositoryTest extends WebapiAbstract ] ); - $requestData = ['criteria' => $searchCriteriaBuilder->create()->__toArray()]; + $requestData = ['searchCriteria' => $searchCriteriaBuilder->create()->__toArray()]; $serviceInfo = [ 'rest' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php index db63fbb6084601820a27dc4cc770fa6826a28507..613be6d50073ef492226d584b747077c26af59c4 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/OrderItemRepositoryTest.php @@ -76,7 +76,7 @@ class OrderItemRepositoryTest extends WebapiAbstract ] ); - $requestData = ['criteria' => $searchCriteriaBuilder->create()->__toArray()]; + $requestData = ['searchCriteria' => $searchCriteriaBuilder->create()->__toArray()]; $serviceInfo = [ 'rest' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php index 25cb0e8652bf2996a9864e68bfcbeb5fb977fe63..318a225288827759eb65bb32793fac5bf0536144 100644 --- a/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OrderItemRepositoryTest.php @@ -76,7 +76,7 @@ class OrderItemRepositoryTest extends WebapiAbstract ] ); - $requestData = ['criteria' => $searchCriteriaBuilder->create()->__toArray()]; + $requestData = ['searchCriteria' => $searchCriteriaBuilder->create()->__toArray()]; $serviceInfo = [ 'rest' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php index 41a5c6a506962a018eeb8421c6d8bc53f5ad7567..e3da911ba3a17affc4049868fd524d93672a1611 100644 --- a/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Downloadable/Api/OrderItemRepositoryTest.php @@ -76,7 +76,7 @@ class OrderItemRepositoryTest extends WebapiAbstract ] ); - $requestData = ['criteria' => $searchCriteriaBuilder->create()->__toArray()]; + $requestData = ['searchCriteria' => $searchCriteriaBuilder->create()->__toArray()]; $serviceInfo = [ 'rest' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php index d3216b9cf41c17d454e7e46ed7d8be1051561586..892f4ca944a4673641d705bdea7d9acd5da12ead 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/CreditmemoListTest.php @@ -68,7 +68,7 @@ class CreditmemoListTest extends WebapiAbstract ); $searchData = $searchCriteriaBuilder->create()->__toArray(); - $requestData = ['criteria' => $searchData]; + $requestData = ['searchCriteria' => $searchData]; $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData), diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php index b529af4d554d2a5be200e05d1f3c42abc1b3f7b7..6b8aa48df12f2337e603c79bda7200806a5c358b 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/InvoiceListTest.php @@ -53,7 +53,7 @@ class InvoiceListTest extends WebapiAbstract ); $searchData = $searchCriteriaBuilder->create()->__toArray(); - $requestData = ['criteria' => $searchData]; + $requestData = ['searchCriteria' => $searchData]; $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData), diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php index 1cd2b7a30656eea7334dbf9266281f9871bceeec..e91f747116db0ac2eea035af55096c8ba9517e20 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderItemGetListTest.php @@ -48,7 +48,7 @@ class OrderItemGetListTest extends WebapiAbstract ] ); - $requestData = ['criteria' => $searchCriteriaBuilder->create()->__toArray()]; + $requestData = ['searchCriteria' => $searchCriteriaBuilder->create()->__toArray()]; $serviceInfo = [ 'rest' => [ diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php index 003ccfccf94e8e7fffef995a27e4fd36932378cf..a6598376efb31d1119eba37ce3dad2decbef64ca 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderListTest.php @@ -54,7 +54,7 @@ class OrderListTest extends WebapiAbstract ); $searchData = $searchCriteriaBuilder->create()->__toArray(); - $requestData = ['criteria' => $searchData]; + $requestData = ['searchCriteria' => $searchData]; $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData), diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php index a06f22664920a35b9990442f7a6f2adb4c6c013f..678edb386c75315b9d4dfa4ad5f15334f358c305 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipmentListTest.php @@ -46,7 +46,7 @@ class ShipmentListTest extends WebapiAbstract $searchCriteriaBuilder->addFilters([$filterBuilder->setField('shipment_status')->setValue(1)->create()]); $searchData = $searchCriteriaBuilder->create()->__toArray(); - $requestData = ['criteria' => $searchData]; + $requestData = ['searchCriteria' => $searchData]; $serviceInfo = [ 'rest' => [ 'resourcePath' => self::RESOURCE_PATH . '?' . http_build_query($requestData), diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php index 2081f0502ff731d331d178c4257496e8b062284b..b0fb27eb25441a9797ba5cf5f15ba5ba4037f1e4 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/TransactionTest.php @@ -118,7 +118,7 @@ class TransactionTest extends WebapiAbstract $searchCriteriaBuilder->addFilters($filters); $searchData = $searchCriteriaBuilder->create()->__toArray(); - $requestData = ['criteria' => $searchData]; + $requestData = ['searchCriteria' => $searchData]; $serviceInfo = [ 'rest' => [ 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/Attribute/Set/GridPageActions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/GridPageActions.php index 49d3f926aa63111003e8a56440c30a1fd95160ed..9373e1ab10ffaf958e27b18f4719141979f63498 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/GridPageActions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/GridPageActions.php @@ -10,7 +10,7 @@ use Magento\Backend\Test\Block\GridPageActions as AbstractGridPageActions; /** * Class GridPageActions - * Grid page actions block on Product Templates page + * Grid page actions block on Attribute Sets page */ class GridPageActions extends AbstractGridPageActions { 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/AssertAddedProductAttributeOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php index 22cc3977640cb5e7fcf1ee60e7619bd5dcbaf38b..eeb6257ee1f1873813e89421e9fa2a3f0e42c52c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php @@ -28,7 +28,7 @@ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint * @param CatalogProductIndex $productGrid * @param CatalogProductEdit $productEdit * @param CatalogProductAttribute $attribute - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @param CatalogProductAttribute $productAttributeOriginal * @throws \Exception * @return void @@ -38,11 +38,11 @@ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductAttribute $attribute, - CatalogAttributeSet $productTemplate, + CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttributeOriginal = null ) { if (!$product->hasData('sku')) { - $product = $this->createProductWithAttributeSet($productAttributeOriginal, $productTemplate); + $product = $this->createProductWithAttributeSet($productAttributeOriginal, $attributeSet); } $filterProduct = ['sku' => $product->getSku()]; $productGrid->open(); @@ -62,16 +62,16 @@ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint * Create Product With AttributeSet. * * @param CatalogProductAttribute $attribute - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @return CatalogProductSimple */ protected function createProductWithAttributeSet( CatalogProductAttribute $attribute, - CatalogAttributeSet $productTemplate + CatalogAttributeSet $attributeSet ) { $product = ObjectManager::getInstance()->create( - 'Magento\Catalog\Test\TestStep\AddAttributeToProductTemplateStep', - ['attribute' => $attribute, 'productTemplate' => $productTemplate] + 'Magento\Catalog\Test\TestStep\AddAttributeToAttributeSetStep', + ['attribute' => $attribute, 'attributeSet' => $attributeSet] )->run(); return $product['product']; } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetForm.php similarity index 79% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetForm.php index 4a634c7d23dec5d00566c6e59a9254800b0a1eb2..527f609aa60bb8483ad07967fcf2ebecc105eb33 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetForm.php @@ -13,14 +13,14 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertProductTemplateForm - * Checking data from Product Template form with data fixture + * Class AssertAttributeSetForm + * Checking data from Attribute Set form with data fixture */ -class AssertProductTemplateForm extends AbstractConstraint +class AssertAttributeSetForm extends AbstractConstraint { /** - * Assert that after save a product template on edit product set page displays: - * 1. Correct product template name in Attribute set name field passed from fixture + * Assert that after save a attribute set on edit product set page displays: + * 1. Correct attribute set name in Attribute set name field passed from fixture * 2. Created Product Attribute (if was added) * * @param CatalogProductSetIndex $productSet @@ -43,7 +43,7 @@ class AssertProductTemplateForm extends AbstractConstraint \PHPUnit_Framework_Assert::assertEquals( $filterAttribute['set_name'], $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName(), - 'Product Template not found' + 'Attribute Set not found' . "\nExpected: " . $filterAttribute['set_name'] . "\nActual: " . $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName() ); @@ -51,7 +51,7 @@ class AssertProductTemplateForm extends AbstractConstraint $attributeLabel = $productAttribute->getFrontendLabel(); \PHPUnit_Framework_Assert::assertTrue( $productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeLabel), - "Product Attribute is absent on Product Template Groups" + "Product Attribute is absent on Attribute Set Groups" ); } } @@ -63,6 +63,6 @@ class AssertProductTemplateForm extends AbstractConstraint */ public function toString() { - return 'Data from the Product Template form matched with fixture'; + return 'Data from the Attribute Set form matched with fixture'; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetGroupOnProductForm.php similarity index 88% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetGroupOnProductForm.php index 2baac340525f3c1506afbb7cde40e0325dffe918..3aa7d3e9361e30fae3c614b95549d2b697c752ea 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetGroupOnProductForm.php @@ -17,15 +17,15 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; /** - * Class AssertProductTemplateGroupOnProductForm - * Check that created product template displays in product template suggest container dropdown and + * Class AssertAttributeSetGroupOnProductForm + * Check that created attribute set displays in attribute set suggest container dropdown and * can be used for new created product */ -class AssertProductTemplateGroupOnProductForm extends AbstractConstraint +class AssertAttributeSetGroupOnProductForm extends AbstractConstraint { /** - * Assert that created product template: - * 1. Displays in product template suggest container dropdown + * Assert that created attribute set: + * 1. Displays in attribute set suggest container dropdown * 2. Can be used for new created product. * * @param FixtureFactory $fixtureFactory diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetInGrid.php similarity index 67% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetInGrid.php index 281327b9f8c921784306d09d87b935261a42b5d5..6e6d02c324171284022529d2931f145f4dbacec1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetInGrid.php @@ -11,13 +11,13 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertProductTemplateInGrid - * Checks present product template in Product Templates grid + * Class AssertAttributeSetInGrid + * Checks present attribute set in Attribute Sets grid */ -class AssertProductTemplateInGrid extends AbstractConstraint +class AssertAttributeSetInGrid extends AbstractConstraint { /** - * Assert that new product template displays in Product Templates grid + * Assert that new attribute set displays in Attribute Sets grid * * @param CatalogProductSetIndex $productSetPage * @param CatalogAttributeSet $attributeSet @@ -32,17 +32,17 @@ class AssertProductTemplateInGrid extends AbstractConstraint $productSetPage->open(); \PHPUnit_Framework_Assert::assertTrue( $productSetPage->getGrid()->isRowVisible($filterAttributeSet), - 'Product Template \'' . $filterAttributeSet['set_name'] . '\' is absent in Product Template grid.' + 'Attribute Set \'' . $filterAttributeSet['set_name'] . '\' is absent in Attribute Set grid.' ); } /** - * Text present new product template in grid + * Text present new attribute set in grid * * @return string */ public function toString() { - return 'Product template is present in Product Templates grid'; + return 'Attribute set is present in Attribute Sets grid'; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetNotInGrid.php similarity index 62% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetNotInGrid.php index 02d8435fb2585e5c0372f07c1b52f20a5ce8b8ed..7d5ed1707c64dfcc2053f0b2326db0bc1a9e72e7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetNotInGrid.php @@ -11,42 +11,42 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertProductTemplateNotInGrid - * Assert that Product Template absence on grid + * Class AssertAttributeSetNotInGrid + * Assert that Attribute Set absence on grid */ -class AssertProductTemplateNotInGrid extends AbstractConstraint +class AssertAttributeSetNotInGrid extends AbstractConstraint { /* tags */ const SEVERITY = 'low'; /* end tags */ /** - * Assert that product template is not displayed in Product Templates grid + * Assert that attribute set is not displayed in Attribute Sets grid * * @param CatalogProductSetIndex $productSetPage - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @return void */ - public function processAssert(CatalogProductSetIndex $productSetPage, CatalogAttributeSet $productTemplate) + public function processAssert(CatalogProductSetIndex $productSetPage, CatalogAttributeSet $attributeSet) { $filterAttributeSet = [ - 'set_name' => $productTemplate->getAttributeSetName(), + 'set_name' => $attributeSet->getAttributeSetName(), ]; $productSetPage->open(); \PHPUnit_Framework_Assert::assertFalse( $productSetPage->getGrid()->isRowVisible($filterAttributeSet), - 'An attribute set named "' . $filterAttributeSet['set_name'] . '" is present in Product Template grid.' + 'An attribute set named "' . $filterAttributeSet['set_name'] . '" is present in Attribute Set grid.' ); } /** - * Text absent new product template in grid + * Text absent new attribute set in grid * * @return string */ public function toString() { - return 'Product template is absent in Product Templates grid'; + return 'Attribute set is absent in Attribute Sets grid'; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php similarity index 88% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php index cf3e50c9f09009b498b96ad8bb74853d520f50ea..0f66f26036df9073cb1887d86255bc38f48dfc3e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetOnProductForm.php @@ -16,14 +16,14 @@ use Magento\Mtf\Constraint\AbstractConstraint; use Magento\Mtf\Fixture\FixtureFactory; /** - * Class AssertProductTemplateOnProductForm + * Class AssertAttributeSetOnProductForm * Check Attribute Set and Product Attribute on Product form */ -class AssertProductTemplateOnProductForm extends AbstractConstraint +class AssertAttributeSetOnProductForm extends AbstractConstraint { /** - * Assert that created product template: - * 1. Displays in product template suggest container dropdown + * Assert that created attribute set: + * 1. Displays in attribute set suggest container dropdown * 2. Can be used for new created product. * * @param FixtureFactory $fixtureFactory @@ -66,7 +66,7 @@ class AssertProductTemplateOnProductForm extends AbstractConstraint \PHPUnit_Framework_Assert::assertEquals( $attributeSet->getAttributeSetName(), $formAttributeSet, - 'Product Template not found on Product form.' + 'Attribute Set not found on Product form.' . "\nExpected: " . $attributeSet->getAttributeSetName() . "\nActual: " . $formAttributeSet ); @@ -88,6 +88,6 @@ class AssertProductTemplateOnProductForm extends AbstractConstraint */ public function toString() { - return 'Product Attribute and Product Template are present on the Product form.'; + return 'Product Attribute and Attribute Set are present on the Product form.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php similarity index 70% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php index 43cff91896a5373c3641bb780978fddf1ff44407..8da7dc6bd271f975b3f50d249971b9d512ef420c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessDeleteMessage.php @@ -10,25 +10,25 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertProductTemplateSuccessDeleteMessage - * Check Product Templates success delete message + * Class AssertAttributeSetSuccessDeleteMessage + * Check Attribute Sets success delete message */ -class AssertProductTemplateSuccessDeleteMessage extends AbstractConstraint +class AssertAttributeSetSuccessDeleteMessage extends AbstractConstraint { /** * Text value to be checked */ - const SUCCESS_DELETE_MESSAGE = 'The product template has been removed.'; + const SUCCESS_DELETE_MESSAGE = 'The attribute set has been removed.'; /** - * Assert that after deleting product template success delete message appears + * Assert that after deleting attribute set success delete message appears * * @param CatalogProductSetIndex $productSetIndex * @return void */ public function processAssert(CatalogProductSetIndex $productSetIndex) { - $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_DELETE_MESSAGE, $actualMessage, @@ -45,6 +45,6 @@ class AssertProductTemplateSuccessDeleteMessage extends AbstractConstraint */ public function toString() { - return 'Product Templates success delete message is present.'; + return 'Attribute Sets success delete message is present.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php similarity index 69% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php index 457cac5b7082e897686f71f98b0571d0c070962e..789c2806091c11ff7853baf990a51f60dd3768f4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSetSuccessSaveMessage.php @@ -10,25 +10,25 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductSetIndex; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Class AssertProductTemplateSuccessSaveMessage - * Check Product Templates success save message + * Class AssertAttributeSetSuccessSaveMessage + * Check Attribute Sets success save message */ -class AssertProductTemplateSuccessSaveMessage extends AbstractConstraint +class AssertAttributeSetSuccessSaveMessage extends AbstractConstraint { /** * Text value to be checked */ - const SUCCESS_MESSAGE = 'You saved the product template.'; + const SUCCESS_MESSAGE = 'You saved the attribute set.'; /** - * Assert that after save a product template "You saved the attribute set." successful message appears + * Assert that after save a attribute set "You saved the attribute set." successful message appears * * @param CatalogProductSetIndex $productSetIndex * @return void */ public function processAssert(CatalogProductSetIndex $productSetIndex) { - $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessages(); + $actualMessage = $productSetIndex->getMessagesBlock()->getSuccessMessage(); \PHPUnit_Framework_Assert::assertEquals( self::SUCCESS_MESSAGE, $actualMessage, @@ -45,6 +45,6 @@ class AssertProductTemplateSuccessSaveMessage extends AbstractConstraint */ public function toString() { - return 'Product Templates success save message is present.'; + return 'Attribute Sets success save message is present.'; } } 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/AssertProductAttributeAbsenceInSearchOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php index 4052a470a60642250dcefe83cae20bef9696df43..6ba9ad8b07825a832c853ceecc8d829d81a6b0c2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInSearchOnProductForm.php @@ -12,12 +12,12 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; use Magento\Mtf\Constraint\AbstractConstraint; /** - * Checks that product attribute cannot be added to product template on Product Page via Add Attribute control. + * Checks that product attribute cannot be added to attribute set on Product Page via Add Attribute control. */ class AssertProductAttributeAbsenceInSearchOnProductForm extends AbstractConstraint { /** - * Assert that deleted attribute can't be added to product template 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 CatalogProductIndex $productGrid diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php index 821d96b2db2215c60fc3fc4cfa155f552806815a..3d865b5ccddd79ca047adc636ab1e8302842aaeb 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInTemplateGroups.php @@ -13,45 +13,45 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** * Class AssertProductAttributeAbsenceInTemplateGroups - * Checks that product attribute isn't displayed in Product template's Groups section + * Checks that product attribute isn't displayed in Attribute set's Groups section */ class AssertProductAttributeAbsenceInTemplateGroups extends AbstractConstraint { /** - * Assert that deleted attribute isn't displayed in Product template's Groups section + * Assert that deleted attribute isn't displayed in Attribute set's Groups section * - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @param CatalogProductSetIndex $productSetIndex * @param CatalogProductSetEdit $productSetEdit * @return void */ public function processAssert( - CatalogAttributeSet $productTemplate, + CatalogAttributeSet $attributeSet, CatalogProductSetIndex $productSetIndex, CatalogProductSetEdit $productSetEdit ) { - $filter = ['set_name' => $productTemplate->getAttributeSetName()]; + $filter = ['set_name' => $attributeSet->getAttributeSetName()]; $productSetIndex->open(); $productSetIndex->getGrid()->searchAndOpen($filter); - $attributeCode = $productTemplate + $attributeCode = $attributeSet ->getDataFieldConfig('assigned_attributes')['source'] ->getAttributes()[0] ->getAttributeCode(); \PHPUnit_Framework_Assert::assertFalse( $productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeCode), - "Attribute " . $attributeCode . " is present in Product template's Groups section." + "Attribute " . $attributeCode . " is present in Attribute set's Groups section." ); } /** - * Text absent Product Attribute in Product template's Groups section + * Text absent Product Attribute in Attribute set's Groups section * * @return string */ public function toString() { - return "Product Attribute is absent in Product template's Groups section."; + return "Product Attribute is absent in Attribute set's Groups section."; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php index d1f2f5e1eff19ed4e746ab1e8a2559be47318fc3..460d46cf55d1fca61d01ceeeacfc7e8dea29ade7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInUnassignedAttributes.php @@ -13,45 +13,45 @@ use Magento\Mtf\Constraint\AbstractConstraint; /** * Class AssertProductAttributeAbsenceInUnassignedAttributes - * Checks that product attribute isn't displayed in Product template's Unassigned Attributes section + * Checks that product attribute isn't displayed in Attribute set's Unassigned Attributes section */ class AssertProductAttributeAbsenceInUnassignedAttributes extends AbstractConstraint { /** - * Assert that deleted attribute isn't displayed in Product template's Unassigned Attributes section + * Assert that deleted attribute isn't displayed in Attribute set's Unassigned Attributes section * - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @param CatalogProductSetIndex $productSetIndex * @param CatalogProductSetEdit $productSetEdit * @return void */ public function processAssert( - CatalogAttributeSet $productTemplate, + CatalogAttributeSet $attributeSet, CatalogProductSetIndex $productSetIndex, CatalogProductSetEdit $productSetEdit ) { - $filter = ['set_name' => $productTemplate->getAttributeSetName()]; + $filter = ['set_name' => $attributeSet->getAttributeSetName()]; $productSetIndex->open(); $productSetIndex->getGrid()->searchAndOpen($filter); - $attributeCode = $productTemplate + $attributeCode = $attributeSet ->getDataFieldConfig('assigned_attributes')['source'] ->getAttributes()[0] ->getAttributeCode(); \PHPUnit_Framework_Assert::assertFalse( $productSetEdit->getAttributeSetEditBlock()->checkUnassignedProductAttribute($attributeCode), - "Attribute " . $attributeCode . " is present in Unassigned Product template's section." + "Attribute " . $attributeCode . " is present in Unassigned Attribute set's section." ); } /** - * Text absent Product Attribute Unassigned Product template's section + * Text absent Product Attribute Unassigned Attribute set's section * * @return string */ public function toString() { - return "Product Attribute is absent in Unassigned Product template's section."; + return "Product Attribute is absent in Unassigned Attribute set's section."; } } 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/AssertProductDuplicatedInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php index 64fcf763899dc95f7d178fdc4261b07285f67b0f..59462fc83da81a765185c39886437f18f8b2a23c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php @@ -16,7 +16,7 @@ use Magento\Mtf\Fixture\FixtureInterface; class AssertProductDuplicatedInGrid extends AbstractConstraint { /** - * Assert that duplicated product is found by sku and has correct product type, product template, + * Assert that duplicated product is found by sku and has correct product type, attribute set, * product status disabled and out of stock * * @param FixtureInterface $product 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/Fixture/Product/AttributeSetId.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/AttributeSetId.php index 9a314c06e7d285c25dad13cf614d6317987a1d60..4865ef44562457ea5c3ef364fa1386a9b6919bac 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/AttributeSetId.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/AttributeSetId.php @@ -11,7 +11,7 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Catalog\Test\Fixture\CatalogAttributeSet; /** - * Product template entity data source. + * Attribute set entity data source. * * Data keys: * - dataset diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml index f38ac7d9baf9c18ad79bdfb4944e4c5b358527c9..847a1f2c242e6cbc840de37609d98898dd308a48 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml @@ -23,8 +23,8 @@ <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> </variation> <variation name="NavigateMenuTest12"> - <data name="menuItem" xsi:type="string">Stores > Product Template</data> - <data name="pageTitle" xsi:type="string">Product Templates</data> + <data name="menuItem" xsi:type="string">Stores > Attribute Set</data> + <data name="pageTitle" xsi:type="string">Attribute Sets</data> <constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/> </variation> </testCase> 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/CreateAttributeSetEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php index 7ddb966ed99a38aed91201c7cb802a182f26d2b3..835086f15fa8d575fbfa0483ed570ee28f16bce8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php @@ -18,12 +18,12 @@ use Magento\Mtf\TestCase\Injectable; * * Test Flow: * 1. Log in to Backend. - * 2. Navigate to Stores > Attributes > Product Template. - * 3. Start to create new Product Template. + * 2. Navigate to Stores > Attributes > Attribute Set. + * 3. Start to create new Attribute Set. * 4. Fill out fields data according to data set. - * 5. Add created Product Attribute to Product Template. - * 6. Save new Product Template. - * 7. Verify created Product Template. + * 5. Add created Product Attribute to Attribute Set. + * 6. Save new Attribute Set. + * 7. Verify created Attribute Set. * * @group Product_Attributes_(MX) * @ZephyrId MAGETWO-25104 diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml index 68b4d38d82e36065fd6c206f58d7966f45ce8661..2db56cfeb2012c7c1c8a26487403f349d8329274 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml @@ -6,14 +6,14 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest" summary="Create Attribute Set (Product Template)" ticketId="MAGETWO-25104"> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest" summary="Create Attribute Set (Attribute Set)" ticketId="MAGETWO-25104"> <variation name="CreateAttributeSetEntityTestVariation1"> - <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplate%isolation%</data> + <data name="attributeSet/data/attribute_set_name" xsi:type="string">AttributeSet%isolation%</data> <data name="attributeSet/data/skeleton_set/dataset" xsi:type="string">default</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetSuccessSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetOnProductForm" /> </variation> </testCase> </config> 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 b945d770fe82d5992ca0a769a3da02da2da2a10d..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 @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityTest" summary="Create Product Attribute" ticketId="MAGETWO-24767"> <variation name="CreateProductAttributeEntityTestVariation1"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Text Field</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> @@ -19,7 +19,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation2"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Text Area</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> @@ -41,7 +41,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsComparable" /> </variation> <variation name="CreateProductAttributeEntityTestVariation3"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Date_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Date</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> @@ -64,7 +64,7 @@ <constraint name="Magento\CatalogRule\Test\Constraint\AssertProductAttributeIsUsedPromoRules" /> </variation> <variation name="CreateProductAttributeEntityTestVariation4"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Yes/No_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Yes/No</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> @@ -80,7 +80,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation5"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Multiple_Select_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Multiple Select</data> <data name="productAttribute/data/options/dataset" xsi:type="string">default</data> @@ -109,7 +109,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeOptionsOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation6"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Dropdown_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Dropdown</data> <data name="productAttribute/data/options/dataset" xsi:type="string">default</data> @@ -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" /> @@ -142,7 +145,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeOptionsOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation7"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Price_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Price</data> <data name="productAttribute/data/is_required" xsi:type="string">No</data> @@ -154,16 +157,16 @@ <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" /> </variation> <variation name="CreateProductAttributeEntityTestVariation8"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Fixed_Product_Tax_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Fixed Product Tax</data> <data name="productAttribute/data/attribute_code" xsi:type="string">attr_fpt_code_%isolation%</data> @@ -173,7 +176,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="CreateProductAttributeEntityTestVariation9"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttribute/data/frontend_label" xsi:type="string">Text_Field_Admin_%isolation%</data> <data name="productAttribute/data/frontend_input" xsi:type="string">Text Field</data> <data name="productAttribute/data/is_required" xsi:type="string">Yes</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.php index a3c0028f6e70c13d348e9db060bbf528c24209d8..32b9303f802a36ebeb4c43bc7ee4fe2cb15a2160 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.php @@ -13,7 +13,7 @@ use Magento\Mtf\TestCase\Injectable; /** * Preconditions: - * 1. Create Product template, based on Default. + * 1. Create Attribute set, based on Default. * 2. Create product attribute and add to created template. * * Test Flow: @@ -64,14 +64,14 @@ class DeleteAssignedToTemplateProductAttributeTest extends Injectable /** * Run test. * - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @return array */ - public function test(CatalogAttributeSet $productTemplate) + public function test(CatalogAttributeSet $attributeSet) { // Precondition - $productTemplate->persist(); - $attribute = $productTemplate->getDataFieldConfig('assigned_attributes')['source']->getAttributes()[0]; + $attributeSet->persist(); + $attribute = $attributeSet->getDataFieldConfig('assigned_attributes')['source']->getAttributes()[0]; // Steps $filter = ['attribute_code' => $attribute->getAttributeCode()]; @@ -80,6 +80,6 @@ class DeleteAssignedToTemplateProductAttributeTest extends Injectable $this->attributeNew->getPageActions()->delete(); $this->attributeNew->getModalBlock()->acceptAlert(); - return ['productTemplate' => $productTemplate, 'attribute' => $attribute]; + return ['attributeSet' => $attributeSet, 'attribute' => $attribute]; } } 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 75b7694459abb5885d8dd3d12f3440888773ff2a..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 @@ -8,16 +8,19 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteAssignedToTemplateProductAttributeTest" summary="Delete Assigned to Template Product Attribute" ticketId="MAGETWO-26011"> <variation name="DeleteAssignedToTemplateProductAttributeTestVariation1"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> - <data name="productTemplate/data/assigned_attributes/dataset" xsi:type="string">attribute_type_dropdown</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/data/assigned_attributes/dataset" xsi:type="string">attribute_type_dropdown</data> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeSuccessDeleteMessage" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInTemplateGroups" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeAbsenceInUnassignedAttributes" /> </variation> <variation name="DeleteAssignedToTemplateProductAttributeTestVariation2"> - <data name="productTemplate/dataset" xsi:type="string">default</data> - <data name="productTemplate/data/assigned_attributes/dataset" xsi:type="string">attribute_type_text_field</data> + <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/TestCase/ProductAttribute/DeleteAttributeSetTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php index d996e70adb41097c9c62ff5f37f52c5cfb7d4760..b6c3875db64af917d5f940e0f55456bd5070bc79 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.php @@ -13,7 +13,7 @@ use Magento\Mtf\Fixture\FixtureFactory; use Magento\Mtf\TestCase\Injectable; /** - * Test Creation for Delete Attribute Set (Product Template) + * Test Creation for Delete Attribute Set (Attribute Set) * * Preconditions: * 1. An attribute is created. @@ -22,8 +22,8 @@ use Magento\Mtf\TestCase\Injectable; * * Test Flow: * 1. Log in to Backend. - * 2. Navigate to Stores > Attributes > Product Template. - * 3. Open created Product Template. + * 2. Navigate to Stores > Attributes > Attribute Set. + * 3. Open created Attribute Set. * 4. Click 'Delete' button. * 5. Perform all assertions. * @@ -70,26 +70,26 @@ class DeleteAttributeSetTest extends Injectable * Run DeleteAttributeSet test * * @param FixtureFactory $fixtureFactory - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @return array */ - public function test(FixtureFactory $fixtureFactory, CatalogAttributeSet $productTemplate) + public function test(FixtureFactory $fixtureFactory, CatalogAttributeSet $attributeSet) { // Precondition - $productTemplate->persist(); + $attributeSet->persist(); $product = $fixtureFactory->createByCode( 'catalogProductSimple', [ 'dataset' => 'default', 'data' => [ - 'attribute_set_id' => ['attribute_set' => $productTemplate], + 'attribute_set_id' => ['attribute_set' => $attributeSet], ], ] ); $product->persist(); // Steps - $filter = ['set_name' => $productTemplate->getAttributeSetName()]; + $filter = ['set_name' => $attributeSet->getAttributeSetName()]; $this->productSetIndex->open(); $this->productSetIndex->getGrid()->searchAndOpen($filter); $this->productSetEdit->getPageActions()->delete(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml index b4e1608eef6ac7612ace94d17441871b6923a2ed..b10b1444aa30daa3159fffe8cfb7fdd9141af889 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAttributeSetTest.xml @@ -6,13 +6,13 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteAttributeSetTest" summary="Delete Attribute Set (Product Template)" ticketId="MAGETWO-25473"> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\DeleteAttributeSetTest" summary="Delete Attribute Set (Attribute Set)" ticketId="MAGETWO-25473"> <variation name="DeleteAttributeSetTestVariation1"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> - <data name="productTemplate/data/assigned_attributes/dataset" xsi:type="string">default</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/data/assigned_attributes/dataset" xsi:type="string">default</data> <data name="product/dataset" xsi:type="string">default</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessDeleteMessage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateNotInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetSuccessDeleteMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetNotInGrid" /> <constraint name="Magento\Catalog\Test\Constraint\AssertProductNotInGrid" /> </variation> </testCase> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.php index 0939c76aadbe4c131169f2cbb7bed5ffc2d95a65..96b3e5971e1d6d661b789c8895646a22868ddd62 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.php @@ -21,12 +21,12 @@ use Magento\Mtf\TestCase\Injectable; * * Test Flow: * 1. Log in to Backend. - * 2. Navigate to Stores > Attributes > Product Template. - * 3. Open created Product Template. + * 2. Navigate to Stores > Attributes > Attribute Set. + * 3. Open created Attribute Set. * 4. Click 'Add New' button to create new group * 5. Add created Product Attribute to created group. * 6. Fill out other fields data according to data set. - * 7. Save Product Template. + * 7. Save Attribute Set. * 8. Preform all assertions. * * @group Product_Attributes_(MX) @@ -69,7 +69,7 @@ class UpdateAttributeSetTest extends Injectable } /** - * Run UpdateProductTemplate test + * Run UpdateAttributeSet test * * @param CatalogAttributeSet $attributeSet * @param CatalogAttributeSet $attributeSetOriginal diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml index 7a24dab72439588f6480959d2ee73229223140ea..4c10e0aa85c72d428c30ab8038170dc2fe766262 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateAttributeSetTest.xml @@ -6,17 +6,17 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateAttributeSetTest" summary="Update Product Template" ticketId="MAGETWO-26251"> + <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateAttributeSetTest" summary="Update Attribute Set" ticketId="MAGETWO-26251"> <variation name="UpdateAttributeSetTestVariation1"> - <data name="attributeSet/data/attribute_set_name" xsi:type="string">ProductTemplateEdit1%isolation%</data> + <data name="attributeSet/data/attribute_set_name" xsi:type="string">AttributeSetEdit1%isolation%</data> <data name="attributeSet/data/group" xsi:type="string">Custom-group%isolation%</data> <data name="attributeSetOriginal/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttributeOriginal/dataset" xsi:type="string">attribute_type_text_field</data> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm" /> - <constraint name="Magento\Catalog\Test\Constraint\AssertProductTemplateGroupOnProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetSuccessSaveMessage" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetInGrid" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetOnProductForm" /> + <constraint name="Magento\Catalog\Test\Constraint\AssertAttributeSetGroupOnProductForm" /> </variation> </testCase> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php index 755ff5eb886e3548425a84dec20644430f4b9330..d3b51ebdce2cc33be18ba574bf2a546534f14e69 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.php @@ -18,7 +18,7 @@ use Magento\Mtf\TestCase\Injectable; * Preconditions: * Dataset : AttributeOptions * 1. Attribute is created (Attribute) - * 2. Attribute set is created (Product Template) + * 2. Attribute set is created (Attribute Set) * * Test Flow: * 1. Log in to Backend. @@ -61,7 +61,7 @@ class UpdateProductAttributeEntityTest extends Injectable * * @param CatalogProductAttribute $productAttributeOriginal * @param CatalogProductAttribute $attribute - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @param CatalogProductAttributeIndex $attributeIndex * @param CatalogProductAttributeNew $attributeNew * @param CatalogProductSimple $productSimple @@ -70,13 +70,13 @@ class UpdateProductAttributeEntityTest extends Injectable public function testUpdateProductAttribute( CatalogProductAttribute $productAttributeOriginal, CatalogProductAttribute $attribute, - CatalogAttributeSet $productTemplate, + CatalogAttributeSet $attributeSet, CatalogProductAttributeIndex $attributeIndex, CatalogProductAttributeNew $attributeNew, CatalogProductSimple $productSimple ) { //Precondition - $productTemplate->persist(); + $attributeSet->persist(); $productAttributeOriginal->persist(); $filter = [ @@ -91,7 +91,7 @@ class UpdateProductAttributeEntityTest extends Injectable $attribute = $this->prepareAttribute($attribute, $productAttributeOriginal); $productSimple->persist(); - return ['product' => $this->prepareProduct($productSimple, $attribute, $productTemplate)]; + return ['product' => $this->prepareProduct($productSimple, $attribute, $attributeSet)]; } /** @@ -99,13 +99,13 @@ class UpdateProductAttributeEntityTest extends Injectable * * @param CatalogProductSimple $product * @param CatalogProductAttribute $attribute - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @return CatalogProductSimple */ - protected function prepareProduct($product, $attribute, $productTemplate) + protected function prepareProduct($product, $attribute, $attributeSet) { $data = [ - 'attribute_set_id' => ['attribute_set' => $productTemplate], + 'attribute_set_id' => ['attribute_set' => $attributeSet], 'custom_attribute' => $attribute ]; $data = array_merge($data, $product->getData()); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml index 63dabf015796e34f589b4ac24a2ac9188da26507..e58233de491d59dc45764d5db260528f7abc077f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Catalog\Test\TestCase\ProductAttribute\UpdateProductAttributeEntityTest" summary="Update Product Attribute" ticketId="MAGETWO-23459"> <variation name="UpdateProductAttributeEntityTestVariation1"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttributeOriginal/dataset" xsi:type="string">attribute_type_text_field</data> <data name="attribute/data/frontend_label" xsi:type="string">Text_Field_%isolation%</data> <data name="attribute/data/is_required" xsi:type="string">Yes</data> @@ -28,7 +28,7 @@ <constraint name="Magento\Catalog\Test\Constraint\AssertAddedProductAttributeOnProductForm" /> </variation> <variation name="UpdateProductAttributeEntityTestVariation2"> - <data name="productTemplate/dataset" xsi:type="string">custom_attribute_set</data> + <data name="attributeSet/dataset" xsi:type="string">custom_attribute_set</data> <data name="productAttributeOriginal/dataset" xsi:type="string">attribute_type_dropdown</data> <data name="attribute/data/frontend_label" xsi:type="string">Dropdown_%isolation%</data> <data name="attribute/data/options/dataset" xsi:type="string">default</data> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php similarity index 79% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php index 3d5aa19186cec9f6a342ae492fd60df73e1b6f38..44126f9a153115cf82bb4374a6f78da7ccee93c5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToAttributeSetStep.php @@ -18,7 +18,7 @@ use Magento\Mtf\TestStep\TestStepInterface; /** * Move attribute To attribute set. */ -class AddAttributeToProductTemplateStep implements TestStepInterface +class AddAttributeToAttributeSetStep implements TestStepInterface { /** * Catalog ProductSet Index page. @@ -46,7 +46,7 @@ class AddAttributeToProductTemplateStep implements TestStepInterface * * @var CatalogAttributeSet */ - protected $productTemplate; + protected $attributeSet; /** * Catalog Product Index page. @@ -62,32 +62,42 @@ class AddAttributeToProductTemplateStep implements TestStepInterface */ protected $catalogProductEdit; + /** + * Custom attribute value to set while product creation. + * + * @var mixed + */ + protected $attributeValue; + /** * @constructor * @param CatalogProductSetIndex $catalogProductSetIndex * @param CatalogProductSetEdit $catalogProductSetEdit * @param CatalogProductAttribute $attribute - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @param FixtureFactory $fixtureFactory * @param CatalogProductIndex $catalogProductIndex * @param CatalogProductEdit $catalogProductEdit + * @param mixed $attributeValue [optional] */ public function __construct( CatalogProductSetIndex $catalogProductSetIndex, CatalogProductSetEdit $catalogProductSetEdit, CatalogProductAttribute $attribute, - CatalogAttributeSet $productTemplate, + CatalogAttributeSet $attributeSet, FixtureFactory $fixtureFactory, CatalogProductIndex $catalogProductIndex, - CatalogProductEdit $catalogProductEdit + CatalogProductEdit $catalogProductEdit, + $attributeValue = null ) { $this->catalogProductSetIndex = $catalogProductSetIndex; $this->catalogProductSetEdit = $catalogProductSetEdit; $this->attribute = $attribute; - $this->productTemplate = $productTemplate; + $this->attributeSet = $attributeSet; $this->fixtureFactory = $fixtureFactory; $this->catalogProductIndex = $catalogProductIndex; $this->catalogProductEdit = $catalogProductEdit; + $this->attributeValue = $attributeValue; } /** @@ -97,19 +107,23 @@ class AddAttributeToProductTemplateStep implements TestStepInterface */ public function run() { - $filterAttribute = ['set_name' => $this->productTemplate->getAttributeSetName()]; + $filterAttribute = ['set_name' => $this->attributeSet->getAttributeSetName()]; $this->catalogProductSetIndex->open()->getGrid()->searchAndOpen($filterAttribute); $this->catalogProductSetEdit->getAttributeSetEditBlock()->moveAttribute($this->attribute->getData()); $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->productTemplate], - 'custom_attribute' => $this->attribute + 'attribute_set_id' => ['attribute_set' => $this->attributeSet], + 'custom_attribute' => $customAttribute ], ] ); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateAttributeSetStep.php similarity index 62% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductTemplateStep.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateAttributeSetStep.php index e8b106042af164484fbc0f73c6ad92deba48eafc..d844cccdc24e195a07befafdebf90515dfa0a46a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductTemplateStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateAttributeSetStep.php @@ -12,24 +12,24 @@ use Magento\Mtf\TestStep\TestStepInterface; /** * Create product attribute template using handler. */ -class CreateProductTemplateStep implements TestStepInterface +class CreateAttributeSetStep implements TestStepInterface { /** * CatalogAttributeSet fixture. * * @var string */ - protected $productTemplate; + protected $attributeSet; /** * Preparing step properties. * * @constructor - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet */ - public function __construct(CatalogAttributeSet $productTemplate) + public function __construct(CatalogAttributeSet $attributeSet) { - $this->productTemplate = $productTemplate; + $this->attributeSet = $attributeSet; } /** @@ -39,8 +39,8 @@ class CreateProductTemplateStep implements TestStepInterface */ public function run() { - $this->productTemplate->persist(); + $this->attributeSet->persist(); - return ['productTemplate' => $this->productTemplate]; + return ['attributeSet' => $this->attributeSet]; } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeSetStep.php similarity index 93% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveProductTemplateStep.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeSetStep.php index 759f036f3f818a5e024b9ae80253c4d0895737eb..2b7e0ac641f20cbda67cd693cc3696d5e4ea62c4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveProductTemplateStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/SaveAttributeSetStep.php @@ -12,7 +12,7 @@ use Magento\Mtf\TestStep\TestStepInterface; /** * Save attributeSet on attribute set page. */ -class SaveProductTemplateStep implements TestStepInterface +class SaveAttributeSetStep implements TestStepInterface { /** * Catalog ProductSet Edit page. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml index 92c41c11a06ef9e15ec3f1f2fa85775387f59ee3..aaf0ac2bcbda12b35e15d84c59dd1cd0c8c9e0fd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/di.xml @@ -76,22 +76,22 @@ <argument name="severity" xsi:type="string">middle</argument> </arguments> </type> - <type name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessSaveMessage"> + <type name="Magento\Catalog\Test\Constraint\AssertAttributeSetSuccessSaveMessage"> <arguments> <argument name="severity" xsi:type="string">high</argument> </arguments> </type> - <type name="Magento\Catalog\Test\Constraint\AssertProductTemplateForm"> + <type name="Magento\Catalog\Test\Constraint\AssertAttributeSetForm"> <arguments> <argument name="severity" xsi:type="string">high</argument> </arguments> </type> - <type name="Magento\Catalog\Test\Constraint\AssertProductTemplateInGrid"> + <type name="Magento\Catalog\Test\Constraint\AssertAttributeSetInGrid"> <arguments> <argument name="severity" xsi:type="string">high</argument> </arguments> </type> - <type name="Magento\Catalog\Test\Constraint\AssertProductTemplateOnProductForm"> + <type name="Magento\Catalog\Test\Constraint\AssertAttributeSetOnProductForm"> <arguments> <argument name="severity" xsi:type="string">high</argument> </arguments> @@ -126,7 +126,7 @@ <argument name="severity" xsi:type="string">high</argument> </arguments> </type> - <type name="Magento\Catalog\Test\Constraint\AssertProductTemplateGroupOnProductForm"> + <type name="Magento\Catalog\Test\Constraint\AssertAttributeSetGroupOnProductForm"> <arguments> <argument name="severity" xsi:type="string">high</argument> </arguments> @@ -136,7 +136,7 @@ <argument name="severity" xsi:type="string">high</argument> </arguments> </type> - <type name="Magento\Catalog\Test\Constraint\AssertProductTemplateSuccessDeleteMessage"> + <type name="Magento\Catalog\Test\Constraint\AssertAttributeSetSuccessDeleteMessage"> <arguments> <argument name="severity" xsi:type="string">high</argument> </arguments> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/testcase.xml index 4e02d8c777cdae0624fb21d771f32920a66a3c69..c1d721c45f35024071b54adffd8335758edacaa8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/testcase.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/testcase.xml @@ -16,12 +16,12 @@ <step name="setDefaultAttributeValue" module="Magento_Catalog" next="saveProduct"/> <step name="saveProduct" module="Magento_Catalog"/> </scenario> - <scenario name="CreateProductAttributeEntityTest" firstStep="createProductTemplate"> - <step name="createProductTemplate" module="Magento_Catalog" next="openProductAttributesPage"/> + <scenario name="CreateProductAttributeEntityTest" firstStep="createAttributeSet"> + <step name="createAttributeSet" module="Magento_Catalog" next="openProductAttributesPage"/> <step name="openProductAttributesPage" module="Magento_Catalog" next="addNewAttribute"/> <step name="addNewAttribute" module="Magento_Catalog" next="fillAttributeForm"/> <step name="fillAttributeForm" module="Magento_Catalog" next="saveAttribute"/> - <step name="saveAttribute" module="Magento_Catalog" next="addAttributeToProductTemplate"/> - <step name="addAttributeToProductTemplate" module="Magento_Catalog"/> + <step name="saveAttribute" module="Magento_Catalog" next="addAttributeToAttributeSet"/> + <step name="addAttributeToAttributeSet" module="Magento_Catalog"/> </scenario> </config> 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 1c7edf16fe5f56fa2bbca505492f728c8a8e3063..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 product template 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 product template 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/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml index 4c384ea3f8853265fa0ba9877a56492a871914dc..c75becfb6b45fd1b54a25031a6d17f0d94586d4c 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml @@ -249,7 +249,7 @@ <data name="salesRule/data/website_ids/0" xsi:type="string">Main Website</data> <data name="salesRule/data/customer_group_ids/0" xsi:type="string">NOT LOGGED IN</data> <data name="salesRule/data/coupon_type" xsi:type="string">No Coupon</data> - <data name="salesRule/data/conditions_serialized" xsi:type="string">{Product attribute combination:[Product Template|is|Default]}</data> + <data name="salesRule/data/conditions_serialized" xsi:type="string">{Product attribute combination:[Attribute Set|is|Default]}</data> <data name="salesRule/data/simple_action" xsi:type="string">Percent of product price discount</data> <data name="salesRule/data/discount_amount" xsi:type="string">50</data> <data name="salesRule/data/apply_to_shipping" xsi:type="string">No</data> 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/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php index 1bdedf647cb0b99bd7ccfff33cd1ed1782eec882..ce13fcc374129d215af42f18ccd4cb4c8423ba5a 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest.php @@ -24,15 +24,15 @@ use Magento\Mtf\TestCase\Injectable; * 7. Go to Stores > Attributes > Product and add new attribute. * 8. Select Fixed Product Tax type and fill attribute label. * 9. Save attribute. - * 10. Go to Stores > Attributes > Product Template. - * 11. Add new product template based on default. + * 10. Go to Stores > Attributes > Attribute Set. + * 11. Add new attribute set based on default. * 12. Add created FPT attribute to Product Details group and fill set name. * 13. Save attribute set. * * Steps: * 1. Go to Products > Catalog. * 2. Add new product. - * 3. Select created product template. + * 3. Select created attribute set. * 4. Fill data according to dataset. * 5. Save product. * 6. Go to Stores > Configuration. @@ -69,12 +69,12 @@ class CreateTaxWithFptTest extends Injectable $this->fixtureFactory = $fixtureFactory; $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'johndoe_with_addresses']); $customer->persist(); - $productTemplate = $this->fixtureFactory + $attributeSet = $this->fixtureFactory ->createByCode('catalogAttributeSet', ['dataset' => 'custom_attribute_set_with_fpt']); - $productTemplate->persist(); + $attributeSet->persist(); return [ 'customer' => $customer, - 'productTemplate' => $productTemplate + 'attributeSet' => $attributeSet ]; } @@ -97,7 +97,7 @@ class CreateTaxWithFptTest extends Injectable * * @param string $configData * @param Customer $customer - * @param CatalogAttributeSet $productTemplate + * @param CatalogAttributeSet $attributeSet * @param array $productData * @return array */ @@ -105,12 +105,12 @@ class CreateTaxWithFptTest extends Injectable $productData, $configData, Customer $customer, - CatalogAttributeSet $productTemplate + CatalogAttributeSet $attributeSet ) { $this->fixtureFactory->createByCode('taxRule', ['dataset' => 'tax_rule_default'])->persist(); $product = $this->fixtureFactory->createByCode( 'catalogProductSimple', - ['dataset' => $productData, 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]]] + ['dataset' => $productData, 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]]] ); $product->persist(); $this->objectManager->create( 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/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php index 6fdab58458c5d43ee1840d57a5d6e120487d090f..ddd37fc1cb63f24d3dc7d601856bc80a1d7a97ee 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Set/DeleteTest.php @@ -21,7 +21,7 @@ class DeleteTest extends \Magento\TestFramework\TestCase\AbstractBackendControll $this->assertNull($this->getAttributeSetByName('empty_attribute_set')); $this->assertSessionMessages( - $this->equalTo(['The product template has been removed.']), + $this->equalTo(['The attribute set has been removed.']), MessageInterface::TYPE_SUCCESS ); $this->assertRedirect($this->stringContains('catalog/product_set/index/')); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 3d839cb7e2064dd24e17b19dc43e1223e608de02..cb80c5cf1519d361cff0ca0284d06fbad8d285c9 100755 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -3949,8 +3949,8 @@ return [ ['Magento\Catalog\Ui\Component\Listing\Filters'], ['Magento\Customer\Ui\Component\Listing\Filters'], ['Magento\Catalog\Block\Product\TemplateSelector'], - ['Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\SuggestProductTemplates'], - ['Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit\SuggestProductTemplates'], + ['Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\SuggestAttributeSets'], + ['Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit\SuggestAttributeSets'], ['Magento\ConfigurableProduct\Block\Adminhtml\Product\Edit\Tab\Super\Config\Attribute'], ['Magento\Wishlist\Model\Observer'], ['Magento\Swatches\Model\Observer', 'Magento\Swatches\Observer\*'], diff --git a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php index 496ba2e8d173a62d6fbc89560d3925af7ff43234..6922234a56df3321cbbb4aba73a12acf97b9c072 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php +++ b/lib/internal/Magento/Framework/ObjectManager/Code/Generator/Repository.php @@ -467,20 +467,20 @@ class Repository extends \Magento\Framework\Code\Generator\EntityAbstract { $body = "\$collection = \$this->" . $this->_getSourceCollectionFactoryPropertyName() . "->create();\n" . "\$this->extensionAttributesJoinProcessor->process(\$collection);\n" - . "foreach (\$criteria->getFilterGroups() as \$filterGroup) {\n" + . "foreach (\$searchCriteria->getFilterGroups() as \$filterGroup) {\n" . " foreach (\$filterGroup->getFilters() as \$filter) {\n" . " \$condition = \$filter->getConditionType() ? \$filter->getConditionType() : 'eq';\n" . " \$collection->addFieldToFilter(\$filter->getField(), [\$condition => \$filter->getValue()]);\n" . " }\n" . "}\n" - . "\$collection->setCurPage(\$criteria->getCurrentPage());\n" - . "\$collection->setPageSize(\$criteria->getPageSize());\n" + . "\$collection->setCurPage(\$searchCriteria->getCurrentPage());\n" + . "\$collection->setPageSize(\$searchCriteria->getPageSize());\n" . "return \$collection;\n"; return [ 'name' => 'getList', 'parameters' => [ [ - 'name' => 'criteria', + 'name' => 'searchCriteria', 'type' => self::SEARCH_CRITERIA, ], ], @@ -490,7 +490,7 @@ class Repository extends \Magento\Framework\Code\Generator\EntityAbstract 'tags' => [ [ 'name' => 'param', - 'description' => self::SEARCH_CRITERIA . ' $criteria', + 'description' => self::SEARCH_CRITERIA . ' $searchCriteria', ], [ 'name' => 'return', diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt index d135ca64dd1fccfc3382920cd9d3a6d02daa6750..803d9828cf54dd50d5fcf56752d61d9f0937103f 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Code/Generator/_files/SampleRepository.txt @@ -103,21 +103,21 @@ class SampleRepository implements \Magento\Framework\ObjectManager\Code\Generato /** * Find entities by criteria * - * @param \Magento\Framework\Api\SearchCriteria $criteria + * @param \Magento\Framework\Api\SearchCriteria $searchCriteria * @return \Magento\Framework\ObjectManager\Code\Generator\SampleInterface[] */ - public function getList(\Magento\Framework\Api\SearchCriteria $criteria) + public function getList(\Magento\Framework\Api\SearchCriteria $searchCriteria) { $collection = $this->sampleInterfaceSearchResultFactory->create(); $this->extensionAttributesJoinProcessor->process($collection); - foreach ($criteria->getFilterGroups() as $filterGroup) { + foreach ($searchCriteria->getFilterGroups() as $filterGroup) { foreach ($filterGroup->getFilters() as $filter) { $condition = $filter->getConditionType() ? $filter->getConditionType() : 'eq'; $collection->addFieldToFilter($filter->getField(), [$condition => $filter->getValue()]); } } - $collection->setCurPage($criteria->getCurrentPage()); - $collection->setPageSize($criteria->getPageSize()); + $collection->setCurPage($searchCriteria->getCurrentPage()); + $collection->setPageSize($searchCriteria->getPageSize()); return $collection; } 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; } /**