diff --git a/.php_cs b/.php_cs index 86d1826adbeb2..56fc26c7e9c80 100644 --- a/.php_cs +++ b/.php_cs @@ -1,4 +1,12 @@ name('*.phtml') ->exclude('dev/tests/functional/generated') diff --git a/app/autoload.php b/app/autoload.php index eb7f18ee35066..e200875ae7203 100644 --- a/app/autoload.php +++ b/app/autoload.php @@ -14,8 +14,14 @@ $vendorDir = require BP . '/app/etc/vendor_path.php'; $vendorAutoload = BP . "/{$vendorDir}/autoload.php"; + +/* 'composer install' validation */ if (file_exists($vendorAutoload)) { $composerAutoloader = include $vendorAutoload; +} else { + throw new \Exception( + 'Vendor autoload is not found. Please run \'composer install\' under application root directory.' + ); } AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader)); diff --git a/app/code/Magento/AdminGws/Model/Containers.php b/app/code/Magento/AdminGws/Model/Containers.php index 2473f0d7e9a4e..f11a1d7fbf250 100644 --- a/app/code/Magento/AdminGws/Model/Containers.php +++ b/app/code/Magento/AdminGws/Model/Containers.php @@ -33,22 +33,30 @@ class Containers implements CallbackProcessorInterface */ protected $categoryResource; + /** + * @var \Magento\Store\Model\StoreManagerInterface + */ + protected $storeManager; + /** * @param Role $role * @param \Magento\Framework\Registry $registry * @param \Magento\Cms\Model\Resource\Page $cmsPageResource * @param \Magento\Catalog\Model\Resource\Category $categoryResource + * @param \Magento\Store\Model\StoreManagerInterface $storeManager */ public function __construct( Role $role, \Magento\Framework\Registry $registry, \Magento\Cms\Model\Resource\Page $cmsPageResource, - \Magento\Catalog\Model\Resource\Category $categoryResource + \Magento\Catalog\Model\Resource\Category $categoryResource, + \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_role = $role; $this->registry = $registry; $this->cmsPageResource = $cmsPageResource; $this->categoryResource = $categoryResource; + $this->storeManager = $storeManager; } /** @@ -367,8 +375,27 @@ public function removeRatingEditButtons(ContainerInterface $container) */ public function removeCmsHierarchyFormButtons(ContainerInterface $container) { + $websiteId = null; + $storeId = null; + + if ($container->getRequest()->getParam('website')) { + if ($website = $this->storeManager->getWebsite($container->getRequest()->getParam('website'))) { + $websiteId = $website->getId(); + } + } + if ($container->getRequest()->getParam('store')) { + if ($store = $this->storeManager->getStore($container->getRequest()->getParam('store'))) { + $storeId = $store->getId(); + $websiteId = $store->getWebsite()->getWebsiteId(); + } + } + if (!$this->_role->getIsAll()) { - $container->removeButton('save'); + if (!$this->_role->hasExclusiveAccess([$websiteId]) || is_null($websiteId)) { + if (!$this->_role->hasExclusiveStoreAccess([$storeId]) || is_null($storeId)) { + $container->removeButton('save'); + } + } } } diff --git a/app/code/Magento/AdminGws/Model/Controllers.php b/app/code/Magento/AdminGws/Model/Controllers.php index ac59e4e1281f7..97ab46c6a502a 100644 --- a/app/code/Magento/AdminGws/Model/Controllers.php +++ b/app/code/Magento/AdminGws/Model/Controllers.php @@ -1110,6 +1110,37 @@ public function blockIndexAction() return false; } + /** + * Validates hierarchy actions for all GWS limited users. + * + * @return bool + */ + public function validateCmsHierarchyAction() + { + $websiteId = null; + $storeId = null; + if ($this->_request->getPost('website')) { + if ($website = $this->_storeManager->getWebsite($this->_request->getPost('website'))) { + $websiteId = $website->getId(); + } + } + if ($this->_request->getPost('store')) { + if ($store = $this->_storeManager->getStore($this->_request->getPost('store'))) { + $storeId = $store->getId(); + $websiteId = $store->getWebsite()->getWebsiteId(); + } + } + if (!$this->_role->getIsAll()) { + if (!$this->_role->hasExclusiveAccess([$websiteId]) || is_null($websiteId)) { + if (!$this->_role->hasExclusiveStoreAccess([$storeId]) || is_null($storeId)) { + $this->_forward(); + return false; + } + } + } + return true; + } + /** * Validate misc Manage Currency Rates requests * diff --git a/app/code/Magento/AdminGws/composer.json b/app/code/Magento/AdminGws/composer.json index 95bef6be8503b..7ae3f03cf6df9 100644 --- a/app/code/Magento/AdminGws/composer.json +++ b/app/code/Magento/AdminGws/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-review": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-catalog-event": "0.1.0-alpha107", - "magento/module-checkout-agreements": "0.1.0-alpha107", - "magento/module-gift-registry": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/module-reminder": "0.1.0-alpha107", - "magento/module-customer-segment": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-user": "0.1.0-alpha107", - "magento/module-url-rewrite": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-review": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-catalog-event": "0.1.0-alpha108", + "magento/module-checkout-agreements": "0.1.0-alpha108", + "magento/module-gift-registry": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/module-reminder": "0.1.0-alpha108", + "magento/module-customer-segment": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-user": "0.1.0-alpha108", + "magento/module-url-rewrite": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/AdminGws/etc/adminhtml/admingws.xml b/app/code/Magento/AdminGws/etc/adminhtml/admingws.xml index d936ef1da827e..66b9802429a6b 100644 --- a/app/code/Magento/AdminGws/etc/adminhtml/admingws.xml +++ b/app/code/Magento/AdminGws/etc/adminhtml/admingws.xml @@ -204,7 +204,9 @@ - + + + diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index 7ba3d56311ed3..88913e187d7de 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index.php b/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index.php index 752eeabd0acaf..e4c41dc327c33 100644 --- a/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index.php +++ b/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index.php @@ -30,13 +30,25 @@ class Index extends \Magento\Backend\App\Action protected $_registry = null; /** - * @param \Magento\Backend\App\Action\Context $context + * Customer builder + * + * @var \Magento\Customer\Api\Data\CustomerDataBuilder + */ + protected $customerBuilder; + + /** + * @param Action\Context $context * @param \Magento\Framework\Registry $registry + * @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder */ - public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $registry) - { + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\Framework\Registry $registry, + \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder + ) { parent::__construct($context); $this->_registry = $registry; + $this->customerBuilder = $customerBuilder; } /** @@ -81,7 +93,7 @@ protected function _initData($useRedirects = true) ) { if ($useRedirects) { $this->messageManager->addError(__('Shopping cart management disabled for this customer.')); - $this->_redirect('customer/index/edit', ['id' => $customer->getId()]); + $this->_redirect('customer/index/edit', ['id' => $customerId]); $this->_redirectFlag = true; return $this; } else { @@ -141,7 +153,8 @@ protected function _initData($useRedirects = true) } else { // customer and addresses should be set to resolve situation when no quote was saved for customer previously // otherwise quote would be saved with customer_id = null and zero totals - $quote->setStore($storeManager->getStore($storeId))->setCustomer($customer); + $customerDataObject = $this->customerBuilder->populateWithArray($customer->getData())->create(); + $quote->setStore($storeManager->getStore($storeId))->setCustomer($customerDataObject); $quote->getBillingAddress(); $quote->getShippingAddress(); $this->_objectManager->get('Magento\Sales\Model\QuoteRepository')->save($quote); diff --git a/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index/LoadBlock.php b/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index/LoadBlock.php index 22601b784a891..f82ba57e59e0f 100644 --- a/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index/LoadBlock.php +++ b/app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index/LoadBlock.php @@ -18,14 +18,16 @@ class LoadBlock extends \Magento\AdvancedCheckout\Controller\Adminhtml\Index /** * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Framework\Registry $registry + * @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder * @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $registry, + \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder, \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory ) { - parent::__construct($context, $registry); + parent::__construct($context, $registry, $customerBuilder); $this->resultLayoutFactory = $resultLayoutFactory; } diff --git a/app/code/Magento/AdvancedCheckout/Controller/Cart/RemoveFailed.php b/app/code/Magento/AdvancedCheckout/Controller/Cart/RemoveFailed.php index 2c08be2aecb5d..c637edacc6af5 100644 --- a/app/code/Magento/AdvancedCheckout/Controller/Cart/RemoveFailed.php +++ b/app/code/Magento/AdvancedCheckout/Controller/Cart/RemoveFailed.php @@ -5,8 +5,27 @@ */ namespace Magento\AdvancedCheckout\Controller\Cart; +use Magento\Framework\App\Action\Context; + class RemoveFailed extends \Magento\AdvancedCheckout\Controller\Cart { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Context $context + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Context $context, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context); + $this->urlDecoder = $urlDecoder; + } + /** * Remove failed items from storage * @@ -15,7 +34,7 @@ class RemoveFailed extends \Magento\AdvancedCheckout\Controller\Cart public function execute() { $removed = $this->_getFailedItemsCart()->removeAffectedItem( - $this->_objectManager->get('Magento\Core\Helper\Url')->urlDecode($this->getRequest()->getParam('sku')) + $this->urlDecoder->decode($this->getRequest()->getParam('sku')) ); if ($removed) { diff --git a/app/code/Magento/AdvancedCheckout/composer.json b/app/code/Magento/AdvancedCheckout/composer.json index 9a956d7ce611a..f19329505557f 100644 --- a/app/code/Magento/AdvancedCheckout/composer.json +++ b/app/code/Magento/AdvancedCheckout/composer.json @@ -3,29 +3,29 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-product-alert": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-gift-card": "0.1.0-alpha107", - "magento/module-downloadable": "0.1.0-alpha107", - "magento/module-msrp": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-product-alert": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-gift-card": "0.1.0-alpha108", + "magento/module-downloadable": "0.1.0-alpha108", + "magento/module-msrp": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 1ba2cad3ffcff..71d8c8417bbbb 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -3,12 +3,12 @@ "description": "Authorization module provides access to Magento ACL functionality.", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index f886854abd08b..afb76898e10a7 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-centinel": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-centinel": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js b/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js index e7da6150feebb..e2e7d4dde0e4e 100644 --- a/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js +++ b/app/code/Magento/Authorizenet/view/frontend/web/js/direct-post.js @@ -24,7 +24,7 @@ define([ hiddenFormTmpl: '
' + '{{each(key, val) inputs}} {{/each}}' + '
', - reviewAgreementForm: '#checkout-agreements', + reviewAgreementForm: '#checkout-agreements form', cgiUrl: null, orderSaveUrl: null, controller: null diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php b/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php index 42d4bda76f867..868645fd0a919 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Fieldset.php @@ -8,6 +8,8 @@ */ namespace Magento\Backend\Block\System\Config\Form; +use Magento\Framework\Data\Form\Element\AbstractElement; + class Fieldset extends \Magento\Backend\Block\AbstractBlock implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface { @@ -21,6 +23,13 @@ class Fieldset extends \Magento\Backend\Block\AbstractBlock implements */ protected $_jsHelper; + /** + * Whether is collapsed by default + * + * @var bool + */ + protected $isCollapsedDefault = false; + /** * @param \Magento\Backend\Block\Context $context * @param \Magento\Backend\Model\Auth\Session $authSession @@ -41,7 +50,7 @@ public function __construct( /** * Render fieldset html * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) @@ -65,7 +74,7 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele /** * Return header html for fieldset * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getHeaderHtml($element) @@ -110,9 +119,8 @@ protected function _getHeaderHtml($element) /** * Get frontend class * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _getFrontendClass($element) { @@ -124,7 +132,7 @@ protected function _getFrontendClass($element) /** * Return header title part of html for fieldset * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getHeaderTitleHtml($element) @@ -144,7 +152,7 @@ protected function _getHeaderTitleHtml($element) /** * Return header comment part of html for fieldset * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getHeaderCommentHtml($element) @@ -169,7 +177,7 @@ protected function _getFieldsetCss() * Return footer html for fieldset * Add extra tooltip comments to elements * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getFooterHtml($element) @@ -199,7 +207,7 @@ protected function _getFooterHtml($element) * - observe fieldset rows; * - apply collapse; * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return string */ protected function _getExtraJs($element) @@ -212,7 +220,7 @@ protected function _getExtraJs($element) /** * Collapsed or expanded fieldset when page loaded? * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * @param AbstractElement $element * @return bool */ protected function _isCollapseState($element) @@ -220,10 +228,11 @@ protected function _isCollapseState($element) if ($element->getExpanded()) { return true; } + $extra = $this->_authSession->getUser()->getExtra(); if (isset($extra['configState'][$element->getId()])) { return $extra['configState'][$element->getId()]; } - return false; + return $this->isCollapsedDefault; } } diff --git a/app/code/Magento/Backend/Block/System/Store/Delete.php b/app/code/Magento/Backend/Block/System/Store/Delete.php index d86d5dfcf2c52..80032cbcb3f05 100644 --- a/app/code/Magento/Backend/Block/System/Store/Delete.php +++ b/app/code/Magento/Backend/Block/System/Store/Delete.php @@ -28,7 +28,7 @@ protected function _construct() $this->buttonList->remove('save'); $this->buttonList->remove('reset'); - $this->buttonList->update('delete', 'region', 'footer'); + $this->buttonList->update('delete', 'region', 'toolbar'); $this->buttonList->update('delete', 'onclick', null); $this->buttonList->update( 'delete', @@ -41,7 +41,7 @@ protected function _construct() ['label' => __('Cancel'), 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')'], 2, 100, - 'footer' + 'toolbar' ); } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php index 4170a61ce08a9..dbccfdd26931b 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Config/State.php @@ -17,14 +17,14 @@ class State extends AbstractScopeConfig * @param \Magento\Backend\Model\Config\Structure $configStructure * @param \Magento\Backend\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker * @param \Magento\Backend\Model\Config $backendConfig - * @param \Magento\Backend\Model\View\Result\RedirectFactory $resultRawFactory + * @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\Backend\Controller\Adminhtml\System\ConfigSectionChecker $sectionChecker, \Magento\Backend\Model\Config $backendConfig, - \Magento\Backend\Model\View\Result\RedirectFactory $resultRawFactory + \Magento\Framework\Controller\Result\RawFactory $resultRawFactory ) { parent::__construct($context, $configStructure, $sectionChecker, $backendConfig); $this->resultRawFactory = $resultRawFactory; diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php index 73f13a070c5f5..3b1b7149aed18 100644 --- a/app/code/Magento/Backend/Model/Session/Quote.php +++ b/app/code/Magento/Backend/Model/Session/Quote.php @@ -140,7 +140,7 @@ public function getQuote() $this->quoteRepository->save($this->_quote); $this->setQuoteId($this->_quote->getId()); } else { - $this->_quote = $this->quoteRepository->get($this->getQuoteId()); + $this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]); $this->_quote->setStoreId($this->getStoreId()); } diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index 709375aa75774..05df2a2799ec6 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-cron": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-user": "0.1.0-alpha107", - "magento/module-backup": "0.1.0-alpha107", - "magento/module-email": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-translation": "0.1.0-alpha107", - "magento/module-require-js": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-cron": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-user": "0.1.0-alpha108", + "magento/module-backup": "0.1.0-alpha108", + "magento/module-email": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-translation": "0.1.0-alpha108", + "magento/module-require-js": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Backend/etc/adminhtml/system.xml b/app/code/Magento/Backend/etc/adminhtml/system.xml index 85606547aad08..46b73ca4621c4 100644 --- a/app/code/Magento/Backend/etc/adminhtml/system.xml +++ b/app/code/Magento/Backend/etc/adminhtml/system.xml @@ -401,7 +401,7 @@ Please enter a number 1 or greater in this field. - required-entry validate-digits validate-digits-range digits-range-1- + required-entry integer validate-greater-than-zero Magento\Backend\Model\Config\Backend\Admin\Password\Link\Expirationperiod diff --git a/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml b/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml index ce05ab1a768e1..a043f39c7c25c 100644 --- a/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml +++ b/app/code/Magento/Backend/view/adminhtml/templates/system/config/edit.phtml @@ -345,7 +345,7 @@ require([ handleHash(); }); - - jQuery('body').trigger('adminConfigDefined'); + + jQuery(window).load(function(){jQuery('body').trigger('adminConfigDefined')}) }); diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index 331f3547ca906..736fe39278ff5 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cron": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cron": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Banner/composer.json b/app/code/Magento/Banner/composer.json index 9252a28a83c77..6322d4e5d44fd 100644 --- a/app/code/Magento/Banner/composer.json +++ b/app/code/Magento/Banner/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Banner/data/banner_setup/data-install-1.11.0.1.php b/app/code/Magento/Banner/data/banner_setup/data-install-2.0.0.php similarity index 100% rename from app/code/Magento/Banner/data/banner_setup/data-install-1.11.0.1.php rename to app/code/Magento/Banner/data/banner_setup/data-install-2.0.0.php diff --git a/app/code/Magento/BannerCustomerSegment/composer.json b/app/code/Magento/BannerCustomerSegment/composer.json index 10e35159a110c..f03e92d877c5f 100644 --- a/app/code/Magento/BannerCustomerSegment/composer.json +++ b/app/code/Magento/BannerCustomerSegment/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-banner": "0.1.0-alpha107", - "magento/module-customer-segment": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-banner": "0.1.0-alpha108", + "magento/module-customer-segment": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php index 3a3da12ec5ab2..4868f3b09423f 100644 --- a/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php +++ b/app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php @@ -122,13 +122,14 @@ public function getValue() $value = $product->getData('final_price') * ($selectionPriceValue / 100); } else { // calculate price for selection type fixed - $value = $this->priceCurrency->convertAndRound($selectionPriceValue); + $value = $this->priceCurrency->convert($selectionPriceValue) * $this->quantity; } } if (!$this->useRegularPrice) { $value = $this->discountCalculator->calculateDiscount($this->bundleProduct, $value); } - $this->value = $value; + $this->value = $this->priceCurrency->round($value); + return $this->value; } diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index 2c71fe3be245a..06a885ddc94bd 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -3,24 +3,24 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-gift-message": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-webapi": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-gift-message": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-webapi": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml index 9400bd038a580..766cfdb8d4af9 100644 --- a/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/templates/product/edit/bundle/option.phtml @@ -186,18 +186,22 @@ Bundle.Option.prototype = { remove : function(event){ var element = Event.findElement(event, 'div').up('.option-box'); + if (element) { + var idInput = Element.select(element, '[name$="[option_id]"]')[0]; + if (idInput.value == '') { + element.remove(); + } else { + Element.select(element, '[data-state="deleted"]').each(function (elem) { + elem.value = '1'; + }); - if(element){ - Element.select(element, '[data-state="deleted"]').each(function(elem) { - elem.value = '1'; - }); - - Element.select(element, ['input', 'select']).each(function(elem) { - elem.hide(); - elem.className = ''; - }); + Element.select(element, ['input', 'select']).each(function (elem) { + elem.hide(); + elem.className = ''; + }); - Element.hide(element); + Element.hide(element); + } } }, diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 53190e686328f..062b0339ca492 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 91f19d1f7e735..4278c18adb3f4 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php index bb0a3d90c5024..8746bd4877e8a 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php @@ -252,7 +252,7 @@ public function getNode($parentNodeCategory, $recursionLevel = 2) */ public function getSaveUrl(array $args = []) { - $params = ['_current' => false, '_query' => false]; + $params = ['_current' => false, '_query' => false, 'store' => $this->getStore()->getId()]; $params = array_merge($params, $args); return $this->getUrl('catalog/*/save', $params); } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php index 7299f101977a3..5e470317e2bf6 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php @@ -185,12 +185,17 @@ public function execute() ); } + $redirectParams = [ + '_current' => true, + 'id' => $category->getId() + ]; + if ($storeId) { + $redirectParams['store'] = $storeId; + } + return $resultRedirect->setPath( 'catalog/*/edit', - [ - '_current' => true, - 'id' => $category->getId() - ] + $redirectParams ); } } diff --git a/app/code/Magento/Catalog/Controller/Product/Compare/Index.php b/app/code/Magento/Catalog/Controller/Product/Compare/Index.php index 825dea8063df8..60700d407579f 100644 --- a/app/code/Magento/Catalog/Controller/Product/Compare/Index.php +++ b/app/code/Magento/Catalog/Controller/Product/Compare/Index.php @@ -5,8 +5,67 @@ */ namespace Magento\Catalog\Controller\Product\Compare; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Core\App\Action\FormKeyValidator; +use Magento\Framework\Controller\Result; +use Magento\Framework\View\Result\PageFactory; + class Index extends \Magento\Catalog\Controller\Product\Compare { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param \Magento\Framework\App\Action\Context $context + * @param \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory + * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory + * @param \Magento\Customer\Model\Session $customerSession + * @param \Magento\Customer\Model\Visitor $customerVisitor + * @param \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList + * @param \Magento\Catalog\Model\Session $catalogSession + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param FormKeyValidator $formKeyValidator + * @param Result\RedirectFactory $resultRedirectFactory + * @param PageFactory $resultPageFactory + * @param ProductRepositoryInterface $productRepository + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + \Magento\Framework\App\Action\Context $context, + \Magento\Catalog\Model\Product\Compare\ItemFactory $compareItemFactory, + \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, + \Magento\Customer\Model\Session $customerSession, + \Magento\Customer\Model\Visitor $customerVisitor, + \Magento\Catalog\Model\Product\Compare\ListCompare $catalogProductCompareList, + \Magento\Catalog\Model\Session $catalogSession, + \Magento\Store\Model\StoreManagerInterface $storeManager, + FormKeyValidator $formKeyValidator, + Result\RedirectFactory $resultRedirectFactory, + PageFactory $resultPageFactory, + ProductRepositoryInterface $productRepository, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct( + $context, + $compareItemFactory, + $itemCollectionFactory, + $customerSession, + $customerVisitor, + $catalogProductCompareList, + $catalogSession, + $storeManager, + $formKeyValidator, + $resultRedirectFactory, + $resultPageFactory, + $productRepository + ); + $this->urlDecoder = $urlDecoder; + } + /** * Compare index action * @@ -19,7 +78,7 @@ public function execute() $beforeUrl = $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED); if ($beforeUrl) { $this->_catalogSession->setBeforeCompareUrl( - $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode($beforeUrl) + $this->urlDecoder->decode($beforeUrl) ); } diff --git a/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php new file mode 100644 index 0000000000000..b18eb5606580e --- /dev/null +++ b/app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/Execute.php @@ -0,0 +1,48 @@ +config = $config; + $this->typeList = $typeList; + } + + /** + * @param AbstractAction $subject + * @param AbstractAction $result + * @return AbstractAction + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterExecute(AbstractAction $subject, AbstractAction $result) + { + if ($this->config->isEnabled()) { + $this->typeList->invalidate('full_page'); + } + return $result; + } +} diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 607b31bc7a307..f0b89746bede9 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -3,33 +3,33 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-log": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-msrp": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-product-alert": "0.1.0-alpha107", - "magento/module-url-rewrite": "0.1.0-alpha107", - "magento/module-catalog-url-rewrite": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-log": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-msrp": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-product-alert": "0.1.0-alpha108", + "magento/module-url-rewrite": "0.1.0-alpha108", + "magento/module-catalog-url-rewrite": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index fcc101ebddf36..aba41438ff8de 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -59,4 +59,8 @@ + + + + diff --git a/app/code/Magento/Catalog/view/adminhtml/web/product/product.css b/app/code/Magento/Catalog/view/adminhtml/web/product/product.css index f143e5778ab90..160ca18bb803d 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/product/product.css +++ b/app/code/Magento/Catalog/view/adminhtml/web/product/product.css @@ -49,7 +49,7 @@ .product-actions .switcher { display: inline-block; vertical-align: top; - margin: 6px 0 6px 6px; + margin: 3px 0 6px 6px; } /* Image Management */ @@ -208,6 +208,10 @@ content: ''; } +.gallery .image .action-make-base { + width: 70%; +} + .gallery .image .action-delete { top: 5px; right: 5px; diff --git a/app/code/Magento/CatalogEvent/composer.json b/app/code/Magento/CatalogEvent/composer.json index ad6b40e241fe1..adb5829c84184 100644 --- a/app/code/Magento/CatalogEvent/composer.json +++ b/app/code/Magento/CatalogEvent/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php index a8b42a77aeab7..1f8ac93fd8125 100644 --- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php +++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php @@ -973,7 +973,9 @@ protected function _getExportData() $dataRow[self::COL_SKU] = null; $dataRow[self::COL_ATTR_SET] = null; $dataRow[self::COL_TYPE] = null; - $dataRow[self::COL_VISIBILITY] = $productData[$defaultStoreId][self::COL_VISIBILITY]; + if (isset($productData[$defaultStoreId][self::COL_VISIBILITY])) { + $dataRow[self::COL_VISIBILITY] = $productData[$defaultStoreId][self::COL_VISIBILITY]; + } } else { $dataRow[self::COL_STORE] = null; if (isset($stockItemRows[$productId])) { diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 72fa41c190eb5..f48b9111f2128 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index eb095df595f68..861e69da48fe2 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogPermissions/composer.json b/app/code/Magento/CatalogPermissions/composer.json index 74b075c2c1a30..3db204038a48c 100644 --- a/app/code/Magento/CatalogPermissions/composer.json +++ b/app/code/Magento/CatalogPermissions/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 27c49eb581068..eac9e919ed86f 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-rule": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-rule": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php index 33ab1e5e38431..710775164b559 100644 --- a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php +++ b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php @@ -79,7 +79,8 @@ protected function _getItemsData() { $attribute = $this->getAttributeModel(); /** @var \Magento\CatalogSearch\Model\Resource\Fulltext\Collection $productCollection */ - $productCollection = $this->getLayer()->getProductCollection(); + $productCollection = $this->getLayer() + ->getProductCollection(); $optionsFacetedData = $productCollection->getFacetedData($attribute->getAttributeCode()); $productSize = $productCollection->getSize(); @@ -91,9 +92,9 @@ protected function _getItemsData() continue; } // Check filter type - if ($this->getAttributeIsFilterable($attribute) == static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS - && (empty($optionsFacetedData[$option['value']]['count']) - || !$this->isOptionReducesResults($optionsFacetedData[$option['value']]['count'], $productSize)) + if (empty($optionsFacetedData[$option['value']]['count']) + || ($this->getAttributeIsFilterable($attribute) == static::ATTRIBUTE_OPTIONS_ONLY_WITH_RESULTS + && !$this->isOptionReducesResults($optionsFacetedData[$option['value']]['count'], $productSize)) ) { continue; } diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php index 8fcdb929eb637..f20d6544bd44c 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -174,13 +174,13 @@ protected function _renderFiltersBefore() $this->requestBuilder->bind('search_term', $this->queryText); } - $this->requestBuilder->bind( - 'price_dynamic_algorithm', - $this->_scopeConfig->getValue( - \Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory::XML_PATH_RANGE_CALCULATION, - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ) + $priceRangeCalculation = $this->_scopeConfig->getValue( + \Magento\Catalog\Model\Layer\Filter\Dynamic\AlgorithmFactory::XML_PATH_RANGE_CALCULATION, + \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); + if ($priceRangeCalculation) { + $this->requestBuilder->bind('price_dynamic_algorithm', $priceRangeCalculation); + } $this->requestBuilder->setRequestName('quick_search_container'); $queryRequest = $this->requestBuilder->create(); diff --git a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php index 088f703261fea..df7bd250c96e0 100644 --- a/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php +++ b/app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php @@ -125,7 +125,7 @@ protected function getSearchableAttributes() $productAttributes = $this->productAttributeCollectionFactory->create(); $productAttributes->addFieldToFilter( ['is_searchable', 'is_visible_in_advanced_search', 'is_filterable'], - [1, 1, 1] + [1, 1, [1, 2]] ); return $productAttributes; diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 592cb8e1df51e..d399a5d163f2f 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-search": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-search": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php index ceb3881883af9..3ce52182ba0ba 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php @@ -68,6 +68,9 @@ public function getUrlPath($category) return $path; } $path = $category->getUrlKey(); + if ($path === false) { + return $category->getUrlPath(); + } if ($this->isNeedToGenerateUrlPathForParent($category)) { $parentPath = $this->getUrlPath($this->categoryRepository->get($category->getParentId())); $path = $parentPath === '' ? $path : $parentPath . '/' . $path; diff --git a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogenerator.php b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogenerator.php index be8cafd88874d..bff78cbfa8b34 100644 --- a/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogenerator.php @@ -29,7 +29,9 @@ public function invoke(Observer $observer) { /** @var Category $category */ $category = $observer->getEvent()->getCategory(); - $category->setUrlKey($this->categoryUrlPathGenerator->generateUrlKey($category)) - ->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category)); + if ($category->getUrlKey() !== false) { + $category->setUrlKey($this->categoryUrlPathGenerator->generateUrlKey($category)) + ->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category)); + } } } diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index d8b61a16b9808..63ff62c8ece81 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-catalog-import-export": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-url-rewrite": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-catalog-import-export": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-url-rewrite": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 236077628d3ce..ec0575cc3fdcd 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-rule": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-rule": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml b/app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml index 6eb7168b9330c..5b368274432b1 100644 --- a/app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml +++ b/app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml @@ -24,10 +24,10 @@ $fieldAttributes = $fieldId . ' class="' . $fieldClass . '" ' . $this->getUiId(' diff --git a/app/code/Magento/Centinel/composer.json b/app/code/Magento/Centinel/composer.json index 0482a82cd02d1..c758ae8b393b9 100644 --- a/app/code/Magento/Centinel/composer.json +++ b/app/code/Magento/Centinel/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php index 1b11589918e96..00496f62cd207 100644 --- a/app/code/Magento/Checkout/Model/Type/Onepage.php +++ b/app/code/Magento/Checkout/Model/Type/Onepage.php @@ -786,6 +786,10 @@ protected function _prepareNewCustomerQuote() $customer = $quote->getCustomer(); $customerBillingData = $billing->exportCustomerAddress(); + $dataArray = $this->_objectCopyService->getDataFromFieldset('checkout_onepage_quote', 'to_customer', $quote); + $customer = $this->_customerBuilder->mergeDataObjectWithArray($customer, $dataArray); + $quote->setCustomer($customer->create())->setCustomerId(true); + $customerBillingData = $this->_addressBuilder->populate( $customerBillingData )->setDefaultBilling( @@ -813,10 +817,6 @@ protected function _prepareNewCustomerQuote() ->create(); } $billing->setCustomerAddressData($customerBillingData); - - $dataArray = $this->_objectCopyService->getDataFromFieldset('checkout_onepage_quote', 'to_customer', $quote); - $customer = $this->_customerBuilder->mergeDataObjectWithArray($customer, $dataArray); - $quote->setCustomer($customer->create())->setCustomerId(true); // TODO : Eventually need to remove this legacy hack // Add billing address to quote since customer Data Object does not hold address information $quote->addCustomerAddress($customerBillingData); diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 72a29caec819c..6bc5de2a32665 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-gift-message": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-msrp": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-gift-message": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-msrp": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml index 01d7aba771945..e3ba09c0a7c55 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/billing.phtml @@ -98,7 +98,7 @@
- +
diff --git a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml index ea5e740b61cb6..59c0c325c7309 100644 --- a/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml +++ b/app/code/Magento/Checkout/view/frontend/templates/onepage/shipping.phtml @@ -67,7 +67,7 @@
- +
@@ -102,8 +102,10 @@ getAddress()->getSameAsBilling()): ?> checked="checked" class="checkbox" />
-
-
+
+
+ +
diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 8f27bb7a04dc4..a251d39f5b2cf 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php index 878071667990f..29019f02ee3e8 100644 --- a/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php +++ b/app/code/Magento/Cms/Controller/Adminhtml/Wysiwyg/Directive.php @@ -5,8 +5,27 @@ */ namespace Magento\Cms\Controller\Adminhtml\Wysiwyg; +use Magento\Backend\App\Action; + class Directive extends \Magento\Backend\App\Action { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context); + $this->urlDecoder = $urlDecoder; + } + /** * Template directives callback * @@ -17,7 +36,7 @@ class Directive extends \Magento\Backend\App\Action public function execute() { $directive = $this->getRequest()->getParam('___directive'); - $directive = $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode($directive); + $directive = $this->urlDecoder->decode($directive); $url = $this->_objectManager->create('Magento\Email\Model\Template\Filter')->filter($directive); /** @var \Magento\Framework\Image\Adapter\AdapterInterface $image */ $image = $this->_objectManager->get('Magento\Framework\Image\AdapterFactory')->create(); diff --git a/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php b/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php index 08c8309cfc7a3..8c10225dd3e7a 100644 --- a/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php +++ b/app/code/Magento/Cms/Ui/DataProvider/Page/Row/Actions.php @@ -16,7 +16,7 @@ class Actions implements RowInterface /** * Url path */ - const URL_PATH = '*/*/edit'; + const URL_PATH = 'adminhtml/cms_page/edit'; /** * @var UrlBuilder diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index 11958cef5fe42..f3185cd2d3381 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-email": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-email": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php deleted file mode 100644 index 4d3f4e2eb3ade..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-install-1.6.0.0.php +++ /dev/null @@ -1,47 +0,0 @@ - '404 Not Found', - 'page_layout' => '2columns-right', - 'meta_keywords' => 'Page keywords', - 'meta_description' => 'Page description', - 'identifier' => 'no-route', - 'content_heading' => 'Whoops, our bad...', - 'content' => "
\r\n
The page you requested was not found, and we have a fine guess why.
\r\n
\r\n
    \r\n
  • If you typed the URL directly, please make sure the spelling is correct.
  • \r\n
  • If you clicked on a link to get here, the link is outdated.
  • \r\n
\r\n
\r\n
\r\n
What can you do?
\r\n
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
\r\n
\r\n
    \r\n
  • Go back to the previous page.
  • \r\n
  • Use the search bar at the top of the page to search for your products.
  • \r\n
  • Follow these links to get you back on track!
    Store Home | My Account
\r\n", - 'is_active' => 1, - 'stores' => [0], - 'sort_order' => 0, - ], - [ - 'title' => 'Home page', - 'page_layout' => '1column', - 'identifier' => 'home', - 'content_heading' => 'Home Page', - 'content' => "

CMS homepage content goes here.

\r\n", - 'is_active' => 1, - 'stores' => [0], - 'sort_order' => 0 - ], - [ - 'title' => 'Enable Cookies', - 'page_layout' => '1column', - 'identifier' => 'enable-cookies', - 'content_heading' => 'What are Cookies?', - 'content' => "
\r\n
Please enable cookies in your web browser to continue.
\r\n
\r\n

Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically whenever you visit our site so that we can personalize your experience and provide you with better service. We also use cookies (and similar browser data, such as Flash cookies) for fraud prevention and other purposes. If your web browser is set to refuse cookies from our website, you will not be able to complete a purchase or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.

\r\n

Enabling Cookies

\r\n \r\n

Internet Explorer 7.x

\r\n
    \r\n
  1. \r\n

    Start Internet Explorer

    \r\n
  2. \r\n
  3. \r\n

    Under the Tools menu, click Internet Options

    \r\n

    \"\"

    \r\n
  4. \r\n
  5. \r\n

    Click the Privacy tab

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Click the Advanced button

    \r\n

    \"\"

    \r\n
  8. \r\n
  9. \r\n

    Put a check mark in the box for Override Automatic Cookie Handling, put another check mark in the Always accept session cookies box

    \r\n

    \"\"

    \r\n
  10. \r\n
  11. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  12. \r\n
  13. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  14. \r\n
  15. \r\n

    Restart Internet Explore

    \r\n
  16. \r\n
\r\n

Back to Top

\r\n

Internet Explorer 6.x

\r\n
    \r\n
  1. \r\n

    Select Internet Options from the Tools menu

    \r\n

    \"\"

    \r\n
  2. \r\n
  3. \r\n

    Click on the Privacy tab

    \r\n
  4. \r\n
  5. \r\n

    Click the Default button (or manually slide the bar down to Medium) under Settings. Click OK

    \r\n

    \"\"

    \r\n
  6. \r\n
\r\n

Back to Top

\r\n

Mozilla/Firefox

\r\n
    \r\n
  1. \r\n

    Click on the Tools-menu in Mozilla

    \r\n
  2. \r\n
  3. \r\n

    Click on the Options... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection in the left part of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Expand the Cookies section

    \r\n
  8. \r\n
  9. \r\n

    Check the Enable cookies and Accept cookies normally checkboxes

    \r\n
  10. \r\n
  11. \r\n

    Save changes by clicking Ok.

    \r\n
  12. \r\n
\r\n

Back to Top

\r\n

Opera 7.x

\r\n
    \r\n
  1. \r\n

    Click on the Tools menu in Opera

    \r\n
  2. \r\n
  3. \r\n

    Click on the Preferences... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection near the bottom left of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    The Enable cookies checkbox must be checked, and Accept all cookies should be selected in the "Normal cookies" drop-down

    \r\n
  8. \r\n
  9. \r\n

    Save changes by clicking Ok

    \r\n
  10. \r\n
\r\n

Back to Top

\r\n", - 'is_active' => 1, - 'stores' => [0] - ], -]; - -/** - * Insert default and system pages - */ -foreach ($cmsPages as $data) { - $this->createPage()->setData($data)->save(); -} diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php b/app/code/Magento/Cms/data/cms_setup/data-install-2.0.0.php similarity index 51% rename from app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php rename to app/code/Magento/Cms/data/cms_setup/data-install-2.0.0.php index c35a8c83e7b53..f396184b43084 100644 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.0-1.6.0.1.php +++ b/app/code/Magento/Cms/data/cms_setup/data-install-2.0.0.php @@ -5,6 +5,47 @@ /** @var $this \Magento\Cms\Model\Resource\Setup */ +$cmsPages = [ + [ + 'title' => '404 Not Found', + 'page_layout' => '2columns-right', + 'meta_keywords' => 'Page keywords', + 'meta_description' => 'Page description', + 'identifier' => 'no-route', + 'content_heading' => 'Whoops, our bad...', + 'content' => "
\r\n
The page you requested was not found, and we have a fine guess why.
\r\n
\r\n
    \r\n
  • If you typed the URL directly, please make sure the spelling is correct.
  • \r\n
  • If you clicked on a link to get here, the link is outdated.
  • \r\n
\r\n
\r\n
\r\n
What can you do?
\r\n
Have no fear, help is near! There are many ways you can get back on track with Magento Store.
\r\n
\r\n
    \r\n
  • Go back to the previous page.
  • \r\n
  • Use the search bar at the top of the page to search for your products.
  • \r\n
  • Follow these links to get you back on track!
    Store Home | My Account
\r\n", + 'is_active' => 1, + 'stores' => [0], + 'sort_order' => 0 + ], + [ + 'title' => 'Home page', + 'page_layout' => '1column', + 'identifier' => 'home', + 'content_heading' => 'Home Page', + 'content' => "

CMS homepage content goes here.

\r\n", + 'is_active' => 1, + 'stores' => [0], + 'sort_order' => 0 + ], + [ + 'title' => 'Enable Cookies', + 'page_layout' => '1column', + 'identifier' => 'enable-cookies', + 'content_heading' => 'What are Cookies?', + 'content' => "
\r\n
Please enable cookies in your web browser to continue.
\r\n
\r\n

Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically whenever you visit our site so that we can personalize your experience and provide you with better service. We also use cookies (and similar browser data, such as Flash cookies) for fraud prevention and other purposes. If your web browser is set to refuse cookies from our website, you will not be able to complete a purchase or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.

\r\n

Enabling Cookies

\r\n \r\n

Internet Explorer 7.x

\r\n
    \r\n
  1. \r\n

    Start Internet Explorer

    \r\n
  2. \r\n
  3. \r\n

    Under the Tools menu, click Internet Options

    \r\n

    \"\"

    \r\n
  4. \r\n
  5. \r\n

    Click the Privacy tab

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Click the Advanced button

    \r\n

    \"\"

    \r\n
  8. \r\n
  9. \r\n

    Put a check mark in the box for Override Automatic Cookie Handling, put another check mark in the Always accept session cookies box

    \r\n

    \"\"

    \r\n
  10. \r\n
  11. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  12. \r\n
  13. \r\n

    Click OK

    \r\n

    \"\"

    \r\n
  14. \r\n
  15. \r\n

    Restart Internet Explore

    \r\n
  16. \r\n
\r\n

Back to Top

\r\n

Internet Explorer 6.x

\r\n
    \r\n
  1. \r\n

    Select Internet Options from the Tools menu

    \r\n

    \"\"

    \r\n
  2. \r\n
  3. \r\n

    Click on the Privacy tab

    \r\n
  4. \r\n
  5. \r\n

    Click the Default button (or manually slide the bar down to Medium) under Settings. Click OK

    \r\n

    \"\"

    \r\n
  6. \r\n
\r\n

Back to Top

\r\n

Mozilla/Firefox

\r\n
    \r\n
  1. \r\n

    Click on the Tools-menu in Mozilla

    \r\n
  2. \r\n
  3. \r\n

    Click on the Options... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection in the left part of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    Expand the Cookies section

    \r\n
  8. \r\n
  9. \r\n

    Check the Enable cookies and Accept cookies normally checkboxes

    \r\n
  10. \r\n
  11. \r\n

    Save changes by clicking Ok.

    \r\n
  12. \r\n
\r\n

Back to Top

\r\n

Opera 7.x

\r\n
    \r\n
  1. \r\n

    Click on the Tools menu in Opera

    \r\n
  2. \r\n
  3. \r\n

    Click on the Preferences... item in the menu - a new window open

    \r\n
  4. \r\n
  5. \r\n

    Click on the Privacy selection near the bottom left of the window. (See image below)

    \r\n

    \"\"

    \r\n
  6. \r\n
  7. \r\n

    The Enable cookies checkbox must be checked, and Accept all cookies should be selected in the "Normal cookies" drop-down

    \r\n
  8. \r\n
  9. \r\n

    Save changes by clicking Ok

    \r\n
  10. \r\n
\r\n

Back to Top

\r\n", + 'is_active' => 1, + 'stores' => [0] + ] +]; + +/** + * Insert default and system pages + */ +foreach ($cmsPages as $data) { + $this->createPage()->setData($data)->save(); +} + $pageContent = << @@ -240,3 +281,53 @@ $footerLinksBlock->setContent($content)->save(); } } + +$installer = $this->createMigrationSetup(); +$installer->startSetup(); + +$installer->appendClassAliasReplace( + 'cms_block', + 'content', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, + ['block_id'] +); +$installer->appendClassAliasReplace( + 'cms_page', + 'content', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, + ['page_id'] +); +$installer->appendClassAliasReplace( + 'cms_page', + 'layout_update_xml', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, + ['page_id'] +); +$installer->appendClassAliasReplace( + 'cms_page', + 'custom_layout_update_xml', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, + ['page_id'] +); + +$installer->doUpdateClassAliases(); + +$installer->endSetup(); + +$cookieRestriction = $this->createPage()->load('privacy-policy-cookie-restriction-mode', 'identifier'); + +if ($cookieRestriction->getId()) { + $content = $cookieRestriction->getContent(); + $replacment = '{{config path="general/store_information/street_line1"}} ' . + '{{config path="general/store_information/street_line2"}} ' . + '{{config path="general/store_information/city"}} ' . + '{{config path="general/store_information/postcode"}} ' . + '{{config path="general/store_information/region_id"}} ' . + '{{config path="general/store_information/country_id"}}'; + $content = preg_replace('/{{config path="general\\/store_information\\/address"}}/ims', $replacment, $content); + $cookieRestriction->setContent($content)->save(); +} diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php deleted file mode 100644 index 2dfbce80b9b40..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.2-1.6.0.3.php +++ /dev/null @@ -1,41 +0,0 @@ -createMigrationSetup(); -$installer->startSetup(); - -$installer->appendClassAliasReplace( - 'cms_block', - 'content', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, - ['block_id'] -); -$installer->appendClassAliasReplace( - 'cms_page', - 'content', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_WIKI, - ['page_id'] -); -$installer->appendClassAliasReplace( - 'cms_page', - 'layout_update_xml', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, - ['page_id'] -); -$installer->appendClassAliasReplace( - 'cms_page', - 'custom_layout_update_xml', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, - ['page_id'] -); - -$installer->doUpdateClassAliases(); - -$installer->endSetup(); diff --git a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php b/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php deleted file mode 100644 index f8803ac29a4a5..0000000000000 --- a/app/code/Magento/Cms/data/cms_setup/data-upgrade-1.6.0.3-2.0.0.0.php +++ /dev/null @@ -1,20 +0,0 @@ -createPage()->load('privacy-policy-cookie-restriction-mode', 'identifier'); - -if ($cookieRestriction->getId()) { - $content = $cookieRestriction->getContent(); - $replacment = '{{config path="general/store_information/street_line1"}} ' . - '{{config path="general/store_information/street_line2"}} ' . - '{{config path="general/store_information/city"}} ' . - '{{config path="general/store_information/postcode"}} ' . - '{{config path="general/store_information/region_id"}} ' . - '{{config path="general/store_information/country_id"}}'; - $content = preg_replace('/{{config path="general\\/store_information\\/address"}}/ims', $replacment, $content); - $cookieRestriction->setContent($content)->save(); -} diff --git a/app/code/Magento/Cms/view/frontend/layout/default.xml b/app/code/Magento/Cms/view/frontend/layout/default.xml index c2b57a22356e6..e892e36d0286a 100644 --- a/app/code/Magento/Cms/view/frontend/layout/default.xml +++ b/app/code/Magento/Cms/view/frontend/layout/default.xml @@ -7,13 +7,15 @@ - - - - footer_links - - - + + + + + Privacy and Cookie Policy + privacy-policy-cookie-restriction-mode + + + diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index cfc4ba403fcd3..00a381ba612d4 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-url-rewrite": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-url-rewrite": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 3c1ca48af6a3e..2ef9c71b0feb1 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-catalog-import-export": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-configurable-product": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-catalog-import-export": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-configurable-product": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 3f25041f36dcd..92b118ba8d616 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -3,23 +3,23 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-webapi": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-webapi": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php b/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php index a44e10d861184..1040905b5e286 100644 --- a/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php +++ b/app/code/Magento/ConfigurableProduct/data/configurableproduct_setup/data-install-2.0.0.php @@ -10,6 +10,8 @@ 'country_of_manufacture', 'group_price', 'minimal_price', + 'msrp', + 'msrp_display_actual_price_type', 'price', 'special_price', 'special_from_date', diff --git a/app/code/Magento/ConfigurableProduct/etc/module.xml b/app/code/Magento/ConfigurableProduct/etc/module.xml index e8990945171af..b76e11aec6480 100644 --- a/app/code/Magento/ConfigurableProduct/etc/module.xml +++ b/app/code/Magento/ConfigurableProduct/etc/module.xml @@ -8,6 +8,7 @@ + diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index 9fe62f80f6058..76cb3dba93312 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Core/App/Router/Base.php b/app/code/Magento/Core/App/Router/Base.php index 43da536a45959..bfb4a0d21550a 100644 --- a/app/code/Magento/Core/App/Router/Base.php +++ b/app/code/Magento/Core/App/Router/Base.php @@ -278,7 +278,6 @@ protected function matchAction(\Magento\Framework\App\RequestInterface $request, $action = null; $actionInstance = null; - $request->setRouteName($this->_routeConfig->getRouteByFrontName($moduleFrontName)); $actionPath = $this->matchActionPath($request, $params['actionPath']); $action = $request->getActionName() ?: ($params['actionName'] ?: $this->_defaultPath->getPart('action')); $this->_checkShouldBeSecure($request, '/' . $moduleFrontName . '/' . $actionPath . '/' . $action); @@ -308,6 +307,7 @@ protected function matchAction(\Magento\Framework\App\RequestInterface $request, $request->setControllerName($actionPath); $request->setActionName($action); $request->setControllerModule($currentModuleName); + $request->setRouteName($this->_routeConfig->getRouteByFrontName($moduleFrontName)); if (isset($params['variables'])) { $request->setParams($params['variables']); } diff --git a/app/code/Magento/Core/composer.json b/app/code/Magento/Core/composer.json index 7dc99c15655db..d08e7912339fb 100644 --- a/app/code/Magento/Core/composer.json +++ b/app/code/Magento/Core/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cron": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cron": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Core/data/core_setup/data-install-2.0.0.php b/app/code/Magento/Core/data/core_setup/data-install-2.0.0.php new file mode 100644 index 0000000000000..f0eeaebc507e2 --- /dev/null +++ b/app/code/Magento/Core/data/core_setup/data-install-2.0.0.php @@ -0,0 +1,84 @@ +createMigrationSetup(); +$installer->startSetup(); + +$installer->appendClassAliasReplace( + 'core_config_data', + 'value', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_PLAIN, + ['config_id'] +); +$installer->appendClassAliasReplace( + 'core_layout_update', + 'xml', + \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, + \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, + ['layout_update_id'] +); +$installer->doUpdateClassAliases(); + +/** + * Delete rows by condition from authorization_rule + */ +$tableName = $installer->getTable('authorization_rule'); +if ($tableName) { + $installer->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']); +} + +/** + * Delete rows by condition from core_resource + */ +$tableName = $installer->getTable('core_resource'); +if ($tableName) { + $installer->getConnection()->delete($tableName, ['code = ?' => 'admin_setup']); +} + +/** + * Update rows in core_theme + */ +$installer->getConnection()->update( + $installer->getTable('core_theme'), + ['area' => 'frontend'], + ['area = ?' => ''] +); +$installer->getEventManager()->dispatch('theme_registration_from_filesystem'); + +/** + * Update theme's data + */ +$fileCollection = $this->createThemeFactory(); +$fileCollection->addDefaultPattern('*'); +$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +$resourceCollection = $this->createThemeResourceFactory(); +$resourceCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ +foreach ($resourceCollection as $theme) { + $themeType = $fileCollection->hasTheme($theme) + ? \Magento\Framework\View\Design\ThemeInterface::TYPE_PHYSICAL + : \Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL; + $theme->setType($themeType)->save(); +} + +$fileCollection = $this->createThemeFactory(); +$fileCollection->addDefaultPattern('*'); +$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +$themeDbCollection = $this->createThemeResourceFactory(); +$themeDbCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); + +/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ +foreach ($fileCollection as $theme) { + $dbTheme = $themeDbCollection->getThemeByFullPath($theme->getFullPath()); + $dbTheme->setCode($theme->getCode()); + $dbTheme->save(); +} + +$installer->endSetup(); diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php deleted file mode 100644 index 946bfa2ce7225..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.10-1.6.0.11.php +++ /dev/null @@ -1,20 +0,0 @@ -createThemeFactory(); -$fileCollection->addDefaultPattern('*'); -$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); - -$resourceCollection = $this->createThemeResourceFactory(); -$resourceCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); -/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ -foreach ($resourceCollection as $theme) { - $themeType = $fileCollection->hasTheme($theme) - ? \Magento\Framework\View\Design\ThemeInterface::TYPE_PHYSICAL - : \Magento\Framework\View\Design\ThemeInterface::TYPE_VIRTUAL; - $theme->setType($themeType)->save(); -} diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.12-1.6.0.13.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.12-1.6.0.13.php deleted file mode 100644 index 20e1af3c2b748..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.12-1.6.0.13.php +++ /dev/null @@ -1,19 +0,0 @@ -createThemeFactory(); -$fileCollection->addDefaultPattern('*'); -$fileCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); - -$themeDbCollection = $this->createThemeResourceFactory(); -$themeDbCollection->setItemObjectClass('Magento\Core\Model\Theme\Data'); - -/** @var $theme \Magento\Framework\View\Design\ThemeInterface */ -foreach ($fileCollection as $theme) { - $dbTheme = $themeDbCollection->getThemeByFullPath($theme->getFullPath()); - $dbTheme->setCode($theme->getCode()); - $dbTheme->save(); -} diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php deleted file mode 100644 index 17dd7f76a85aa..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.3-1.6.0.4.php +++ /dev/null @@ -1,26 +0,0 @@ -createMigrationSetup(); -$installer->startSetup(); - -$installer->appendClassAliasReplace( - 'core_config_data', - 'value', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_MODEL, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_PLAIN, - ['config_id'] -); -$installer->appendClassAliasReplace( - 'core_layout_update', - 'xml', - \Magento\Framework\Module\Setup\Migration::ENTITY_TYPE_BLOCK, - \Magento\Framework\Module\Setup\Migration::FIELD_CONTENT_TYPE_XML, - ['layout_update_id'] -); -$installer->doUpdateClassAliases(); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.4-1.6.0.5.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.4-1.6.0.5.php deleted file mode 100644 index eff4cb82e8f51..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.4-1.6.0.5.php +++ /dev/null @@ -1,19 +0,0 @@ -startSetup(); - -$tableName = $installer->getTable('authorization_rule'); -if ($tableName) { - $installer->getConnection()->delete($tableName, ['resource_id = ?' => 'admin/system/tools/compiler']); -} -$tableName = $installer->getTable('core_resource'); -if ($tableName) { - $installer->getConnection()->delete($tableName, ['code = ?' => 'admin_setup']); -} - -$installer->endSetup(); diff --git a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.5-1.6.0.6.php b/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.5-1.6.0.6.php deleted file mode 100644 index 408470a81b155..0000000000000 --- a/app/code/Magento/Core/data/core_setup/data-upgrade-1.6.0.5-1.6.0.6.php +++ /dev/null @@ -1,14 +0,0 @@ -startSetup(); - -$connection = $installer->getConnection(); -$connection->update($installer->getTable('core_theme'), ['area' => 'frontend'], ['area = ?' => '']); - -$installer->endSetup(); -$installer->getEventManager()->dispatch('theme_registration_from_filesystem'); diff --git a/app/code/Magento/Core/etc/cache.xml b/app/code/Magento/Core/etc/cache.xml index 5df3a38df3b98..26130e283bcd2 100644 --- a/app/code/Magento/Core/etc/cache.xml +++ b/app/code/Magento/Core/etc/cache.xml @@ -29,4 +29,8 @@ Collection data files. + + + Results of DDL queries, such as describing tables or indexes. + diff --git a/app/code/Magento/Core/etc/module.xml b/app/code/Magento/Core/etc/module.xml index 430e8064b9e3b..bf0d78f9925a8 100644 --- a/app/code/Magento/Core/etc/module.xml +++ b/app/code/Magento/Core/etc/module.xml @@ -5,6 +5,6 @@ */ --> - + diff --git a/app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php b/app/code/Magento/Core/sql/core_setup/install-2.0.0.php similarity index 70% rename from app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php rename to app/code/Magento/Core/sql/core_setup/install-2.0.0.php index f448eedd6c0fe..ef6037e881bc2 100644 --- a/app/code/Magento/Core/sql/core_setup/install-1.6.0.0.php +++ b/app/code/Magento/Core/sql/core_setup/install-2.0.0.php @@ -6,12 +6,15 @@ /* @var $installer \Magento\Setup\Module\SetupModule */ $installer = $this; +/* @var $connection \Magento\Framework\DB\Adapter\AdapterInterface */ +$connection = $installer->getConnection(); + $installer->startSetup(); /** * Create table 'core_resource' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_resource') )->addColumn( 'code', @@ -34,12 +37,12 @@ )->setComment( 'Resources' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_config_data' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_config_data') )->addColumn( 'config_id', @@ -82,12 +85,12 @@ )->setComment( 'Config Data' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_layout_update' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_layout_update') )->addColumn( 'layout_update_id', @@ -113,18 +116,24 @@ null, ['nullable' => false, 'default' => '0'], 'Sort Order' +)->addColumn( + 'updated_at', + \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, + null, + ['nullable' => true], + 'Last Update Timestamp' )->addIndex( $installer->getIdxName('core_layout_update', ['handle']), ['handle'] )->setComment( 'Layout Updates' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_layout_link' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_layout_link') )->addColumn( 'layout_link_id', @@ -139,40 +148,40 @@ ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Store Id' )->addColumn( - 'area', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Area' -)->addColumn( - 'package', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Package' -)->addColumn( - 'theme', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 64, - [], - 'Theme' + 'theme_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false], + 'Theme id' )->addColumn( 'layout_update_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, null, ['unsigned' => true, 'nullable' => false, 'default' => '0'], 'Layout Update Id' +)->addColumn( + 'is_temporary', + \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, + null, + ['nullable' => false, 'default' => '0'], + 'Defines whether Layout Update is Temporary' +)->addIndex( + $installer->getIdxName('core_layout_link', ['layout_update_id']), + ['layout_update_id'] +)->addForeignKey( + $installer->getFkName('core_layout_link', 'layout_update_id', 'core_layout_update', 'layout_update_id'), + 'layout_update_id', + $installer->getTable('core_layout_update'), + 'layout_update_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->addIndex( $installer->getIdxName( 'core_layout_link', - ['store_id', 'package', 'theme', 'layout_update_id'], + ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'], \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), - ['store_id', 'package', 'theme', 'layout_update_id'], - ['type' => \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE] -)->addIndex( - $installer->getIdxName('core_layout_link', ['layout_update_id']), - ['layout_update_id'] + ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'] )->addForeignKey( $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id'), 'store_id', @@ -181,21 +190,21 @@ \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->addForeignKey( - $installer->getFkName('core_layout_link', 'layout_update_id', 'core_layout_update', 'layout_update_id'), - 'layout_update_id', - $installer->getTable('core_layout_update'), - 'layout_update_id', + $installer->getFkName('core_layout_link', 'theme_id', 'core_theme', 'theme_id'), + 'theme_id', + $installer->getTable('core_theme'), + 'theme_id', \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE )->setComment( 'Layout Link' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_session' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_session') )->addColumn( 'session_id', @@ -218,12 +227,12 @@ )->setComment( 'Database Sessions Storage' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'design_change' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('design_change') )->addColumn( 'design_change_id', @@ -268,12 +277,12 @@ )->setComment( 'Design Changes' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_variable' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_variable') )->addColumn( 'variable_id', @@ -304,12 +313,12 @@ )->setComment( 'Variables' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_variable_value' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_variable_value') )->addColumn( 'value_id', @@ -369,12 +378,12 @@ )->setComment( 'Variable Value' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_cache' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_cache') )->addColumn( 'id', @@ -412,12 +421,12 @@ )->setComment( 'Caches' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_cache_tag' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_cache_tag') )->addColumn( 'tag', @@ -437,34 +446,12 @@ )->setComment( 'Tag Caches' ); -$installer->getConnection()->createTable($table); - -/** - * Create table 'core_cache_option' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_cache_option') -)->addColumn( - 'code', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 32, - ['nullable' => false, 'primary' => true], - 'Code' -)->addColumn( - 'value', - \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - null, - [], - 'Value' -)->setComment( - 'Cache Options' -); -$installer->getConnection()->createTable($table); +$connection->createTable($table); /** * Create table 'core_flag' */ -$table = $installer->getConnection()->newTable( +$table = $connection->newTable( $installer->getTable('core_flag') )->addColumn( 'flag_id', @@ -502,6 +489,143 @@ )->setComment( 'Flag' ); -$installer->getConnection()->createTable($table); +$connection->createTable($table); + +/** + * Drop Foreign Key on core_cache_tag.cache_id + */ +$connection->dropForeignKey( + $installer->getTable('core_cache_tag'), + $installer->getFkName('core_cache_tag', 'cache_id', 'core_cache', 'id') +); + +/** + * Create table 'core_theme' + */ +$table = $connection->newTable( + $installer->getTable('core_theme') +)->addColumn( + 'theme_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Theme identifier' +)->addColumn( + 'parent_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => true], + 'Parent Id' +)->addColumn( + 'theme_path', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Theme Path' +)->addColumn( + 'theme_version', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Theme Version' +)->addColumn( + 'theme_title', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Theme Title' +)->addColumn( + 'preview_image', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Preview Image' +)->addColumn( + 'is_featured', + \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, + null, + ['nullable' => false, 'default' => 0], + 'Is Theme Featured' +)->addColumn( + 'area', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => false], + 'Theme Area' +)->addColumn( + 'type', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['nullable' => false], + 'Theme type: 0:physical, 1:virtual, 2:staging' +)->addColumn( + 'code', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + null, + [], + 'Full theme code, including package' +)->setComment( + 'Core theme' +); +$connection->createTable($table); + +/** + * Create table 'core_theme_file' + */ +$table = $connection->newTable( + $installer->getTable('core_theme_file') +)->addColumn( + 'theme_files_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], + 'Theme files identifier' +)->addColumn( + 'theme_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['nullable' => false, 'unsigned' => true], + 'Theme Id' +)->addColumn( + 'file_path', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 255, + ['nullable' => true], + 'Relative path to file' +)->addColumn( + 'file_type', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 32, + ['nullable' => false], + 'File Type' +)->addColumn( + 'content', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + \Magento\Framework\DB\Ddl\Table::MAX_TEXT_SIZE, + ['nullable' => false], + 'File Content' +)->addColumn( + 'sort_order', + \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, + null, + ['nullable' => false, 'default' => 0], + 'Sort Order' +)->addColumn( + 'is_temporary', + \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, + null, + ['nullable' => false, 'default' => 0], + 'Is Temporary File' +)->addForeignKey( + $installer->getFkName('core_theme_file', 'theme_id', 'core_theme', 'theme_id'), + 'theme_id', + $installer->getTable('core_theme'), + 'theme_id', + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, + \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE +)->setComment( + 'Core theme files' +); +$connection->createTable($table); $installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php deleted file mode 100644 index 527136e33cb5e..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.1-1.6.0.2.php +++ /dev/null @@ -1,16 +0,0 @@ -startSetup(); - -$installer->getConnection()->dropForeignKey( - $installer->getTable('core_cache_tag'), - $installer->getFkName('core_cache_tag', 'cache_id', 'core_cache', 'id') -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php deleted file mode 100644 index 8dc6ee5b68dc4..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.10-1.6.0.11.php +++ /dev/null @@ -1,34 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Add column 'type' to 'core_theme' - */ -$connection->addColumn( - $installer->getTable('core_theme'), - 'type', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT, - 'nullable' => false, - 'comment' => 'Theme type: 0:physical, 1:virtual, 2:staging' - ] -); - -/** - * Rename table - */ -$wrongName = 'core_theme_files'; -$rightName = 'core_theme_file'; -if ($installer->tableExists($wrongName)) { - $connection->renameTable($installer->getTable($wrongName), $installer->getTable($rightName)); -} - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.11-1.6.0.12.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.11-1.6.0.12.php deleted file mode 100644 index 5ec940a2fb855..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.11-1.6.0.12.php +++ /dev/null @@ -1,127 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -$oldName = 'core_theme_files_link'; -$newName = 'core_theme_file_update'; - -$oldTableName = $installer->getTable($oldName); - -/** - * Drop foreign key and index - */ -$connection->dropForeignKey($oldTableName, $installer->getFkName($oldName, 'theme_id', 'core_theme', 'theme_id')); -$connection->dropIndex($oldTableName, $installer->getFkName($oldName, 'theme_id', 'core_theme', 'theme_id')); - -/** - * Rename table - */ -if ($installer->tableExists($oldName)) { - $connection->renameTable($installer->getTable($oldName), $installer->getTable($newName)); -} - -$newTableName = $installer->getTable($newName); - -/** - * Rename column - */ -$oldColumn = 'files_link_id'; -$newColumn = 'file_update_id'; -$connection->changeColumn( - $newTableName, - $oldColumn, - $newColumn, - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - 'primary' => true, - 'nullable' => false, - 'unsigned' => true, - 'comment' => 'Customization file update id' - ] -); - -/** - * Rename column - */ -$oldColumn = 'layout_link_id'; -$newColumn = 'layout_update_id'; -$connection->changeColumn( - $newTableName, - $oldColumn, - $newColumn, - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - 'nullable' => false, - 'unsigned' => true, - 'comment' => 'Theme layout update id' - ] -); - -/** - * Add foreign keys and indexes - */ -$connection->addIndex( - $newTableName, - $installer->getIdxName( - $newTableName, - 'theme_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - 'theme_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE -); -$connection->addForeignKey( - $installer->getFkName($newTableName, 'theme_id', 'core_theme', 'theme_id'), - $newTableName, - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); -$connection->addIndex( - $newTableName, - $installer->getIdxName( - $newTableName, - 'layout_update_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX - ), - 'layout_update_id', - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_INDEX -); -$connection->addForeignKey( - $installer->getFkName($newTableName, 'layout_update_id', 'core_layout_update', 'layout_update_id'), - $newTableName, - 'layout_update_id', - $installer->getTable('core_layout_update'), - 'layout_update_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -/** - * Change data - */ -$select = $connection->select()->from( - $newTableName -)->join( - ['link' => $installer->getTable('core_layout_link')], - sprintf('link.layout_link_id = %s.layout_update_id', $newTableName) -); -$rows = $connection->fetchAll($select); -foreach ($rows as $row) { - $connection->update( - $newTableName, - ['layout_update_id' => $row['layout_update_id']], - 'file_update_id = ' . $row['file_update_id'] - ); -} - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.12-1.6.0.13.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.12-1.6.0.13.php deleted file mode 100644 index 49b3f27223bc6..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.12-1.6.0.13.php +++ /dev/null @@ -1,16 +0,0 @@ -startSetup(); - -$installer->getConnection()->addColumn( - $installer->getTable('core_theme'), - 'code', - ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 'comment' => 'Full theme code, including package'] -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.13-1.6.0.14.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.13-1.6.0.14.php deleted file mode 100644 index 00ab1ee3c3c2b..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.13-1.6.0.14.php +++ /dev/null @@ -1,8 +0,0 @@ -getConnection(); -$connection->dropTable('core_theme_file_update'); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.14-1.6.0.15.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.14-1.6.0.15.php deleted file mode 100644 index 4257a01edf4cf..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.14-1.6.0.15.php +++ /dev/null @@ -1,17 +0,0 @@ -startSetup(); - -$connection = $installer->getConnection(); -$table = $installer->getTable('core_theme'); - -$connection->dropColumn($table, 'magento_version_from'); -$connection->dropColumn($table, 'magento_version_to'); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php deleted file mode 100644 index 61eacd7b6cb3d..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php +++ /dev/null @@ -1,76 +0,0 @@ -startSetup(); - -/** - * Create table 'core_theme' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_theme') -)->addColumn( - 'theme_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Theme identifier' -)->addColumn( - 'parent_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => true], - 'Parent Id' -)->addColumn( - 'theme_path', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Theme Path' -)->addColumn( - 'theme_version', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Theme Version' -)->addColumn( - 'theme_title', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Theme Title' -)->addColumn( - 'preview_image', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => true], - 'Preview Image' -)->addColumn( - 'magento_version_from', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Magento Version From' -)->addColumn( - 'magento_version_to', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'Magento Version To' -)->addColumn( - 'is_featured', - \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, - null, - ['nullable' => false, 'default' => 0], - 'Is Theme Featured' -)->setComment( - 'Core theme' -); - -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php deleted file mode 100644 index 3602f4c453887..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.5-1.6.0.6.php +++ /dev/null @@ -1,92 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Modifying 'core_layout_link' table. Replace columns area, package, theme to theme_id - */ -$tableCoreLayoutLink = $installer->getTable('core_layout_link'); - -$connection->dropForeignKey( - $tableCoreLayoutLink, - $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id') -); - -$connection->dropIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - 'core_layout_link', - ['store_id', 'package', 'theme', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ) -); - -$connection->dropColumn($tableCoreLayoutLink, 'area'); - -$connection->dropColumn($tableCoreLayoutLink, 'package'); - -$connection->changeColumn( - $tableCoreLayoutLink, - 'theme', - 'theme_id', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - 'unsigned' => true, - 'nullable' => false, - 'comment' => 'Theme id' - ] -); - -$connection->addIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - 'core_layout_link', - ['store_id', 'theme_id', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['store_id', 'theme_id', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE -); - -$connection->addForeignKey( - $installer->getFkName('core_layout_link', 'store_id', 'store', 'store_id'), - $tableCoreLayoutLink, - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -$connection->addForeignKey( - $installer->getFkName('core_layout_link', 'theme_id', 'core_theme', 'theme_id'), - $tableCoreLayoutLink, - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -/** - * Add column 'area' to 'core_theme' - */ -$connection->addColumn( - $installer->getTable('core_theme'), - 'area', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 'length' => '255', - 'nullable' => false, - 'comment' => 'Theme Area' - ] -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php deleted file mode 100644 index cf57e72be8eec..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.6-1.6.0.7.php +++ /dev/null @@ -1,78 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Modifying 'core_layout_link' table. Adding 'is_temporary' column - */ -$tableCoreLayoutLink = $installer->getTable('core_layout_link'); - -$connection->addColumn( - $tableCoreLayoutLink, - 'is_temporary', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, - 'nullable' => false, - 'default' => '0', - 'comment' => 'Defines whether Layout Update is Temporary' - ] -); - -// we must drop next 2 foreign keys to have an ability to drop index -$connection->dropForeignKey( - $tableCoreLayoutLink, - $installer->getFkName($tableCoreLayoutLink, 'store_id', 'store', 'store_id') -); -$connection->dropForeignKey( - $tableCoreLayoutLink, - $installer->getFkName($tableCoreLayoutLink, 'theme_id', 'core_theme', 'theme_id') -); - -$connection->dropIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - $tableCoreLayoutLink, - ['store_id', 'theme_id', 'layout_update_id'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ) -); - -$connection->addIndex( - $tableCoreLayoutLink, - $installer->getIdxName( - $tableCoreLayoutLink, - ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE - ), - ['store_id', 'theme_id', 'layout_update_id', 'is_temporary'], - \Magento\Framework\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE -); - -// recreate 2 dropped foreign keys to have an ability to drop index -$connection->addForeignKey( - $installer->getFkName($tableCoreLayoutLink, 'store_id', 'store', 'store_id'), - $tableCoreLayoutLink, - 'store_id', - $installer->getTable('store'), - 'store_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); -$connection->addForeignKey( - $installer->getFkName($tableCoreLayoutLink, 'theme_id', 'core_theme', 'theme_id'), - $tableCoreLayoutLink, - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php deleted file mode 100644 index 7ec25a29dcd39..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.7-1.6.0.8.php +++ /dev/null @@ -1,21 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Add column 'updated_at' to 'core_layout_update' - */ -$connection->addColumn( - $installer->getTable('core_layout_update'), - 'updated_at', - ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP, 'nullable' => true, 'comment' => 'Last Update Timestamp'] -); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.8-1.6.0.9.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.8-1.6.0.9.php deleted file mode 100644 index 8e02ee9b2d13b..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.8-1.6.0.9.php +++ /dev/null @@ -1,66 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -/** - * Create table 'core_theme_files' - */ -$table = $installer->getConnection()->newTable( - $installer->getTable('core_theme_files') -)->addColumn( - 'theme_files_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true], - 'Theme files identifier' -)->addColumn( - 'theme_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'unsigned' => true], - 'Theme Id' -)->addColumn( - 'file_name', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 255, - ['nullable' => false], - 'File Name' -)->addColumn( - 'file_type', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 32, - ['nullable' => false], - 'File Type' -)->addColumn( - 'content', - \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - \Magento\Framework\DB\Ddl\Table::MAX_TEXT_SIZE, - ['nullable' => false], - 'File Content' -)->addColumn( - 'order', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'default' => 0], - 'Order' -)->addForeignKey( - $installer->getFkName('core_theme_files', 'theme_id', 'core_theme', 'theme_id'), - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Core theme files' -); - -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.9-1.6.0.10.php b/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.9-1.6.0.10.php deleted file mode 100644 index f0a8613d0f062..0000000000000 --- a/app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.9-1.6.0.10.php +++ /dev/null @@ -1,78 +0,0 @@ -startSetup(); -$connection = $installer->getConnection(); - -$connection->addColumn( - $installer->getTable('core_theme_files'), - 'is_temporary', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_BOOLEAN, - 'nullable' => false, - 'default' => 0, - 'comment' => 'Is Temporary File' - ] -); - -$connection->changeColumn( - $installer->getTable('core_theme_files'), - 'file_name', - 'file_path', - [ - 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, - 'length' => 255, - 'nullable' => true, - 'comment' => 'Relative path to file' - ] -); - -$connection->changeColumn( - $installer->getTable('core_theme_files'), - 'order', - 'sort_order', - ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_SMALLINT] -); - -/** - * Create table 'core_theme_files_link' - */ -$table = $connection->newTable( - $installer->getTable('core_theme_files_link') -)->addColumn( - 'files_link_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['identity' => true, 'nullable' => false, 'unsigned' => true, 'primary' => true], - 'Customization link id' -)->addColumn( - 'theme_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'unsigned' => true], - 'Theme Id' -)->addColumn( - 'layout_link_id', - \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, - null, - ['nullable' => false, 'unsigned' => true], - 'Theme layout link id' -)->addForeignKey( - $installer->getFkName('core_theme_files_link', 'theme_id', 'core_theme', 'theme_id'), - 'theme_id', - $installer->getTable('core_theme'), - 'theme_id', - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE, - \Magento\Framework\DB\Ddl\Table::ACTION_CASCADE -)->setComment( - 'Core theme link on layout update' -); - -$installer->getConnection()->createTable($table); - -$installer->endSetup(); diff --git a/app/code/Magento/Cron/Model/Schedule.php b/app/code/Magento/Cron/Model/Schedule.php index 1fc49939fccc5..8547b88d30004 100644 --- a/app/code/Magento/Cron/Model/Schedule.php +++ b/app/code/Magento/Cron/Model/Schedule.php @@ -44,14 +44,14 @@ class Schedule extends \Magento\Framework\Model\AbstractModel const STATUS_ERROR = 'error'; /** - * @var \Magento\Framework\Stdlib\DateTime\DateTime + * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface */ - protected $_date; + protected $timezone; /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry - * @param \Magento\Framework\Stdlib\DateTime\DateTime $date + * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data @@ -59,12 +59,12 @@ class Schedule extends \Magento\Framework\Model\AbstractModel public function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, - \Magento\Framework\Stdlib\DateTime\DateTime $date, + \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [] ) { - $this->_date = $date; + $this->timezone = $timezone; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -111,13 +111,13 @@ public function trySchedule() $time = strtotime($time); } - $d = getdate($this->_date->timestamp($time)); + $dateWithTimezone = $this->timezone->date($time); - $match = $this->matchCronExpression($e[0], $d['minutes']) - && $this->matchCronExpression($e[1], $d['hours']) - && $this->matchCronExpression($e[2], $d['mday']) - && $this->matchCronExpression($e[3], $d['mon']) - && $this->matchCronExpression($e[4], $d['wday']); + $match = $this->matchCronExpression($e[0], $dateWithTimezone->get(\Zend_Date::MINUTE)) + && $this->matchCronExpression($e[1], $dateWithTimezone->get(\Zend_Date::HOUR)) + && $this->matchCronExpression($e[2], $dateWithTimezone->get(\Zend_Date::DAY)) + && $this->matchCronExpression($e[3], $dateWithTimezone->get(\Zend_Date::MONTH)) + && $this->matchCronExpression($e[4], $dateWithTimezone->get(\Zend_Date::WEEKDAY)); return $match; } diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 0ba991eccbb44..ca61c8c84bac6 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index b0c71715f4c7c..86629bd73e60d 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomAttributeManagement/composer.json b/app/code/Magento/CustomAttributeManagement/composer.json index 305ae8ee98c9b..0a50bc0d9b640 100644 --- a/app/code/Magento/CustomAttributeManagement/composer.json +++ b/app/code/Magento/CustomAttributeManagement/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/Block/Newsletter.php b/app/code/Magento/Customer/Block/Newsletter.php index ba52fb19e574e..9f2c0b08cea43 100644 --- a/app/code/Magento/Customer/Block/Newsletter.php +++ b/app/code/Magento/Customer/Block/Newsletter.php @@ -62,6 +62,6 @@ public function getIsSubscribed() */ public function getAction() { - return $this->getUrl('*/*/save'); + return $this->getUrl('newsletter/manage/save'); } } diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php index 4087a265a8def..12ebc5b01068d 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Index/Viewfile.php @@ -5,11 +5,96 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Customer\Api\AccountManagementInterface; +use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\AddressDataBuilder; +use Magento\Customer\Api\Data\CustomerDataBuilder; +use Magento\Customer\Model\Address\Mapper; use Magento\Framework\App\Action\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\ObjectFactory; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class Viewfile extends \Magento\Customer\Controller\Adminhtml\Index { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Framework\Registry $coreRegistry + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Customer\Model\AddressFactory $addressFactory + * @param \Magento\Customer\Model\Metadata\FormFactory $formFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param \Magento\Customer\Helper\View $viewHelper + * @param \Magento\Framework\Math\Random $random + * @param CustomerRepositoryInterface $customerRepository + * @param \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter + * @param Mapper $addressMapper + * @param AccountManagementInterface $customerAccountManagement + * @param AddressRepositoryInterface $addressRepository + * @param CustomerDataBuilder $customerDataBuilder + * @param AddressDataBuilder $addressDataBuilder + * @param \Magento\Customer\Model\Customer\Mapper $customerMapper + * @param \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor + * @param ObjectFactory $objectFactory + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) + */ + public function __construct( + \Magento\Backend\App\Action\Context $context, + \Magento\Framework\Registry $coreRegistry, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Customer\Model\AddressFactory $addressFactory, + \Magento\Customer\Model\Metadata\FormFactory $formFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + \Magento\Customer\Helper\View $viewHelper, + \Magento\Framework\Math\Random $random, + CustomerRepositoryInterface $customerRepository, + \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter, + Mapper $addressMapper, + AccountManagementInterface $customerAccountManagement, + AddressRepositoryInterface $addressRepository, + CustomerDataBuilder $customerDataBuilder, + AddressDataBuilder $addressDataBuilder, + \Magento\Customer\Model\Customer\Mapper $customerMapper, + \Magento\Framework\Reflection\DataObjectProcessor $dataObjectProcessor, + ObjectFactory $objectFactory, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct( + $context, + $coreRegistry, + $fileFactory, + $customerFactory, + $addressFactory, + $formFactory, + $subscriberFactory, + $viewHelper, + $random, + $customerRepository, + $extensibleDataObjectConverter, + $addressMapper, + $customerAccountManagement, + $addressRepository, + $customerDataBuilder, + $addressDataBuilder, + $customerMapper, + $dataObjectProcessor, + $objectFactory + ); + $this->urlDecoder = $urlDecoder; + } + /** * Customer view file action * @@ -24,14 +109,12 @@ public function execute() $plain = false; if ($this->getRequest()->getParam('file')) { // download file - $file = $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $file = $this->urlDecoder->decode( $this->getRequest()->getParam('file') ); } elseif ($this->getRequest()->getParam('image')) { // show plain image - $file = $this->_objectManager->get('Magento\Core\Helper\Data')->urlDecode( + $file = $this->urlDecoder->decode( $this->getRequest()->getParam('image') ); $plain = true; diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php index b9680b1d53405..5d4dec963603d 100644 --- a/app/code/Magento/Customer/Model/AccountManagement.php +++ b/app/code/Magento/Customer/Model/AccountManagement.php @@ -33,7 +33,6 @@ use Magento\Framework\Stdlib\DateTime; use Magento\Framework\Stdlib\String as StringHelper; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\UrlInterface; /** * Handle various customer account actions @@ -133,7 +132,7 @@ class AccountManagement implements AccountManagementInterface private $customerMetadataService; /** - * @var UrlInterface + * @var \Magento\Framework\Url */ private $url; @@ -220,7 +219,7 @@ class AccountManagement implements AccountManagementInterface * @param AddressRepositoryInterface $addressRepository * @param CustomerMetadataInterface $customerMetadataService * @param CustomerRegistry $customerRegistry - * @param UrlInterface $url + * @param \Magento\Framework\Url $url * @param Logger $logger * @param Encryptor $encryptor * @param ConfigShare $configShare @@ -249,7 +248,7 @@ public function __construct( AddressRepositoryInterface $addressRepository, CustomerMetadataInterface $customerMetadataService, CustomerRegistry $customerRegistry, - UrlInterface $url, + \Magento\Framework\Url $url, Logger $logger, Encryptor $encryptor, ConfigShare $configShare, @@ -1057,7 +1056,8 @@ public function sendPasswordReminderEmail($customer, $newPasswordToken) 'customer/account/createPassword', [ '_query' => ['id' => $customer->getId(), 'token' => $newPasswordToken], - '_store' => $customer->getStoreId() + '_store' => $customer->getStoreId(), + '_nosid' => true, ] ); diff --git a/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php b/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php index 7f290f5ca9f20..26f3aedba5784 100644 --- a/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php +++ b/app/code/Magento/Customer/Model/Attribute/Backend/Data/Boolean.php @@ -21,6 +21,7 @@ public function beforeSave($customer) { $attributeName = $this->getAttribute()->getName(); $inputValue = $customer->getData($attributeName); + $inputValue = is_null($inputValue) ? $this->getAttribute()->getDefaultValue() : $inputValue; $sanitizedValue = !empty($inputValue) ? '1' : '0'; $customer->setData($attributeName, $sanitizedValue); return $this; diff --git a/app/code/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefault.php b/app/code/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefault.php new file mode 100644 index 0000000000000..16b492c800a94 --- /dev/null +++ b/app/code/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefault.php @@ -0,0 +1,51 @@ +eavConfig = $eavConfig; + parent::__construct($context, $registry, $config, $resource, $resourceCollection, $data); + } + + /** + * Save EAV default value after save + * + * @return $this + */ + public function afterSave() + { + $result = parent::afterSave(); + + $attributeObject = $this->eavConfig->getAttribute('customer', 'disable_auto_group_change'); + $attributeObject->setData('default_value', $this->getValue()); + $attributeObject->save(); + + return $result; + } +} diff --git a/app/code/Magento/Customer/Model/Resource/Address.php b/app/code/Magento/Customer/Model/Resource/Address.php index dddf1e3d0d3c5..4cda0ee8fb84d 100644 --- a/app/code/Magento/Customer/Model/Resource/Address.php +++ b/app/code/Magento/Customer/Model/Resource/Address.php @@ -149,4 +149,22 @@ public function delete($object) $object->setData([]); return $result; } + + /** + * {@inheritdoc} + */ + protected function _afterDelete(\Magento\Framework\Object $address) + { + if ($address->getId()) { + $customer = $this->_createCustomer()->load($address->getCustomerId()); + if ($customer->getDefaultBilling() == $address->getId()) { + $customer->setDefaultBilling(null); + } + if ($customer->getDefaultShipping() == $address->getId()) { + $customer->setDefaultShipping(null); + } + $customer->save(); + } + return parent::_afterDelete($address); + } } diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index 46fabaea615f5..6f1e96c3b1ba0 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-newsletter": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-review": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-integration": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-newsletter": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-review": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-integration": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Customer/etc/adminhtml/system.xml b/app/code/Magento/Customer/etc/adminhtml/system.xml index 503a28dc7678d..728f0dd05b623 100644 --- a/app/code/Magento/Customer/etc/adminhtml/system.xml +++ b/app/code/Magento/Customer/etc/adminhtml/system.xml @@ -79,6 +79,7 @@ Magento\Backend\Model\Config\Source\Yesno + Magento\Customer\Model\Config\Backend\CreateAccount\DisableAutoGroupAssignDefault diff --git a/app/code/Magento/Customer/etc/webapi.xml b/app/code/Magento/Customer/etc/webapi.xml index 78a2fa940e54a..df2d11cb16d9f 100644 --- a/app/code/Magento/Customer/etc/webapi.xml +++ b/app/code/Magento/Customer/etc/webapi.xml @@ -178,12 +178,6 @@ - - - - - - @@ -196,13 +190,13 @@ - + - + @@ -244,7 +238,7 @@ - + diff --git a/app/code/Magento/CustomerBalance/Model/Adminhtml/Balance/History.php b/app/code/Magento/CustomerBalance/Model/Adminhtml/Balance/History.php index 1a8b1b9866f4a..677aea6a985a1 100644 --- a/app/code/Magento/CustomerBalance/Model/Adminhtml/Balance/History.php +++ b/app/code/Magento/CustomerBalance/Model/Adminhtml/Balance/History.php @@ -23,6 +23,7 @@ class History extends \Magento\CustomerBalance\Model\Balance\History * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\View\DesignInterface $design * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Customer\Model\CustomerRegistry $customerRegistry * @param \Magento\Backend\Model\Auth\Session $authSession * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection @@ -35,6 +36,7 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\DesignInterface $design, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Customer\Model\CustomerRegistry $customerRegistry, \Magento\Backend\Model\Auth\Session $authSession, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, @@ -48,6 +50,7 @@ public function __construct( $storeManager, $design, $scopeConfig, + $customerRegistry, $resource, $resourceCollection, $data diff --git a/app/code/Magento/CustomerBalance/Model/Balance/History.php b/app/code/Magento/CustomerBalance/Model/Balance/History.php index 42f02756a2314..6126de6900d85 100644 --- a/app/code/Magento/CustomerBalance/Model/Balance/History.php +++ b/app/code/Magento/CustomerBalance/Model/Balance/History.php @@ -64,6 +64,11 @@ class History extends \Magento\Framework\Model\AbstractModel */ protected $_transportBuilder; + /** + * @var \Magento\Customer\Model\CustomerRegistry + */ + protected $customerRegistry; + /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -71,6 +76,7 @@ class History extends \Magento\Framework\Model\AbstractModel * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Framework\View\DesignInterface $design * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Customer\Model\CustomerRegistry $customerRegistry * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data @@ -82,6 +88,7 @@ public function __construct( \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\View\DesignInterface $design, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, + \Magento\Customer\Model\CustomerRegistry $customerRegistry, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [] @@ -90,6 +97,7 @@ public function __construct( $this->_design = $design; $this->_scopeConfig = $scopeConfig; $this->_storeManager = $storeManager; + $this->customerRegistry = $customerRegistry; parent::__construct($context, $registry, $resource, $resourceCollection, $data); } @@ -192,7 +200,8 @@ public function afterSave() $this->setIsCustomerNotified(false); if ($this->getBalanceModel()->getNotifyByEmail()) { $storeId = $this->getBalanceModel()->getStoreId(); - $customer = $this->getBalanceModel()->getCustomer(); + $customerId = $this->getBalanceModel()->getCustomer()->getId(); + $customer = $this->customerRegistry->retrieve($customerId); $transport = $this->_transportBuilder->setTemplateIdentifier( $this->_scopeConfig->getValue( diff --git a/app/code/Magento/CustomerBalance/composer.json b/app/code/Magento/CustomerBalance/composer.json index 98386160bdcce..42d5b244dce8a 100644 --- a/app/code/Magento/CustomerBalance/composer.json +++ b/app/code/Magento/CustomerBalance/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerCustomAttributes/composer.json b/app/code/Magento/CustomerCustomAttributes/composer.json index 464c07102653b..90cdb23dbad0e 100644 --- a/app/code/Magento/CustomerCustomAttributes/composer.json +++ b/app/code/Magento/CustomerCustomAttributes/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-custom-attribute-management": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-custom-attribute-management": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/billing.phtml b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/billing.phtml index b5d8c016bde3e..331a7f28128a9 100644 --- a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/billing.phtml +++ b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/billing.phtml @@ -85,7 +85,7 @@
- +
diff --git a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/shipping.phtml b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/shipping.phtml index c4c88ab43ee92..52bf6d3055c10 100644 --- a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/shipping.phtml +++ b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/checkout/onepage/shipping.phtml @@ -67,7 +67,7 @@
- +
diff --git a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/address/edit.phtml b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/address/edit.phtml index 5a18abb763728..a64a47f3fa4d9 100644 --- a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/address/edit.phtml +++ b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/address/edit.phtml @@ -85,7 +85,7 @@
- +
diff --git a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/form/register.phtml b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/form/register.phtml index ceea8fa68fccf..d2275ff1b0c91 100644 --- a/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/form/register.phtml +++ b/app/code/Magento/CustomerCustomAttributes/view/frontend/templates/customer/form/register.phtml @@ -117,7 +117,7 @@
- +
diff --git a/app/code/Magento/CustomerFinance/composer.json b/app/code/Magento/CustomerFinance/composer.json index 47ba9aae5ff13..677860140f316 100644 --- a/app/code/Magento/CustomerFinance/composer.json +++ b/app/code/Magento/CustomerFinance/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-customer-balance": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-customer-import-export": "0.1.0-alpha107", - "magento/module-reward": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-customer-balance": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-customer-import-export": "0.1.0-alpha108", + "magento/module-reward": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerFinance/etc/export.xml b/app/code/Magento/CustomerFinance/etc/export.xml index 1f6087d46c311..01d42502267e9 100644 --- a/app/code/Magento/CustomerFinance/etc/export.xml +++ b/app/code/Magento/CustomerFinance/etc/export.xml @@ -6,4 +6,5 @@ --> + diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index f14244f18d454..28941cb7ca47e 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/CustomerImportExport/etc/export.xml b/app/code/Magento/CustomerImportExport/etc/export.xml index fcba24cfe012c..633d3693c07ba 100644 --- a/app/code/Magento/CustomerImportExport/etc/export.xml +++ b/app/code/Magento/CustomerImportExport/etc/export.xml @@ -7,4 +7,5 @@ + diff --git a/app/code/Magento/CustomerSegment/composer.json b/app/code/Magento/CustomerSegment/composer.json index f4eef4075324e..dbc1e76039c36 100644 --- a/app/code/Magento/CustomerSegment/composer.json +++ b/app/code/Magento/CustomerSegment/composer.json @@ -3,23 +3,23 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-rule": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-newsletter": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-rule": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-newsletter": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/DesignEditor/composer.json b/app/code/Magento/DesignEditor/composer.json index 7c5edfb4e974b..e03b624c0beb7 100644 --- a/app/code/Magento/DesignEditor/composer.json +++ b/app/code/Magento/DesignEditor/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/DesignEditor/etc/adminhtml/menu.xml b/app/code/Magento/DesignEditor/etc/adminhtml/menu.xml deleted file mode 100644 index 450ccb62e23d6..0000000000000 --- a/app/code/Magento/DesignEditor/etc/adminhtml/menu.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index 98b9b76a7a2aa..0e24645dd3a1c 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Directory/Helper/Data.php b/app/code/Magento/Directory/Helper/Data.php index c584342db5c8d..17d96968a6e92 100644 --- a/app/code/Magento/Directory/Helper/Data.php +++ b/app/code/Magento/Directory/Helper/Data.php @@ -182,7 +182,9 @@ public function getRegionJson() ]; } $json = $this->_coreHelper->jsonEncode($regions); - + if ($json === false) { + $json = 'false'; + } $this->_configCacheType->save($json, $cacheKey); } $this->_regionJson = $json; diff --git a/app/code/Magento/Directory/Model/Country.php b/app/code/Magento/Directory/Model/Country.php index 160c355838f45..6088a6c6cc209 100644 --- a/app/code/Magento/Directory/Model/Country.php +++ b/app/code/Magento/Directory/Model/Country.php @@ -10,10 +10,6 @@ * @method \Magento\Directory\Model\Resource\Country getResource() * @method string getCountryId() * @method \Magento\Directory\Model\Country setCountryId(string $value) - * @method string getIso2Code() - * @method \Magento\Directory\Model\Country setIso2Code(string $value) - * @method string getIso3Code() - * @method \Magento\Directory\Model\Country setIso3Code(string $value) */ namespace Magento\Directory\Model; diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index 03e273e3145b1..85f885a5e41b3 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Doc/composer.json b/app/code/Magento/Doc/composer.json index bdee96e97343f..c49b7be16c472 100644 --- a/app/code/Magento/Doc/composer.json +++ b/app/code/Magento/Doc/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-theme": "0.1.0-alpha107" + "magento/module-theme": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php index d427f36c14e15..eabb0c4225444 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php @@ -5,41 +5,40 @@ namespace Magento\Downloadable\Block\Catalog\Product; use Magento\Catalog\Pricing\Price\FinalPrice; -use Magento\Catalog\Pricing\Price\RegularPrice; use Magento\Downloadable\Model\Link; use Magento\Downloadable\Pricing\Price\LinkPrice; +use Magento\Framework\Json\EncoderInterface; /** * Downloadable Product Links part block - * */ class Links extends \Magento\Catalog\Block\Product\AbstractProduct { /** - * @var \Magento\Framework\Json\EncoderInterface + * @var \Magento\Core\Helper\Data */ - protected $jsonEncoder; + protected $coreData; /** - * @var \Magento\Core\Helper\Data + * @var EncoderInterface */ - protected $coreData; + protected $encoder; /** * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param EncoderInterface $encoder * @param array $data */ public function __construct( \Magento\Catalog\Block\Product\Context $context, \Magento\Core\Helper\Data $coreData, + EncoderInterface $encoder, array $data = [] ) { $this->coreData = $coreData; - parent::__construct( - $context, - $data - ); + $this->encoder = $encoder; + parent::__construct($context, $data); } /** @@ -93,38 +92,18 @@ public function getCurrencyPrice($price) */ public function getJsonConfig() { - $priceInfo = $this->getProduct()->getPriceInfo(); - $finalPrice = $priceInfo->getPrice(FinalPrice::PRICE_CODE); - $regularPrice = $priceInfo->getPrice(RegularPrice::PRICE_CODE); - $config = [ - 'price' => $finalPrice->getAmount()->getValue(), - 'oldPrice' => $regularPrice->getValue(), - ]; - $config['links'] = $this->getLinksConfig(); - - return json_encode($config); - } + $finalPrice = $this->getProduct()->getPriceInfo() + ->getPrice(FinalPrice::PRICE_CODE); - /** - * Get links price config - * - * @return array - */ - protected function getLinksConfig() - { - $finalPrice = $this->getProduct()->getPriceInfo()->getPrice(FinalPrice::PRICE_CODE); $linksConfig = []; foreach ($this->getLinks() as $link) { $amount = $finalPrice->getCustomAmount($link->getPrice()); - $price = $this->coreData->currency($link->getPrice(), false, false); $linksConfig[$link->getId()] = [ - 'price' => $price, - 'oldPrice' => $price, - 'inclTaxPrice' => $amount->getValue(), - 'exclTaxPrice' => $amount->getBaseAmount(), + 'finalPrice' => $amount->getValue(), ]; } - return $linksConfig; + + return $this->encoder->encode(['links' => $linksConfig]); } /** diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 8426f674a2565..afe28e1458e22 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-gift-message": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-msrp": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-gift-message": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-msrp": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Downloadable/view/frontend/web/downloadable.js b/app/code/Magento/Downloadable/view/frontend/web/downloadable.js index 2432f42a65c76..510d38e287992 100644 --- a/app/code/Magento/Downloadable/view/frontend/web/downloadable.js +++ b/app/code/Magento/Downloadable/view/frontend/web/downloadable.js @@ -4,11 +4,16 @@ /*jshint browser:true jquery:true expr:true*/ define([ "jquery", - "jquery/ui" + "jquery/ui", + "Magento_Catalog/js/price-box" ], function($){ "use strict"; $.widget('mage.downloadable', { + options: { + priceHolderSelector: '.price-box' + }, + _create: function() { var self = this; @@ -36,26 +41,14 @@ define([ * @private */ _reloadPrice: function() { - var price = 0, - oldPrice = 0, - inclTaxPrice = 0, - exclTaxPrice = 0; + var finalPrice = 0; this.element.find(this.options.linkElement + ':checked').each($.proxy(function(index, element) { - price += this.options.config.links[$(element).val()].price; - oldPrice += this.options.config.links[$(element).val()].oldPrice; - inclTaxPrice += this.options.config.links[$(element).val()].inclTaxPrice; - exclTaxPrice += this.options.config.links[$(element).val()].exclTaxPrice; + finalPrice += this.options.config.links[$(element).val()].finalPrice; }, this)); - this.element.trigger('changePrice', { - 'config': 'config', - 'price': { - 'price': price, - 'oldPrice': oldPrice, - 'inclTaxPrice': inclTaxPrice, - 'exclTaxPrice': exclTaxPrice - } - }).trigger('reloadPrice'); + $(this.options.priceHolderSelector).trigger('updatePrice', { + 'prices': { 'finalPrice': { 'amount': finalPrice }} + }); } }); diff --git a/app/code/Magento/Eav/Model/AttributeManagement.php b/app/code/Magento/Eav/Model/AttributeManagement.php index cfbe58eee74ef..357e1acb9367e 100644 --- a/app/code/Magento/Eav/Model/AttributeManagement.php +++ b/app/code/Magento/Eav/Model/AttributeManagement.php @@ -88,8 +88,13 @@ public function assign($entityTypeCode, $attributeSetId, $attributeGroupId, $att if ($setEntityType->getEntityTypeCode() != $entityTypeCode) { throw new InputException('Wrong attribute set id provided'); } + //Check if group exists. If not - expected exception - $this->groupRepository->get($attributeGroupId); + $attributeGroup = $this->groupRepository->get($attributeGroupId); + + if ($attributeGroup->getAttributeSetId() != $attributeSetId) { + throw new InputException('Attribute group does not belong to attribute set'); + } /** @var \Magento\Eav\Api\Data\AttributeInterface $attribute */ $attribute = $this->attributeRepository->get($entityTypeCode, $attributeCode); diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 6e28f9c3702be..2b6531a557402 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index 19465fa02032a..f649537c160ec 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Enterprise/composer.json b/app/code/Magento/Enterprise/composer.json index 4ff58e776148e..936527a2634bc 100644 --- a/app/code/Magento/Enterprise/composer.json +++ b/app/code/Magento/Enterprise/composer.json @@ -3,36 +3,36 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog-event": "0.1.0-alpha107", - "magento/module-catalog-permissions": "0.1.0-alpha107", - "magento/module-customer-segment": "0.1.0-alpha107", - "magento/module-gift-card": "0.1.0-alpha107", - "magento/module-gift-card-account": "0.1.0-alpha107", - "magento/module-gift-registry": "0.1.0-alpha107", - "magento/module-gift-wrapping": "0.1.0-alpha107", - "magento/module-scheduled-import-export": "0.1.0-alpha107", - "magento/module-price-permissions": "0.1.0-alpha107", - "magento/module-promotion-permissions": "0.1.0-alpha107", - "magento/module-sales-archive": "0.1.0-alpha107", - "magento/module-target-rule": "0.1.0-alpha107", - "magento/module-rma": "0.1.0-alpha107", - "magento/module-banner": "0.1.0-alpha107", - "magento/module-advanced-checkout": "0.1.0-alpha107", - "magento/module-versions-cms": "0.1.0-alpha107", - "magento/module-customer-custom-attributes": "0.1.0-alpha107", - "magento/module-invitation": "0.1.0-alpha107", - "magento/module-logging": "0.1.0-alpha107", - "magento/module-pci": "0.1.0-alpha107", - "magento/module-reminder": "0.1.0-alpha107", - "magento/module-reward": "0.1.0-alpha107", - "magento/module-multiple-wishlist": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog-event": "0.1.0-alpha108", + "magento/module-catalog-permissions": "0.1.0-alpha108", + "magento/module-customer-segment": "0.1.0-alpha108", + "magento/module-gift-card": "0.1.0-alpha108", + "magento/module-gift-card-account": "0.1.0-alpha108", + "magento/module-gift-registry": "0.1.0-alpha108", + "magento/module-gift-wrapping": "0.1.0-alpha108", + "magento/module-scheduled-import-export": "0.1.0-alpha108", + "magento/module-price-permissions": "0.1.0-alpha108", + "magento/module-promotion-permissions": "0.1.0-alpha108", + "magento/module-sales-archive": "0.1.0-alpha108", + "magento/module-target-rule": "0.1.0-alpha108", + "magento/module-rma": "0.1.0-alpha108", + "magento/module-banner": "0.1.0-alpha108", + "magento/module-advanced-checkout": "0.1.0-alpha108", + "magento/module-versions-cms": "0.1.0-alpha108", + "magento/module-customer-custom-attributes": "0.1.0-alpha108", + "magento/module-invitation": "0.1.0-alpha108", + "magento/module-logging": "0.1.0-alpha108", + "magento/module-pci": "0.1.0-alpha108", + "magento/module-reminder": "0.1.0-alpha108", + "magento/module-reward": "0.1.0-alpha108", + "magento/module-multiple-wishlist": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Fedex/Model/Carrier.php b/app/code/Magento/Fedex/Model/Carrier.php index 7da84404894b7..c614c29600937 100644 --- a/app/code/Magento/Fedex/Model/Carrier.php +++ b/app/code/Magento/Fedex/Model/Carrier.php @@ -301,7 +301,7 @@ public function setRequest(RateRequest $request) $request->getStoreId() ); } - $r->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getIso2Code()); + $r->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getData('iso2_code')); if ($request->getOrigPostcode()) { $r->setOrigPostal($request->getOrigPostcode()); @@ -320,7 +320,7 @@ public function setRequest(RateRequest $request) } else { $destCountry = self::USA_COUNTRY_ID; } - $r->setDestCountry($this->_countryFactory->create()->load($destCountry)->getIso2Code()); + $r->setDestCountry($this->_countryFactory->create()->load($destCountry)->getData('iso2_code')); if ($request->getDestPostcode()) { $r->setDestPostal($request->getDestPostcode()); diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index f4e50fce741cb..cd722684b5915 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftCard/composer.json b/app/code/Magento/GiftCard/composer.json index 4333a12157fcc..559c68da39ed9 100644 --- a/app/code/Magento/GiftCard/composer.json +++ b/app/code/Magento/GiftCard/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftCardAccount/composer.json b/app/code/Magento/GiftCardAccount/composer.json index 3deff49354252..643d1ee21de99 100644 --- a/app/code/Magento/GiftCardAccount/composer.json +++ b/app/code/Magento/GiftCardAccount/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-customer-balance": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-customer-balance": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 999f262665e51..311cca96c393e 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-multishipping": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-multishipping": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftRegistry/composer.json b/app/code/Magento/GiftRegistry/composer.json index d29877bc38973..4ed7ddbb3caac 100644 --- a/app/code/Magento/GiftRegistry/composer.json +++ b/app/code/Magento/GiftRegistry/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-gift-card": "0.1.0-alpha107", - "magento/module-newsletter": "0.1.0-alpha107", - "magento/module-multishipping": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-gift-card": "0.1.0-alpha108", + "magento/module-newsletter": "0.1.0-alpha108", + "magento/module-multishipping": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GiftRegistry/view/frontend/templates/address/edit.phtml b/app/code/Magento/GiftRegistry/view/frontend/templates/address/edit.phtml index a287de5048c8a..564f7db05e180 100644 --- a/app/code/Magento/GiftRegistry/view/frontend/templates/address/edit.phtml +++ b/app/code/Magento/GiftRegistry/view/frontend/templates/address/edit.phtml @@ -73,7 +73,7 @@
- +
diff --git a/app/code/Magento/GiftWrapping/composer.json b/app/code/Magento/GiftWrapping/composer.json index 25b1dab7fad42..8ee227a588b70 100644 --- a/app/code/Magento/GiftWrapping/composer.json +++ b/app/code/Magento/GiftWrapping/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-gift-message": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-gift-message": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index 4c61a94548962..bee35a673bf7a 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index c1e98ce96cbdf..ce8f12d6e4d82 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index 89467f6ec0c43..bfe88e67fba72 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-google-analytics": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-google-analytics": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php index fdb673823d877..32cd0e31bbadb 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items.php @@ -21,12 +21,22 @@ class Items extends \Magento\Backend\App\Action protected $notifier; /** - * @param \Magento\Backend\App\Action\Context $context + * @var \Magento\Framework\Url\EncoderInterface + */ + protected $urlEncoder; + + /** + * @param Action\Context $context * @param NotifierInterface $notifier + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder */ - public function __construct(Action\Context $context, NotifierInterface $notifier) - { + public function __construct( + Action\Context $context, + NotifierInterface $notifier, + \Magento\Framework\Url\EncoderInterface $urlEncoder + ) { parent::__construct($context); + $this->urlEncoder = $urlEncoder; $this->notifier = $notifier; } @@ -52,12 +62,8 @@ protected function _redirectToCaptcha($e) '*/*/index', [ 'store' => $this->_getStore()->getId(), - 'captcha_token' => $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlEncode( - $e->getCaptchaToken() - ), - 'captcha_url' => $this->_objectManager->get('Magento\Core\Helper\Data')->urlEncode($e->getCaptchaUrl()) + 'captcha_token' => $this->urlEncoder->encode($e->getCaptchaToken()), + 'captcha_url' => $this->urlEncoder->encode($e->getCaptchaUrl()) ] ); if ($this->getRequest()->isAjax()) { diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php index f1a1bece50558..ed8d3b3a98a69 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/ConfirmCaptcha.php @@ -5,8 +5,32 @@ */ namespace Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items; +use Magento\Backend\App\Action; +use Magento\Framework\Notification\NotifierInterface; + class ConfirmCaptcha extends \Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param NotifierInterface $notifier + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + NotifierInterface $notifier, + \Magento\Framework\Url\EncoderInterface $urlEncoder, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context, $notifier, $urlEncoder); + $this->urlDecoder = $urlDecoder; + } + /** * Confirm CAPTCHA * @@ -20,9 +44,7 @@ public function execute() 'Magento\GoogleShopping\Model\Service' )->getClient( $storeId, - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $this->urlDecoder->decode( $this->getRequest()->getParam('captcha_token') ), $this->getRequest()->getParam('user_confirm') diff --git a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php index 7811da5e546a0..a4d0d85baec6e 100644 --- a/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php +++ b/app/code/Magento/GoogleShopping/Controller/Adminhtml/Googleshopping/Items/Index.php @@ -5,8 +5,32 @@ */ namespace Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items; +use Magento\Backend\App\Action; +use Magento\Framework\Notification\NotifierInterface; + class Index extends \Magento\GoogleShopping\Controller\Adminhtml\Googleshopping\Items { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param NotifierInterface $notifier + * @param \Magento\Framework\Url\EncoderInterface $urlEncoder + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + NotifierInterface $notifier, + \Magento\Framework\Url\EncoderInterface $urlEncoder, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct($context, $notifier, $urlEncoder); + $this->urlDecoder = $urlDecoder; + } + /** * Initialize general settings for action * @@ -58,16 +82,12 @@ public function execute() if ($this->getRequest()->getParam('captcha_token') && $this->getRequest()->getParam('captcha_url')) { $contentBlock->setGcontentCaptchaToken( - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $this->urlDecoder->decode( $this->getRequest()->getParam('captcha_token') ) ); $contentBlock->setGcontentCaptchaUrl( - $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $this->urlDecoder->decode( $this->getRequest()->getParam('captcha_url') ) ); diff --git a/app/code/Magento/GoogleShopping/composer.json b/app/code/Magento/GoogleShopping/composer.json index c8ecd6ddb8595..b69240a10c610 100644 --- a/app/code/Magento/GoogleShopping/composer.json +++ b/app/code/Magento/GoogleShopping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index 6248d6171d29d..dcc7c763cc1df 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-catalog-import-export": "0.1.0-alpha107", - "magento/module-grouped-product": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-catalog-import-export": "0.1.0-alpha108", + "magento/module-grouped-product": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php b/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php index a634212946770..cc6cddecf5145 100644 --- a/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php +++ b/app/code/Magento/GroupedProduct/Pricing/Price/FinalPrice.php @@ -6,12 +6,12 @@ namespace Magento\GroupedProduct\Pricing\Price; use Magento\Catalog\Model\Product; -use Magento\Framework\Pricing\Price\AbstractPrice; +use Magento\Catalog\Pricing\Price\FinalPriceInterface; /** * Final price model */ -class FinalPrice extends AbstractPrice +class FinalPrice extends \Magento\Catalog\Pricing\Price\FinalPrice implements FinalPriceInterface { /** * Price type final diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index a5f635c75f815..9ad1453a1e382 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-msrp": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-msrp": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index fb456a81c8cb1..3d9ad7513549e 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "ext-ctype": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 01b62704b0fc0..b825e659d83ee 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index d42fcaa004dd5..2c296f9e50d6f 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-user": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-user": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Invitation/composer.json b/app/code/Magento/Invitation/composer.json index 89e48410aa068..aebd10a4ef042 100644 --- a/app/code/Magento/Invitation/composer.json +++ b/app/code/Magento/Invitation/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-newsletter": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-newsletter": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php b/app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php new file mode 100644 index 0000000000000..ae847b418da39 --- /dev/null +++ b/app/code/Magento/LayeredNavigation/Model/Aggregation/Status.php @@ -0,0 +1,19 @@ + - + diff --git a/app/code/Magento/Log/composer.json b/app/code/Magento/Log/composer.json index 87b4712265e8b..e3c551d3ca470 100644 --- a/app/code/Magento/Log/composer.json +++ b/app/code/Magento/Log/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Logging/composer.json b/app/code/Magento/Logging/composer.json index 6c4254475e305..96b17c2e23b5b 100644 --- a/app/code/Magento/Logging/composer.json +++ b/app/code/Magento/Logging/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-user": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-pci": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-user": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-pci": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index 9171355041bdb..9407296a1f270 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -3,21 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-bundle": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-configurable-product": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-downloadable": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-grouped-product": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-bundle": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-downloadable": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-grouped-product": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php b/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php index 3b6f61a1a4977..eadb58a9090a1 100644 --- a/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php +++ b/app/code/Magento/Msrp/data/msrp_setup/data-install-2.0.0.php @@ -11,7 +11,6 @@ \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL, \Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE, \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE, - \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE, ]; $productTypes = join(',', $productTypes); diff --git a/app/code/Magento/MultipleWishlist/Controller/Search.php b/app/code/Magento/MultipleWishlist/Controller/Search.php index f9c520b67d17f..7cf685c91a21a 100644 --- a/app/code/Magento/MultipleWishlist/Controller/Search.php +++ b/app/code/Magento/MultipleWishlist/Controller/Search.php @@ -90,8 +90,11 @@ class Search extends \Magento\Framework\App\Action\Action protected $_itemFactory; /** - * Construct - * + * @var \Magento\Framework\Module\Manager + */ + protected $moduleManager; + + /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Wishlist\Model\ItemFactory $itemFactory @@ -103,6 +106,7 @@ class Search extends \Magento\Framework\App\Action\Action * @param \Magento\Checkout\Model\Cart $checkoutCart * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param \Magento\Framework\Module\Manager $moduleManager */ public function __construct( \Magento\Framework\App\Action\Context $context, @@ -115,7 +119,8 @@ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, \Magento\Checkout\Model\Cart $checkoutCart, \Magento\Customer\Model\Session $customerSession, - \Magento\Framework\Locale\ResolverInterface $localeResolver + \Magento\Framework\Locale\ResolverInterface $localeResolver, + \Magento\Framework\Module\Manager $moduleManager ) { $this->_coreRegistry = $coreRegistry; $this->_itemFactory = $itemFactory; @@ -127,6 +132,7 @@ public function __construct( $this->_checkoutCart = $checkoutCart; $this->_customerSession = $customerSession; $this->_localeResolver = $localeResolver; + $this->moduleManager = $moduleManager; parent::__construct($context); } @@ -139,7 +145,7 @@ public function __construct( */ public function dispatch(RequestInterface $request) { - if (!$this->_objectManager->get('Magento\MultipleWishlist\Helper\Data')->isModuleEnabled()) { + if (!$this->moduleManager->isEnabled('Magento_MultipleWishlist')) { throw new NotFoundException(); } return parent::dispatch($request); diff --git a/app/code/Magento/MultipleWishlist/Controller/Search/Addtocart.php b/app/code/Magento/MultipleWishlist/Controller/Search/Addtocart.php index 54dabafdb4372..e309368763a30 100644 --- a/app/code/Magento/MultipleWishlist/Controller/Search/Addtocart.php +++ b/app/code/Magento/MultipleWishlist/Controller/Search/Addtocart.php @@ -26,6 +26,7 @@ class Addtocart extends \Magento\MultipleWishlist\Controller\Search * @param \Magento\Checkout\Model\Cart $checkoutCart * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param \Magento\Framework\Module\Manager $moduleManager * @param \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor */ public function __construct( @@ -40,6 +41,7 @@ public function __construct( \Magento\Checkout\Model\Cart $checkoutCart, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Locale\ResolverInterface $localeResolver, + \Magento\Framework\Module\Manager $moduleManager, \Magento\Wishlist\Model\LocaleQuantityProcessor $quantityProcessor ) { $this->quantityProcessor = $quantityProcessor; @@ -55,7 +57,8 @@ public function __construct( $checkoutSession, $checkoutCart, $customerSession, - $localeResolver + $localeResolver, + $moduleManager ); } @@ -73,16 +76,16 @@ public function execute() /** @var \Magento\Checkout\Model\Cart $cart */ $cart = $this->_checkoutCart; - $qtys = $this->getRequest()->getParam('qty'); - $selected = $this->getRequest()->getParam('selected'); + $qtys = (array)$this->getRequest()->getParam('qty'); + $selected = (array)$this->getRequest()->getParam('selected'); foreach ($qtys as $itemId => $qty) { if ($qty && isset($selected[$itemId])) { + /** @var \Magento\Wishlist\Model\Item $item*/ + $item = $this->_itemFactory->create(); try { - /** @var \Magento\Wishlist\Model\Item $item*/ - $item = $this->_itemFactory->create(); $item->loadWithOptions($itemId); $item->unsProduct(); - $qty = $this->qtyProcessor->process($qty); + $qty = $this->quantityProcessor->process($qty); if ($qty) { $item->setQty($qty); } @@ -104,6 +107,7 @@ public function execute() } } + $redirectUrl = ''; if ($this->_objectManager->get('Magento\Checkout\Helper\Cart')->getShouldRedirectToCart()) { $redirectUrl = $this->_objectManager->get('Magento\Checkout\Helper\Cart')->getCartUrl(); } elseif ($this->_redirect->getRefererUrl()) { diff --git a/app/code/Magento/MultipleWishlist/composer.json b/app/code/Magento/MultipleWishlist/composer.json index 9dd134916626a..a5b607f47b830 100644 --- a/app/code/Magento/MultipleWishlist/composer.json +++ b/app/code/Magento/MultipleWishlist/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-advanced-checkout": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-advanced-checkout": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-reports": "0.1.0-alpha107" + "magento/module-reports": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/MultipleWishlist/view/adminhtml/templates/sales/order/create/sidebar/items.phtml b/app/code/Magento/MultipleWishlist/view/adminhtml/templates/sales/order/create/sidebar/items.phtml index 1fc36d5ba7ba7..a9c2976a65cd5 100644 --- a/app/code/Magento/MultipleWishlist/view/adminhtml/templates/sales/order/create/sidebar/items.phtml +++ b/app/code/Magento/MultipleWishlist/view/adminhtml/templates/sales/order/create/sidebar/items.phtml @@ -78,7 +78,7 @@ - +
getItemCount() && $this->canRemoveItems()): ?> diff --git a/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php b/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php index dbbac7f2881c7..8c7250a86e38f 100644 --- a/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php +++ b/app/code/Magento/Multishipping/Block/Checkout/Address/Select.php @@ -4,8 +4,9 @@ */ namespace Magento\Multishipping\Block\Checkout\Address; -use Magento\Customer\Helper\Address as CustomerAddressHelper; use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Customer\Helper\Address as CustomerAddressHelper; +use Magento\Customer\Api\AddressRepositoryInterface; /** * Class Select @@ -24,14 +25,24 @@ class Select extends \Magento\Multishipping\Block\Checkout\AbstractMultishipping protected $addressMapper; /** - * @var AddressConverter + * @var bool */ - protected $addressConverter; + protected $_isScopePrivate = true; /** - * @var bool + * @var \Magento\Framework\Api\FilterBuilder */ - protected $_isScopePrivate = true; + protected $filterBuilder; + + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + protected $searchCriteriaBuilder; + + /** + * @var AddressRepositoryInterface + */ + protected $addressRepository; /** * Initialize dependencies. @@ -40,6 +51,9 @@ class Select extends \Magento\Multishipping\Block\Checkout\AbstractMultishipping * @param \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping * @param CustomerAddressHelper $customerAddressHelper * @param \Magento\Customer\Model\Address\Mapper $addressMapper + * @param AddressRepositoryInterface $addressRepository + * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Framework\Api\FilterBuilder $filterBuilder * @param array $data */ public function __construct( @@ -47,10 +61,16 @@ public function __construct( \Magento\Multishipping\Model\Checkout\Type\Multishipping $multishipping, CustomerAddressHelper $customerAddressHelper, \Magento\Customer\Model\Address\Mapper $addressMapper, + AddressRepositoryInterface $addressRepository, + \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, + \Magento\Framework\Api\FilterBuilder $filterBuilder, array $data = [] ) { $this->_customerAddressHelper = $customerAddressHelper; $this->addressMapper = $addressMapper; + $this->addressRepository = $addressRepository; + $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->filterBuilder = $filterBuilder; parent::__construct($context, $multishipping, $data); } @@ -75,7 +95,13 @@ public function getAddress() $addresses = $this->getData('address_collection'); if (is_null($addresses)) { try { - $addresses = $this->_multishipping->getCustomer()->getAddresses(); + $filter = $this->filterBuilder->setField('parent_id') + ->setValue($this->_multishipping->getCustomer()->getId()) + ->setConditionType('eq') + ->create(); + $addresses = (array)($this->addressRepository->getList( + $this->searchCriteriaBuilder->addFilter([$filter])->create() + )->getItems()); } catch (NoSuchEntityException $e) { return []; } @@ -108,7 +134,7 @@ public function getAddressAsHtml(\Magento\Customer\Api\Data\AddressInterface $ad */ public function isAddressDefaultBilling(\Magento\Customer\Api\Data\AddressInterface $address) { - return $address->getId() == $this->_multishipping->getCustomer()->getDefaultBilling()->getId(); + return $address->getId() == $this->_multishipping->getCustomer()->getDefaultBilling(); } /** @@ -119,7 +145,7 @@ public function isAddressDefaultBilling(\Magento\Customer\Api\Data\AddressInterf */ public function isAddressDefaultShipping(\Magento\Customer\Api\Data\AddressInterface $address) { - return $address->getId() == $this->_multishipping->getCustomer()->getDefaultShipping()->getId(); + return $address->getId() == $this->_multishipping->getCustomer()->getDefaultShipping(); } /** diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php index a880a4a525078..7fd0c139d5f7f 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditAddress.php @@ -25,7 +25,7 @@ public function execute() $this->_url->getUrl('*/*/selectBilling') ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); } $this->_view->renderLayout(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php index e3667e15877d3..a9058be4ffd9a 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditBilling.php @@ -18,17 +18,18 @@ public function execute() $this->_view->loadLayout(); $this->_view->getLayout()->initMessages(); if ($addressForm = $this->_view->getLayout()->getBlock('customer_address_edit')) { + $id = $this->getRequest()->getParam('id'); $addressForm->setTitle( __('Edit Billing Address') )->setSuccessUrl( - $this->_url->getUrl('*/*/saveBilling', ['id' => $this->getRequest()->getParam('id')]) + $this->_url->getUrl('*/*/saveBilling', ['id' => $id]) )->setErrorUrl( - $this->_url->getUrl('*/*/*', ['id' => $this->getRequest()->getParam('id')]) + $this->_url->getUrl('*/*/*', ['id' => $id]) )->setBackUrl( $this->_url->getUrl('*/checkout/overview') ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); } $this->_view->renderLayout(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php index ede47e3abb6aa..6a06c0e9697ba 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/EditShipping.php @@ -27,7 +27,7 @@ public function execute() ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) { diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php index f0a6a3f75d686..5a44b7897bb80 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewBilling.php @@ -26,7 +26,7 @@ public function execute() ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); } $this->_view->renderLayout(); diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php index fc10d4c715515..e14f4f7d671bc 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/NewShipping.php @@ -29,7 +29,7 @@ public function execute() ); $this->_view->getPage()->getConfig()->getTitle()->set( - $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getDefaultTitle() + $addressForm->getTitle() . ' - ' . $this->_view->getPage()->getConfig()->getTitle()->getDefault() ); if ($this->_getCheckout()->getCustomerDefaultShippingAddress()) { diff --git a/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php b/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php index 069f738c79e7c..91d62b2f3efbc 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php +++ b/app/code/Magento/Multishipping/Controller/Checkout/Address/ShippingSaved.php @@ -6,20 +6,50 @@ use Magento\Framework\App\Action\Context; use Magento\Multishipping\Controller\Checkout\Address; +use Magento\Customer\Api\AddressRepositoryInterface; +use Magento\Framework\Api\FilterBuilder; +use Magento\Framework\Api\SearchCriteriaBuilder; /** * Class ShippingSaved + * + * @SuppressWarnings(PHPMD.LongVariable) */ class ShippingSaved extends Address { + /** + * @var \Magento\Customer\Api\AddressRepositoryInterface + */ + private $addressRepository; + + /** + * @var \Magento\Framework\Api\FilterBuilder + */ + private $filterBuilder; + + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + private $searchCriteriaBuilder; + /** * Initialize dependencies. * * @param Context $context + * @param AddressRepositoryInterface $addressRepository + * @param FilterBuilder $filterBuilder + * @param SearchCriteriaBuilder $searchCriteriaBuilder */ - public function __construct(Context $context) - { + public function __construct( + Context $context, + AddressRepositoryInterface $addressRepository, + FilterBuilder $filterBuilder, + SearchCriteriaBuilder $searchCriteriaBuilder + ) { parent::__construct($context); + $this->addressRepository = $addressRepository; + $this->filterBuilder = $filterBuilder; + $this->searchCriteriaBuilder = $searchCriteriaBuilder; } /** @@ -27,10 +57,16 @@ public function __construct(Context $context) */ public function execute() { + $filter = $this->filterBuilder->setField('parent_id')->setValue($this->_getCheckout()->getCustomer()->getId()) + ->setConditionType('eq')->create(); + $addresses = (array)($this->addressRepository->getList( + $this->searchCriteriaBuilder->addFilter([$filter])->create() + )->getItems()); + /** * if we create first address we need reset emd init checkout */ - if (count($this->_getCheckout()->getCustomer()->getAddresses()) === 1) { + if (count($addresses) === 1) { $this->_getCheckout()->reset(); } $this->_redirect('*/checkout/addresses'); diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index bc3cbd8eec61f..c69cdb0d32d53 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index 2e74c05f7c8dc..a0d81c9588e9c 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-email": "0.1.0-alpha107", - "magento/module-cron": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-email": "0.1.0-alpha108", + "magento/module-cron": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index ad0cd38c6ef41..d45c7212a27c9 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-payment": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-payment": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index 178ad7ac2ebee..5728f7e83a269 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ogone/composer.json b/app/code/Magento/Ogone/composer.json index 2a5bdb5158a45..3f2787cce5605 100644 --- a/app/code/Magento/Ogone/composer.json +++ b/app/code/Magento/Ogone/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ogone/etc/adminhtml/system.xml b/app/code/Magento/Ogone/etc/adminhtml/system.xml index dfad6bcbb0b2a..e8a14cd428f3e 100644 --- a/app/code/Magento/Ogone/etc/adminhtml/system.xml +++ b/app/code/Magento/Ogone/etc/adminhtml/system.xml @@ -10,14 +10,12 @@ - -
+ -


Signing up with Ogone

-

Please enter the correct post back url and offline processiong url in Ogone configuration

-

post back url example: http://myMagentoStore.com/ogone/api/postBack

-

offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

-
+

Signing up with Ogone

+

Please enter the correct post back url and offline processiong url in Ogone configuration

+

Post back url example: http://myMagentoStore.com/ogone/api/postBack

+

Offline processing url example: http://myMagentoStore.com/ogone/api/offlineProcess

]]> diff --git a/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php b/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php index df4b261363fce..3563eb35ec27f 100644 --- a/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php +++ b/app/code/Magento/PageCache/Model/Observer/InvalidateCache.php @@ -41,6 +41,5 @@ public function execute() if ($this->_config->isEnabled()) { $this->_typeList->invalidate('full_page'); } - return $this; } } diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index ac5530438b4e1..46db836900a14 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PageCache/etc/varnish.vcl b/app/code/Magento/PageCache/etc/varnish.vcl index 294dd0ecaf30d..4b2a337ba321f 100644 --- a/app/code/Magento/PageCache/etc/varnish.vcl +++ b/app/code/Magento/PageCache/etc/varnish.vcl @@ -47,10 +47,6 @@ sub vcl_recv { return (pass); } - if (req.url ~ "\.(css|js|jpg|png|gif|tiff|bmp|gz|tgz|bz2|tbz|mp3|ogg|svg|swf|woff)(\?|$)") { - unset req.http.Cookie; - } - set req.grace = 1m; return (lookup); @@ -107,6 +103,7 @@ sub vcl_deliver { } else { unset resp.http.Age; } + unset resp.http.X-Magento-Debug; unset resp.http.X-Magento-Tags; unset resp.http.X-Powered-By; diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 58ba4eb649962..d3aa20a10f0a8 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-centinel": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-centinel": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php index 632cd900e0a72..19b2c55a4ab8a 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Expanded.php @@ -12,33 +12,9 @@ class Expanded extends \Magento\Backend\Block\System\Config\Form\Fieldset { /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Framework\View\Helper\Js $jsHelper - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Framework\View\Helper\Js $jsHelper, - array $data = [] - ) { - parent::__construct($context, $authSession, $jsHelper, $data); - } - - /** - * Return collapse state + * Whether is collapsed by default * - * @param AbstractElement $element - * @return string|true + * @var bool */ - protected function _isCollapseState($element) - { - $extra = $this->_authSession->getUser()->getExtra(); - if (isset($extra['configState'][$element->getId()])) { - return $extra['configState'][$element->getId()]; - } - - return true; - } + protected $isCollapsedDefault = true; } diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php index e2be19910642c..96400b8a6afbc 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Hint.php @@ -15,25 +15,6 @@ class Hint extends \Magento\Backend\Block\Template implements \Magento\Framework */ protected $_template = 'Magento_Paypal::system/config/fieldset/hint.phtml'; - /** - * @var \Magento\Framework\View\Helper\Js - */ - protected $_jsHelper; - - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Framework\View\Helper\Js $jsHelper - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Framework\View\Helper\Js $jsHelper, - array $data = [] - ) { - $this->_jsHelper = $jsHelper; - parent::__construct($context, $data); - } - /** * Render fieldset html * @@ -46,52 +27,6 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele if (isset($elementOriginalData['help_link'])) { $this->setHelpLink($elementOriginalData['help_link']); } - $js = ' - paypalToggleSolution = function(id, url) { - var doScroll = false; - Fieldset.toggleCollapse(id, url); - if ($(this).hasClassName("open")) { - $$(".with-button button.button").each(function(anotherButton) { - if (anotherButton != this && $(anotherButton).hasClassName("open")) { - $(anotherButton).click(); - doScroll = true; - } - }.bind(this)); - } - if (doScroll) { - var pos = Element.cumulativeOffset($(this)); - window.scrollTo(pos[0], pos[1] - 45); - } - } - - togglePaypalSolutionConfigureButton = function(button, enable) { - var $button = $(button); - $button.disabled = !enable; - if ($button.hasClassName("disabled") && enable) { - $button.removeClassName("disabled"); - } else if (!$button.hasClassName("disabled") && !enable) { - $button.addClassName("disabled"); - } - } - - // check store-view disabling Express Checkout - document.observe("dom:loaded", function() { - $$(".pp-method-express button.button").each(function(ecButton){ - var ecEnabler = $$(".paypal-ec-enabler")[0]; - if (typeof ecButton == "undefined" || typeof ecEnabler != "undefined") { - return; - } - var $ecButton = $(ecButton); - $$(".with-button button.button").each(function(configureButton) { - if (configureButton != ecButton && !configureButton.disabled - && !$(configureButton).hasClassName("paypal-ec-separate") - ) { - togglePaypalSolutionConfigureButton(ecButton, false); - } - }); - }); - }); - '; - return $this->toHtml() . $this->_jsHelper->getScript($js); + return $this->toHtml(); } } diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php deleted file mode 100644 index 88146eca8f7da..0000000000000 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Location.php +++ /dev/null @@ -1,392 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset; - -class Location extends \Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded -{ - /** - * Render fieldset html - * - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element - * @return string - */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) - { - $this->setElement($element); - $js = ' - require(["jquery", "prototype"], function(jQuery){ - jQuery("body").on("adminConfigDefined", function() { - $$(".with-button button.button").each(function(configureButton) { - togglePaypalSolutionConfigureButton(configureButton, true); - }); - var paypalConflictsObject = { - "isConflict": false, - "ecMissed": false, - sharePayflowEnabling: function(enabler, isEvent) { - - var isPayflowLinkEnabled = !!$$(".paypal-payflowlink")[0], - isPayflowAdvancedEnabled = !!$$(".paypal-payflow-advanced")[0]; - var ecPayflowEnabler = $$(".paypal-ec-payflow-enabler")[+isPayflowLinkEnabled]; - if (typeof ecPayflowEnabler == "undefined") { - return; - } - var ecPayflowScopeElement = adminSystemConfig.getScopeElement(ecPayflowEnabler); - - if (!enabler.enablerObject.ecPayflow) { - if ((!ecPayflowScopeElement || !ecPayflowScopeElement.checked) && isEvent - && enabler.value == 1 - ) { - ecPayflowEnabler.value = 0; - fireEvent(ecPayflowEnabler, "change"); - } - return; - } - - var enablerScopeElement = adminSystemConfig.getScopeElement(enabler); - if (enablerScopeElement && ecPayflowScopeElement - && enablerScopeElement.checked != ecPayflowScopeElement.checked - && (isEvent || ecPayflowScopeElement.checked) - ) { - $(ecPayflowScopeElement).click(); - } - - var ecEnabler = $$(".paypal-ec-enabler")[0]; - if (ecPayflowEnabler.value != enabler.value - && (isEvent || enabler.value == 1 && !isPayflowLinkEnabled) - ) { - ecPayflowEnabler.value = enabler.value; - paypalConflictsObject.checklessEventAction(ecPayflowEnabler, true); - if (ecPayflowEnabler.value == 1) { - if (typeof ecEnabler != "undefined") { - var ecEnablerScopeElement = adminSystemConfig.getScopeElement(ecEnabler); - ecEnabler.value = 0; - if (ecEnablerScopeElement && ecEnablerScopeElement.checked) { - paypalConflictsObject.checklessEventAction(ecEnablerScopeElement, false); - } - paypalConflictsObject.checklessEventAction(ecEnabler, true); - } - } - } - if (!isEvent && ecPayflowEnabler.value == 1 && typeof ecEnabler != "undefined") { - var ecSolution = $$(".pp-method-express")[0]; - if (typeof ecSolution != "undefined" && !$(ecSolution).hasClassName("enabled")) { - ecSolution.addClassName("enabled"); - } - } - }, - onChangeEnabler: function(event) { - paypalConflictsObject.checkPaymentConflicts($(Event.element(event)), "change"); - }, - onClickEnablerScope: function(event) { - paypalConflictsObject.checkPaymentConflicts( - $(adminSystemConfig.getUpTr($(Event.element(event))).select(".paypal-enabler")[0]), - "click" - ); - }, - getSharedElements: function(element) { - var sharedElements = []; - adminSystemConfig.mapClasses(element, true, function(elementClassName) { - $$("." + elementClassName).each(function(sharedElement) { - if (sharedElements.indexOf(sharedElement) == -1) { - sharedElements.push(sharedElement); - } - }); - }); - if (sharedElements.length == 0) { - sharedElements.push(element); - } - return sharedElements; - }, - checklessEventAction: function(element, isChange) { - var action = isChange ? "change" : "click"; - var handler = isChange - ? paypalConflictsObject.onChangeEnabler - : paypalConflictsObject.onClickEnablerScope; - paypalConflictsObject.getSharedElements(element).each(function(sharedElement) { - Event.stopObserving(sharedElement, action, handler); - if (isChange) { - sharedElement.value = element.value; - if ($(sharedElement).requiresObj) { - $(sharedElement).requiresObj.indicateEnabled(); - } - } - }); - if (isChange) { - fireEvent(element, "change"); - } else { - $(element).click(); - } - paypalConflictsObject.getSharedElements(element).each(function(sharedElement) { - Event.observe(sharedElement, action, handler); - }); - }, - ecCheckAvailability: function() { - $$(".pp-method-express button.button").each(function(ecButton){ - if (typeof ecButton == "undefined") { - return; - } - var couldBeConfigured = true; - $$(".paypal-enabler").each(function(enabler) { - if (enabler.enablerObject.ecEnabler || enabler.enablerObject.ecConflicts - || enabler.enablerObject.ecSeparate - ) { - return; - } - if (enabler.value == 1) { - couldBeConfigured = false; - } - }); - if (couldBeConfigured) { - togglePaypalSolutionConfigureButton(ecButton, true); - } else { - togglePaypalSolutionConfigureButton(ecButton, false); - } - }); - }, - // type could be "initial", "change", "click" - checkPaymentConflicts: function(enabler, type) { - if (!enabler.enablerObject) { - return; - } - var isEvent = (type != "initial"); - var ecEnabler = $$(".paypal-ec-enabler")[0]; - - if (enabler.value == 0) { - if (!enabler.enablerObject.ecIndependent && type == "change") { - if (typeof ecEnabler != "undefined" && ecEnabler.value == 1) { - var ecEnablerScopeElement = adminSystemConfig.getScopeElement(ecEnabler); - if (!ecEnablerScopeElement || !ecEnablerScopeElement.checked) { - ecEnabler.value = 0; - paypalConflictsObject.checklessEventAction(ecEnabler, true); - } - } - } - paypalConflictsObject.ecCheckAvailability(); - paypalConflictsObject.sharePayflowEnabling(enabler, isEvent); - return; - } - - var confirmationApproved = isEvent; - var confirmationShowed = false; - // check other solutions - $$(".paypal-enabler").each(function(anotherEnabler) { - var anotherEnablerScopeElement = adminSystemConfig.getScopeElement(anotherEnabler); - if (!confirmationApproved && isEvent || $(anotherEnabler) == enabler - || anotherEnabler.value == 0 - && (!anotherEnablerScopeElement || !anotherEnablerScopeElement.checked) - ) { - return; - } - var conflict = enabler.enablerObject.ecConflicts && anotherEnabler.enablerObject.ecEnabler - || enabler.enablerObject.ecEnabler && anotherEnabler.enablerObject.ecConflicts - || !enabler.enablerObject.ecIndependent && anotherEnabler.enablerObject.ecConflicts - || !enabler.enablerObject.ecEnabler && !anotherEnabler.enablerObject.ecEnabler; - - if (conflict && !confirmationShowed && anotherEnabler.value == 1) { - if (isEvent) { - confirmationApproved = confirm(\'' . - $this->escapeJsQuote( - __('There is already another PayPal solution enabled. Enable this solution instead?') - ) . - '\'); - } else { - paypalConflictsObject.isConflict = true; - } - confirmationShowed = true; - } - if (conflict && confirmationApproved) { - anotherEnabler.value = 0; - if (anotherEnablerScopeElement && anotherEnablerScopeElement.checked && isEvent) { - paypalConflictsObject.checklessEventAction(anotherEnablerScopeElement, false); - } - paypalConflictsObject.checklessEventAction(anotherEnabler, true); - } - }); - - if (!enabler.enablerObject.ecIndependent) { - if (!isEvent && (typeof ecEnabler == "undefined" || ecEnabler.value == 0)) { - if (!enabler.enablerObject.ecPayflow) { - paypalConflictsObject.ecMissed = true; - } - } else if (isEvent && typeof ecEnabler != "undefined" && confirmationApproved) { - var ecEnablerScopeElement = adminSystemConfig.getScopeElement(ecEnabler); - if (ecEnablerScopeElement && ecEnablerScopeElement.checked) { - paypalConflictsObject.checklessEventAction(ecEnablerScopeElement, false); - } - if (ecEnabler.value == 0 && !enabler.enablerObject.ecPayflow) { - ecEnabler.value = 1; - paypalConflictsObject.checklessEventAction(ecEnabler, true); - } - } - } - - if (!confirmationApproved && isEvent) { - enabler.value = 0; - paypalConflictsObject.checklessEventAction(enabler, true); - } - paypalConflictsObject.ecCheckAvailability(); - paypalConflictsObject.sharePayflowEnabling(enabler, isEvent); - }, - handleBmlEnabler: function(event) { - required = Event.element(event); - var bml = $(required).bmlEnabler; - if (required.value == "1") { - bml.value = "1"; - } - paypalConflictsObject.toggleBmlEnabler(required); - }, - - toggleBmlEnabler: function(required) { - var bml = $(required).bmlEnabler; - if (!bml) { - return; - } - if (required.value != "1") { - bml.value = "0"; - $(bml).disable(); - } - $(bml).requiresObj.indicateEnabled(); - } - }; - - // fill enablers with conflict data - $$(".paypal-enabler").each(function(enablerElement) { - var enablerObj = { - ecIndependent: false, - ecConflicts: false, - ecEnabler: false, - ecSeparate: false, - ecPayflow: false - }; - $(enablerElement).classNames().each(function(className) { - switch (className) { - case "paypal-ec-conflicts": - enablerObj.ecConflicts = true; - case "paypal-ec-independent": - enablerObj.ecIndependent = true; - break; - case "paypal-ec-enabler": - enablerObj.ecEnabler = true; - enablerObj.ecIndependent = true; - break; - case "paypal-ec-separate": - enablerObj.ecSeparate = true; - enablerObj.ecIndependent = true; - break; - case "paypal-ec-pe": - enablerObj.ecPayflow = true; - break; - } - }); - enablerElement.enablerObject = enablerObj; - - Event.observe(enablerElement, "change", paypalConflictsObject.onChangeEnabler); - var enablerScopeElement = adminSystemConfig.getScopeElement(enablerElement); - if (enablerScopeElement) { - Event.observe(enablerScopeElement, "click", paypalConflictsObject.onClickEnablerScope); - } - }); - - // initially uncheck payflow - var isPayflowLinkEnabled = !!$$(".paypal-payflowlink")[0], - isPayflowAdvancedEnabled = !!$$(".paypal-payflow-advanced")[0]; - var ecPayflowEnabler = $$(".paypal-ec-payflow-enabler")[+isPayflowLinkEnabled]; - if (typeof ecPayflowEnabler != "undefined") { - if (ecPayflowEnabler.value == 1 && !isPayflowLinkEnabled) { - ecPayflowEnabler.value = 0; - fireEvent(ecPayflowEnabler, "change"); - } - - var ecPayflowScopeElement = adminSystemConfig.getScopeElement(ecPayflowEnabler); - if (ecPayflowScopeElement && !ecPayflowScopeElement.checked) { - $(ecPayflowScopeElement).click(); - } - } - $$(".paypal-bml").each(function(bmlEnabler) { - $(bmlEnabler).classNames().each(function(className) { - if (className.indexOf("requires-") !== -1) { - var required = $(className.replace("requires-", "")); - required.bmlEnabler = bmlEnabler; - Event.observe(required, "change", paypalConflictsObject.handleBmlEnabler); - } - }); - }); - - $$(".paypal-enabler").each(function(enablerElement) { - paypalConflictsObject.checkPaymentConflicts(enablerElement, "initial"); - paypalConflictsObject.toggleBmlEnabler(enablerElement); - }); - if (paypalConflictsObject.isConflict || paypalConflictsObject.ecMissed) { - var notification = \'' . - $this->escapeJsQuote( - __('The following error(s) occured:') - ) . - '\'; - if (paypalConflictsObject.isConflict) { - notification += "\\n " + \'' . - $this->escapeJsQuote( - __('Some PayPal solutions conflict.') - ) . - '\'; - } - if (paypalConflictsObject.ecMissed) { - notification += "\\n " + \'' . - $this->escapeJsQuote( - __('PayPal Express Checkout is not enabled.') - ) . '\'; - } - notification += "\\n" + \'' . - $this->escapeJsQuote( - __('Please re-enable the previously enabled payment solutions.') - ) . - '\'; - setTimeout(function() { - alert(notification); - }, 1); - } - - $$(".requires").each(function(dependent) { - var $dependent = $(dependent); - if ($dependent.hasClassName("paypal-ec-enabler") || $dependent.hasClassName("paypal-ec-payflow-enabler")) { - $dependent.requiresObj.callback = function(required) { - if ($(required).hasClassName("paypal-enabler") && required.value == 0) { - $dependent.disable(); - } - } - $dependent.requiresObj.requires.each(function(required) { - $dependent.requiresObj.callback(required); - }); - } - }); - - configForm.on(\'afterValidate\', function() { - var isPayflowLinkEnabled = !!$$(".paypal-payflowlink")[0], - isPayflowAdvancedEnabled = !!$$(".paypal-payflow-advanced")[0]; - var ecPayflowEnabler = $$(".paypal-ec-payflow-enabler")[+isPayflowLinkEnabled]; - if (typeof ecPayflowEnabler == "undefined") { - return; - } - var ecPayflowScopeElement = adminSystemConfig.getScopeElement(ecPayflowEnabler); - if ((typeof ecPayflowScopeElement == "undefined" || !ecPayflowScopeElement.checked) - && ecPayflowEnabler.value == 1 - ) { - $$(".paypal-ec-enabler").each(function(ecEnabler) { - ecEnabler.value = 0; - }); - } - }); - }); - - }); - '; - return parent::render($element) . $this->_jsHelper->getScript($js); - } -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Advanced/Review.php b/app/code/Magento/Paypal/Block/Payflow/Advanced/Review.php deleted file mode 100644 index cd5e45dfc924f..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Advanced/Review.php +++ /dev/null @@ -1,16 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Payflow\Advanced; - -class Review extends \Magento\Paypal\Block\Payflow\Link\Review -{ -} diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Review.php b/app/code/Magento/Paypal/Block/Payflow/Link/Review.php deleted file mode 100644 index 09fb9fdbcc87c..0000000000000 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Review.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -namespace Magento\Paypal\Block\Payflow\Link; - -class Review extends \Magento\Paypal\Block\Express\Review -{ - /** - * Retrieve payment method and assign additional template values - * - * @return \Magento\Paypal\Block\Express\Review - */ - protected function _beforeToHtml() - { - return parent::_beforeToHtml(); - } -} diff --git a/app/code/Magento/Paypal/Model/Config.php b/app/code/Magento/Paypal/Model/Config.php index 667f56a04d822..41c842ed330cf 100644 --- a/app/code/Magento/Paypal/Model/Config.php +++ b/app/code/Magento/Paypal/Model/Config.php @@ -84,15 +84,6 @@ class Config const PAYMENT_ACTION_AUTH = 'Authorization'; - /**#@-*/ - - /**#@+ - * Authorization amounts for Account Verification - * - * @deprecated since 1.6.2.0 - */ - const AUTHORIZATION_AMOUNT_ZERO = 0; - const AUTHORIZATION_AMOUNT_ONE = 1; const AUTHORIZATION_AMOUNT_FULL = 2; @@ -1364,17 +1355,6 @@ public function getPaymentAction() } } - /** - * Returns array of possible Authorization Amounts for Account Verification - * - * @deprecated since 1.6.2.0 - * @return array - */ - public function getAuthorizationAmounts() - { - return []; - } - /** * Express Checkout "solution types" source getter * "sole" = "Express Checkout for Auctions" - PayPal allows guest checkout diff --git a/app/code/Magento/Paypal/Model/Info.php b/app/code/Magento/Paypal/Model/Info.php index 62f12475d0dc5..6ba17ac8da075 100644 --- a/app/code/Magento/Paypal/Model/Info.php +++ b/app/code/Magento/Paypal/Model/Info.php @@ -36,7 +36,7 @@ class Info const AVS_CODE = 'avs_result'; - const CVV2_MATCH = 'cvv2_check_result'; + const CVV_2_MATCH = 'cvv_2_check_result'; const CENTINEL_VPAS = 'centinel_vpas_result'; @@ -81,7 +81,7 @@ class Info self::FRAUD_FILTERS => self::PAYPAL_FRAUD_FILTERS, self::CORRELATION_ID => self::PAYPAL_CORRELATION_ID, self::AVS_CODE => self::PAYPAL_AVS_CODE, - self::CVV2_MATCH => self::PAYPAL_CVV2_MATCH, + self::CVV_2_MATCH => self::PAYPAL_CVV_2_MATCH, self::CENTINEL_VPAS => self::CENTINEL_VPAS, self::CENTINEL_ECI => self::CENTINEL_ECI, self::BUYER_TAX_ID => self::BUYER_TAX_ID, @@ -223,7 +223,7 @@ class Info /** * Paypal cvv2 code key */ - const PAYPAL_CVV2_MATCH = 'paypal_cvv2_match'; + const PAYPAL_CVV_2_MATCH = 'paypal_cvv_2_match'; /** * Item labels key for label codes cache @@ -565,7 +565,7 @@ protected function _getLabel($key) self::PAYPAL_FRAUD_FILTERS => __('Triggered Fraud Filters'), self::PAYPAL_CORRELATION_ID => __('Last Correlation ID'), self::PAYPAL_AVS_CODE => __('Address Verification System Response'), - self::PAYPAL_CVV2_MATCH => __('CVV2 Check Result by PayPal'), + self::PAYPAL_CVV_2_MATCH => __('CVV2 Check Result by PayPal'), self::BUYER_TAX_ID => __('Buyer\'s Tax ID'), self::BUYER_TAX_ID_TYPE => __('Buyer\'s Tax ID Type'), self::CENTINEL_VPAS => __('PayPal/Centinel Visa Payer Authentication Service Result'), @@ -608,7 +608,7 @@ protected function _getValue($value, $key) case self::PAYPAL_AVS_CODE: $label = $this->_getAvsLabel($value); break; - case self::PAYPAL_CVV2_MATCH: + case self::PAYPAL_CVV_2_MATCH: $label = $this->_getCvv2Label($value); break; case self::CENTINEL_VPAS: @@ -682,8 +682,8 @@ protected function _getAvsLabel($value) */ protected function _getCvv2Label($value) { - if (!isset($this->_labelCodesCache[self::PAYPAL_CVV2_MATCH])) { - $this->_labelCodesCache[self::PAYPAL_CVV2_MATCH] = [ + if (!isset($this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH])) { + $this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH] = [ // Visa, MasterCard, Discover and American Express 'M' => __('Matched (CVV2CSC)'), 'N' => __('No match'), @@ -699,8 +699,8 @@ protected function _getCvv2Label($value) '4' => __('N/A. Service not available'), ]; } - return isset($this->_labelCodesCache[self::PAYPAL_CVV2_MATCH][$value]) - ? $this->_labelCodesCache[self::PAYPAL_CVV2_MATCH][$value] + return isset($this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH][$value]) + ? $this->_labelCodesCache[self::PAYPAL_CVV_2_MATCH][$value] : $value; } diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php index 98b0435f5f265..bc259105f60cc 100644 --- a/app/code/Magento/Paypal/Model/Observer.php +++ b/app/code/Magento/Paypal/Model/Observer.php @@ -119,17 +119,6 @@ public function fetchReports() } } - /** - * Clean unfinished transaction - * - * @deprecated since 1.6.2.0 - * @return $this - */ - public function cleanTransactions() - { - return $this; - } - /** * Save order into registry to use it in the overloaded controller. * diff --git a/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php b/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php deleted file mode 100644 index 41d0fd6d98f8c..0000000000000 --- a/app/code/Magento/Paypal/Model/System/Config/Source/AuthorizationAmounts.php +++ /dev/null @@ -1,22 +0,0 @@ - - */ -class AuthorizationAmounts implements \Magento\Framework\Option\ArrayInterface -{ - /** - * {@inheritdoc} - */ - public function toOptionArray() - { - return []; - } -} diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index 37ea51999d5a3..41b5ef5edf95c 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -3,26 +3,26 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-centinel": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-centinel": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Paypal/etc/adminhtml/system.xml b/app/code/Magento/Paypal/etc/adminhtml/system.xml index a567be7aa8589..a283dd99ee78d 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system.xml @@ -13,7 +13,7 @@ - Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Location + Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Expanded If not specified, Default Country from General Config will be used diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml index d918a5f580e27..ecc7661ccb0d0 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -8,5 +8,9 @@ - + + + + + diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml index f2a336e1e71ea..16b05c4b2fcb4 100644 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml +++ b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/hint.phtml @@ -17,3 +17,49 @@ + diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/location.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/location.phtml new file mode 100644 index 0000000000000..504b225253b0c --- /dev/null +++ b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/fieldset/location.phtml @@ -0,0 +1,352 @@ + + \ No newline at end of file diff --git a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml index 1694b18ab4b11..b259409c98af4 100644 --- a/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml +++ b/app/code/Magento/Paypal/view/adminhtml/templates/system/config/payflowlink/advanced.phtml @@ -8,9 +8,11 @@ */ ?>
- - - +

+ + + +

  • AVS: No
  • CSC: No
  • diff --git a/app/code/Magento/Paypal/view/adminhtml/web/styles.css b/app/code/Magento/Paypal/view/adminhtml/web/styles.css index 6462d8d14fe4f..428ea97b5dcc8 100644 --- a/app/code/Magento/Paypal/view/adminhtml/web/styles.css +++ b/app/code/Magento/Paypal/view/adminhtml/web/styles.css @@ -5,11 +5,11 @@ .pp-general-uk > .entry-edit-head > .config-heading .heading strong, .pp-method-payflow > .entry-edit-head > .config-heading .heading strong, .pp-method-express > .entry-edit-head > .config-heading .heading strong, -.pp-method-general > .entry-edit-head > .config-heading .heading strong { padding-left:90px; background:url(images/paypal-logo.png) no-repeat 0 0px; line-height: 23px; } -.pp-method-general > .entry-edit-head > .config-heading:before { content:url(images/pp-allinone.png); float:right; } -.pp-method-express > .entry-edit-head > .config-heading:before { content:url(images/pp-alt.png); float:right; } -.pp-method-payflow > .entry-edit-head > .config-heading:before { content:url(images/pp-gateways.png); float:right; } -.pp-general-uk > .entry-edit-head > .config-heading:before { content:url(images/pp-uk.png); float:right; } -.payflow-settings-notice {padding-bottom: 1em;max-width: 660px;} -.payflow-settings-notice .important-label {color:red;} +.pp-method-general > .entry-edit-head > .config-heading .heading strong { padding-left:90px;background:url(images/paypal-logo.png) no-repeat 0 0;line-height: 23px;} +.pp-method-general > .entry-edit-head > .config-heading:before { content:url(images/pp-allinone.png);float:right;} +.pp-method-express > .entry-edit-head > .config-heading:before { content:url(images/pp-alt.png);float:right;} +.pp-method-payflow > .entry-edit-head > .config-heading:before { content:url(images/pp-gateways.png);float:right;} +.pp-general-uk > .entry-edit-head > .config-heading:before { content:url(images/pp-uk.png);float:right;} +.payflow-settings-notice { border:1px solid #d1d0ce;padding:0 10px;margin: 0;} +.payflow-settings-notice .important-label {color:#f00;} .payflow-settings-notice ul.options-list {list-style:disc;padding:0 2em;} diff --git a/app/code/Magento/Pbridge/Helper/Data.php b/app/code/Magento/Pbridge/Helper/Data.php index bf69044bf9014..017aab66b5baf 100644 --- a/app/code/Magento/Pbridge/Helper/Data.php +++ b/app/code/Magento/Pbridge/Helper/Data.php @@ -431,7 +431,7 @@ public function getPbridgeParams() ? $data['original_payment_method'] : null, 'token' => isset($data['token']) ? $data['token'] : null, - 'cc_last4' => isset($data['cc_last4']) ? $data['cc_last4'] : null, + 'cc_last_4' => isset($data['cc_last_4']) ? $data['cc_last_4'] : null, 'cc_type' => isset($data['cc_type']) ? $data['cc_type'] : null, 'x_params' => isset($data['x_params']) ? serialize($data['x_params']) : null, ]; diff --git a/app/code/Magento/Pbridge/Model/Encryption.php b/app/code/Magento/Pbridge/Model/Encryption.php index ce1a6a2bbd673..d727cf6c87add 100644 --- a/app/code/Magento/Pbridge/Model/Encryption.php +++ b/app/code/Magento/Pbridge/Model/Encryption.php @@ -6,28 +6,25 @@ use Magento\Framework\App\DeploymentConfig; use Magento\Framework\Encryption\Crypt; -use Magento\Framework\Encryption\CryptFactory; use Magento\Framework\Math\Random; -class Encryption extends \Magento\Pci\Model\Encryption +class Encryption extends \Magento\Framework\Encryption\Encryptor { /** * Constructor * * @param Random $randomGenerator - * @param CryptFactory $cryptFactory * @param DeploymentConfig $deploymentConfig * @param string $key */ public function __construct( Random $randomGenerator, - CryptFactory $cryptFactory, DeploymentConfig $deploymentConfig, $key ) { - parent::__construct($randomGenerator, $cryptFactory, $deploymentConfig); - $this->_keys = [$key]; - $this->_keyVersion = 0; + parent::__construct($randomGenerator, $deploymentConfig); + $this->keys = [$key]; + $this->keyVersion = 0; } /** @@ -40,17 +37,17 @@ public function __construct( * @param bool $initVector * @return Crypt */ - protected function _getCrypt($key = null, $cipherVersion = null, $initVector = true) + protected function getCrypt($key = null, $cipherVersion = null, $initVector = true) { if (null === $key && null == $cipherVersion) { $cipherVersion = self::CIPHER_RIJNDAEL_256; } if (null === $key) { - $key = $this->_keys[$this->_keyVersion]; + $key = $this->keys[$this->keyVersion]; } if (null === $cipherVersion) { - $cipherVersion = $this->_cipher; + $cipherVersion = $this->cipher; } $cipherVersion = $this->validateCipher($cipherVersion); @@ -76,7 +73,7 @@ protected function _getCrypt($key = null, $cipherVersion = null, $initVector = t */ public function decrypt($data) { - return parent::decrypt($this->_keyVersion . ':' . self::CIPHER_LATEST . ':' . $data); + return parent::decrypt($this->keyVersion . ':' . self::CIPHER_LATEST . ':' . $data); } /** @@ -87,7 +84,7 @@ public function decrypt($data) */ public function encrypt($data) { - $crypt = $this->_getCrypt(); + $crypt = $this->getCrypt(); return $crypt->getInitVector() . ':' . base64_encode($crypt->encrypt((string)$data)); } } diff --git a/app/code/Magento/Pbridge/Model/Payment/Method/Pbridge.php b/app/code/Magento/Pbridge/Model/Payment/Method/Pbridge.php index a7224b67e2b0c..f34f98e13327b 100644 --- a/app/code/Magento/Pbridge/Model/Payment/Method/Pbridge.php +++ b/app/code/Magento/Pbridge/Model/Payment/Method/Pbridge.php @@ -215,13 +215,13 @@ public function assignData($data) if (is_array($data)) { if (isset($data['pbridge_data'])) { $pbridgeData = $data['pbridge_data']; - $data['cc_last4'] = $pbridgeData['cc_last4']; + $data['cc_last_4'] = $pbridgeData['cc_last_4']; $data['cc_type'] = $pbridgeData['cc_type']; unset($data['pbridge_data']); } } else { $pbridgeData = $data->getData('pbridge_data'); - $data->setData('cc_last4', $pbridgeData['cc_last4']); + $data->setData('cc_last_4', $pbridgeData['cc_last_4']); $data->setData('cc_type', $pbridgeData['cc_type']); $data->unsetData('pbridge_data'); } diff --git a/app/code/Magento/Pbridge/composer.json b/app/code/Magento/Pbridge/composer.json index 991f3b4c74dcf..78aa4aa53e4cb 100644 --- a/app/code/Magento/Pbridge/composer.json +++ b/app/code/Magento/Pbridge/composer.json @@ -3,22 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-pci": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-centinel": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-centinel": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Pbridge/view/frontend/checkout/review/button.continue.phtml b/app/code/Magento/Pbridge/view/frontend/templates/checkout/review/button.continue.phtml similarity index 100% rename from app/code/Magento/Pbridge/view/frontend/checkout/review/button.continue.phtml rename to app/code/Magento/Pbridge/view/frontend/templates/checkout/review/button.continue.phtml diff --git a/app/code/Magento/Pbridge/view/frontend/checkout/review/cancel.phtml b/app/code/Magento/Pbridge/view/frontend/templates/checkout/review/cancel.phtml similarity index 100% rename from app/code/Magento/Pbridge/view/frontend/checkout/review/cancel.phtml rename to app/code/Magento/Pbridge/view/frontend/templates/checkout/review/cancel.phtml diff --git a/app/code/Magento/Pbridge/view/frontend/checkout/review/onepage.success.phtml b/app/code/Magento/Pbridge/view/frontend/templates/checkout/review/onepage.success.phtml similarity index 100% rename from app/code/Magento/Pbridge/view/frontend/checkout/review/onepage.success.phtml rename to app/code/Magento/Pbridge/view/frontend/templates/checkout/review/onepage.success.phtml diff --git a/app/code/Magento/PbridgePaypal/composer.json b/app/code/Magento/PbridgePaypal/composer.json index 0fb69dc804a00..0ea7071c0ef9b 100644 --- a/app/code/Magento/PbridgePaypal/composer.json +++ b/app/code/Magento/PbridgePaypal/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-pbridge": "0.1.0-alpha107", - "magento/module-paypal": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-centinel": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-pbridge": "0.1.0-alpha108", + "magento/module-paypal": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-centinel": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Pci/Controller/Adminhtml/Crypt/Key/Save.php b/app/code/Magento/Pci/Controller/Adminhtml/Crypt/Key/Save.php index 785cdfaf1f676..49edce3003290 100644 --- a/app/code/Magento/Pci/Controller/Adminhtml/Crypt/Key/Save.php +++ b/app/code/Magento/Pci/Controller/Adminhtml/Crypt/Key/Save.php @@ -22,7 +22,7 @@ public function execute() if (empty($key)) { throw new \Exception(__('Please enter an encryption key.')); } - $this->_objectManager->get('Magento\Pci\Model\Encryption')->validateKey($key); + $this->_objectManager->get('Magento\Framework\Encryption\EncryptorInterface')->validateKey($key); } $newKey = $this->_objectManager->get('Magento\Pci\Model\Resource\Key\Change')->changeEncryptionKey($key); diff --git a/app/code/Magento/Pci/Model/Backend/Observer.php b/app/code/Magento/Pci/Model/Backend/Observer.php index 6911ae1c4627e..512edb428c1eb 100644 --- a/app/code/Magento/Pci/Model/Backend/Observer.php +++ b/app/code/Magento/Pci/Model/Backend/Observer.php @@ -67,7 +67,7 @@ class Observer /** * Pci encryption model * - * @var \Magento\Pci\Model\Encryption + * @var \Magento\Framework\Encryption\EncryptorInterface */ protected $_encryptor; @@ -93,7 +93,7 @@ class Observer * @param \Magento\Backend\Model\Session $session * @param \Magento\Backend\Model\Auth\Session $authSession * @param \Magento\User\Model\UserFactory $userFactory - * @param \Magento\Pci\Model\Encryption $encryptor + * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor * @param \Magento\Framework\App\ActionFlag $actionFlag * @param \Magento\Framework\Message\ManagerInterface $messageManager */ @@ -105,7 +105,7 @@ public function __construct( \Magento\Backend\Model\Session $session, \Magento\Backend\Model\Auth\Session $authSession, \Magento\User\Model\UserFactory $userFactory, - \Magento\Pci\Model\Encryption $encryptor, + \Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\App\ActionFlag $actionFlag, \Magento\Framework\Message\ManagerInterface $messageManager ) { diff --git a/app/code/Magento/Pci/Model/Encryption.php b/app/code/Magento/Pci/Model/Encryption.php deleted file mode 100644 index 2be1f115b0ef0..0000000000000 --- a/app/code/Magento/Pci/Model/Encryption.php +++ /dev/null @@ -1,299 +0,0 @@ -_keys = preg_split('/\s+/s', trim($this->_cryptKey)); - $this->_keyVersion = count($this->_keys) - 1; - } - - /** - * Check whether specified cipher version is supported - * - * Returns matched supported version or throws exception - * - * @param int $version - * @return int - * @throws Exception - */ - public function validateCipher($version) - { - $types = [self::CIPHER_BLOWFISH, self::CIPHER_RIJNDAEL_128, self::CIPHER_RIJNDAEL_256]; - - $version = (int)$version; - if (!in_array($version, $types, true)) { - throw new Exception(__('Not supported cipher version')); - } - return $version; - } - - /** - * Validate hash against all supported versions. - * - * Priority is by newer version. - * - * @param string $password - * @param string $hash - * @return bool - */ - public function validateHash($password, $hash) - { - return $this->validateHashByVersion( - $password, - $hash, - self::HASH_VERSION_SHA256 - ) || $this->validateHashByVersion( - $password, - $hash, - self::HASH_VERSION_MD5 - ); - } - - /** - * Hash a string - * - * @param string $data - * @param int $version - * @return string - */ - public function hash($data, $version = self::HASH_VERSION_LATEST) - { - if (self::HASH_VERSION_MD5 === $version) { - return md5($data); - } - return hash('sha256', $data); - } - - /** - * Validate hash by specified version - * - * @param string $password - * @param string $hash - * @param int $version - * @return bool - */ - public function validateHashByVersion($password, $hash, $version = self::HASH_VERSION_LATEST) - { - // look for salt - $hashArr = explode(':', $hash, 2); - if (1 === count($hashArr)) { - return $this->hash($password, $version) === $hash; - } - list($hash, $salt) = $hashArr; - return $this->hash($salt . $password, $version) === $hash; - } - - /** - * Set cipher to be used for encryption/decryption - * - * @param int $version - * @return $this - */ - // public function setCipher($version = self::CIPHER_LATEST) - // { - // $this->_cipher = $this->validateCipher($version); - // return $this; - // } - - /** - * Attempt to append new key & version - * - * @param string $key - * @return $this - */ - public function setNewKey($key) - { - parent::validateKey($key); - $this->_keys[] = $key; - $this->_keyVersion += 1; - return $this; - } - - /** - * Export current keys as string - * - * @return string - */ - public function exportKeys() - { - return implode("\n", $this->_keys); - } - - /** - * Initialize crypt module if needed - * - * By default initializes with latest key and crypt versions - * - * @param string $key - * @param int $cipherVersion - * @param bool $initVector - * @return Crypt - */ - protected function _getCrypt($key = null, $cipherVersion = null, $initVector = true) - { - if (null === $key && null == $cipherVersion) { - $cipherVersion = self::CIPHER_RIJNDAEL_256; - } - - if (null === $key) { - $key = $this->_keys[$this->_keyVersion]; - } - if (null === $cipherVersion) { - $cipherVersion = $this->_cipher; - } - $cipherVersion = $this->validateCipher($cipherVersion); - - if ($cipherVersion === self::CIPHER_RIJNDAEL_128) { - $cipher = MCRYPT_RIJNDAEL_128; - $mode = MCRYPT_MODE_ECB; - } elseif ($cipherVersion === self::CIPHER_RIJNDAEL_256) { - $cipher = MCRYPT_RIJNDAEL_256; - $mode = MCRYPT_MODE_CBC; - } else { - $cipher = MCRYPT_BLOWFISH; - $mode = MCRYPT_MODE_ECB; - } - - return new Crypt($key, $cipher, $mode, $initVector); - } - - /** - * Look for key and crypt versions in encrypted data before decrypting - * - * Unsupported/unspecified key version silently fallback to the oldest we have - * Unsupported cipher versions eventually throw exception - * Unspecified cipher version fallback to the oldest we support - * - * @param string $data - * @return string - */ - public function decrypt($data) - { - if ($data) { - $parts = explode(':', $data, 4); - $partsCount = count($parts); - - $initVector = false; - // specified key, specified crypt, specified iv - if (4 === $partsCount) { - list($keyVersion, $cryptVersion, $iv, $data) = $parts; - $initVector = $iv ? $iv : false; - $keyVersion = (int)$keyVersion; - $cryptVersion = self::CIPHER_RIJNDAEL_256; - // specified key, specified crypt - } elseif (3 === $partsCount) { - list($keyVersion, $cryptVersion, $data) = $parts; - $keyVersion = (int)$keyVersion; - $cryptVersion = (int)$cryptVersion; - // no key version = oldest key, specified crypt - } elseif (2 === $partsCount) { - list($cryptVersion, $data) = $parts; - $keyVersion = 0; - $cryptVersion = (int)$cryptVersion; - // no key version = oldest key, no crypt version = oldest crypt - } elseif (1 === $partsCount) { - $keyVersion = 0; - $cryptVersion = self::CIPHER_BLOWFISH; - // not supported format - } else { - return ''; - } - // no key for decryption - if (!isset($this->_keys[$keyVersion])) { - return ''; - } - $crypt = $this->_getCrypt($this->_keys[$keyVersion], $cryptVersion, $initVector); - return trim($crypt->decrypt(base64_decode((string)$data))); - } - return ''; - } - - /** - * Prepend key and cipher versions to encrypted data after encrypting - * - * @param string $data - * @return string - */ - public function encrypt($data) - { - $crypt = $this->_getCrypt(); - return $this->_keyVersion . ':' . $this->_cipher . ':' . (MCRYPT_MODE_CBC === - $crypt->getMode() ? $crypt->getInitVector() . ':' : '') . base64_encode( - $crypt->encrypt((string)$data) - ); - } - - /** - * Validate an encryption key - * - * @param string $key - * @return Crypt - * @throws \Exception - */ - public function validateKey($key) - { - if (false !== strpos($key, '') || preg_match('/\s/s', $key)) { - throw new \Exception(__('The encryption key format is invalid.')); - } - return parent::validateKey($key); - } -} diff --git a/app/code/Magento/Pci/Model/Observer.php b/app/code/Magento/Pci/Model/Observer.php index abeaf3b758b15..68fe9e7fae111 100644 --- a/app/code/Magento/Pci/Model/Observer.php +++ b/app/code/Magento/Pci/Model/Observer.php @@ -16,14 +16,14 @@ class Observer /** * Pci encryption model * - * @var \Magento\Pci\Model\Encryption + * @var \Magento\Framework\Encryption\EncryptorInterface */ protected $_encryptor; /** - * @param \Magento\Pci\Model\Encryption $encryptor + * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor */ - public function __construct(\Magento\Pci\Model\Encryption $encryptor) + public function __construct(\Magento\Framework\Encryption\EncryptorInterface $encryptor) { $this->_encryptor = $encryptor; } diff --git a/app/code/Magento/Pci/composer.json b/app/code/Magento/Pci/composer.json index 4114f1c54f083..ced31dee05926 100644 --- a/app/code/Magento/Pci/composer.json +++ b/app/code/Magento/Pci/composer.json @@ -3,13 +3,13 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-user": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-user": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index d97b8434ebb04..adedb09775a1b 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-cron": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-cron": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PersistentHistory/composer.json b/app/code/Magento/PersistentHistory/composer.json index ca2e306f24d91..c4083731b2106 100644 --- a/app/code/Magento/PersistentHistory/composer.json +++ b/app/code/Magento/PersistentHistory/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-persistent": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-persistent": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/PricePermissions/composer.json b/app/code/Magento/PricePermissions/composer.json index 9d66414b9b62b..b6afaac1ce396 100644 --- a/app/code/Magento/PricePermissions/composer.json +++ b/app/code/Magento/PricePermissions/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-bundle": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-downloadable": "0.1.0-alpha107", - "magento/module-gift-card": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-msrp": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-bundle": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-downloadable": "0.1.0-alpha108", + "magento/module-gift-card": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-msrp": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/Block/Product/View.php b/app/code/Magento/ProductAlert/Block/Product/View.php index 140fd950fbdc4..4e0058dffddf0 100644 --- a/app/code/Magento/ProductAlert/Block/Product/View.php +++ b/app/code/Magento/ProductAlert/Block/Product/View.php @@ -21,21 +21,29 @@ class View extends \Magento\Framework\View\Element\Template */ protected $_helper; + /** + * @var \Magento\Core\Helper\PostData + */ + protected $coreHelper; + /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\ProductAlert\Helper\Data $helper * @param \Magento\Framework\Registry $registry + * @param \Magento\Core\Helper\PostData $coreHelper * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\ProductAlert\Helper\Data $helper, \Magento\Framework\Registry $registry, + \Magento\Core\Helper\PostData $coreHelper, array $data = [] ) { parent::__construct($context, $data); $this->_registry = $registry; $this->_helper = $helper; + $this->coreHelper = $coreHelper; } /** @@ -51,4 +59,14 @@ protected function getProduct() } return false; } + + /** + * Retrieve post action config + * + * @return string + */ + public function getPostAction() + { + return $this->coreHelper->getPostData($this->getSignupUrl()); + } } diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index a8113feacbd78..d6810509eb8e4 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml b/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml index 656ea03cc3ebf..82e868064eecc 100644 --- a/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml +++ b/app/code/Magento/ProductAlert/view/frontend/templates/product/view.phtml @@ -5,7 +5,7 @@ ?>
    - escapeHtml(__($this->getSignupLabel())); ?> diff --git a/app/code/Magento/PromotionPermissions/composer.json b/app/code/Magento/PromotionPermissions/composer.json index e1410abb53c42..64016e3df7df8 100644 --- a/app/code/Magento/PromotionPermissions/composer.json +++ b/app/code/Magento/PromotionPermissions/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-banner": "0.1.0-alpha107", - "magento/module-reminder": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-banner": "0.1.0-alpha108", + "magento/module-reminder": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107" + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Reminder/composer.json b/app/code/Magento/Reminder/composer.json index ac90abded75b1..0450c996f7785 100644 --- a/app/code/Magento/Reminder/composer.json +++ b/app/code/Magento/Reminder/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/module-rule": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/module-rule": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Reports/Model/Event/Observer.php b/app/code/Magento/Reports/Model/Event/Observer.php index 828387e24ef3e..29a7c544c17b3 100644 --- a/app/code/Magento/Reports/Model/Event/Observer.php +++ b/app/code/Magento/Reports/Model/Event/Observer.php @@ -85,19 +85,17 @@ protected function _event($eventTypeId, $objectId, $subjectId = null, $subtype = } } + /** @var \Magento\Reports\Model\Event $eventModel */ $eventModel = $this->_eventFactory->create(); $storeId = $this->_storeManager->getStore()->getId(); - $eventModel->setEventTypeId( - $eventTypeId - )->setObjectId( - $objectId - )->setSubjectId( - $subjectId - )->setSubtype( - $subtype - )->setStoreId( - $storeId - ); + $eventModel->setData([ + 'event_type_id' => $eventTypeId, + 'object_id' => $objectId, + 'subject_id' => $subjectId, + 'subtype' => $subtype, + 'store_id' => $storeId, + ]); + $eventModel->save(); return $this; @@ -149,7 +147,15 @@ public function catalogProductView(\Magento\Framework\Event\Observer $observer) { $productId = $observer->getEvent()->getProduct()->getId(); - $this->_productIndxFactory->create()->setProductId($productId)->save()->calculate(); + $viewData['product_id'] = $productId; + + if ($this->_customerSession->isLoggedIn()) { + $viewData['customer_id'] = $this->_customerSession->getCustomerId(); + } else { + $viewData['visitor_id'] = $this->_customerVisitor->getId(); + } + + $this->_productIndxFactory->create()->setData($viewData)->save()->calculate(); return $this->_event(\Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, $productId); } diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index 58439372714d4..67c3875efcf78 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-log": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-review": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-downloadable": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-log": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-review": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-downloadable": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index dda8112f82d4b..335ef79628263 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php index 5f864e58bfb86..829789a368dd9 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php @@ -134,7 +134,6 @@ protected function _prepareForm() 'name' => 'detail', 'title' => __('Review'), 'label' => __('Review'), - 'style' => 'height: 600px;', 'required' => true ] ); diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php index abd21e1e1be82..1e1ee3352df1e 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Edit/Tab/Form.php @@ -13,6 +13,11 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; + /** + * @var string + */ + protected $_template = 'rating/form.phtml'; + /** * Session * @@ -176,26 +181,4 @@ protected function _setRatingCodes($ratingCodes) } } } - - /** - * @return string - */ - protected function _toHtml() - { - return $this->_getWarningHtml() . parent::_toHtml(); - } - - /** - * @return string - */ - protected function _getWarningHtml() - { - return ' -
    -
    ' . - __( - 'Please specify a rating title for a store, or we\'ll just use the default value.' - ) . '
    -
    '; - } } diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 5fcfa4f60977f..c0d1ce3385bab 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-newsletter": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-newsletter": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Review/view/adminhtml/templates/rating/form.phtml b/app/code/Magento/Review/view/adminhtml/templates/rating/form.phtml new file mode 100644 index 0000000000000..0f4b8c6bd6dd8 --- /dev/null +++ b/app/code/Magento/Review/view/adminhtml/templates/rating/form.phtml @@ -0,0 +1,10 @@ + +
    +
    +
    + +getFormHtml() ?> diff --git a/app/code/Magento/Reward/composer.json b/app/code/Magento/Reward/composer.json index 7cd444fd81835..6a10927216669 100644 --- a/app/code/Magento/Reward/composer.json +++ b/app/code/Magento/Reward/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-invitation": "0.1.0-alpha107", - "magento/module-newsletter": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-invitation": "0.1.0-alpha108", + "magento/module-newsletter": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rma/Controller/Adminhtml/Rma/Viewfile.php b/app/code/Magento/Rma/Controller/Adminhtml/Rma/Viewfile.php index ede3dc982adb6..8e4b14afe128f 100644 --- a/app/code/Magento/Rma/Controller/Adminhtml/Rma/Viewfile.php +++ b/app/code/Magento/Rma/Controller/Adminhtml/Rma/Viewfile.php @@ -5,11 +5,49 @@ */ namespace Magento\Rma\Controller\Adminhtml\Rma; +use Magento\Backend\App\Action; use Magento\Framework\App\Action\NotFoundException; use Magento\Framework\App\Filesystem\DirectoryList; class Viewfile extends \Magento\Rma\Controller\Adminhtml\Rma { + /** + * @var \Magento\Framework\Url\DecoderInterface + */ + protected $urlDecoder; + + /** + * @param Action\Context $context + * @param \Magento\Framework\Registry $coreRegistry + * @param \Magento\Framework\App\Response\Http\FileFactory $fileFactory + * @param \Magento\Framework\Filesystem $filesystem + * @param \Magento\Shipping\Helper\Carrier $carrierHelper + * @param \Magento\Rma\Model\Shipping\LabelService $labelService + * @param \Magento\Rma\Model\Rma\RmaDataMapper $rmaDataMapper + * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + */ + public function __construct( + Action\Context $context, + \Magento\Framework\Registry $coreRegistry, + \Magento\Framework\App\Response\Http\FileFactory $fileFactory, + \Magento\Framework\Filesystem $filesystem, + \Magento\Shipping\Helper\Carrier $carrierHelper, + \Magento\Rma\Model\Shipping\LabelService $labelService, + \Magento\Rma\Model\Rma\RmaDataMapper $rmaDataMapper, + \Magento\Framework\Url\DecoderInterface $urlDecoder + ) { + parent::__construct( + $context, + $coreRegistry, + $fileFactory, + $filesystem, + $carrierHelper, + $labelService, + $rmaDataMapper + ); + $this->urlDecoder = $urlDecoder; + } + /** * Retrieve image MIME type by its extension * @@ -38,13 +76,12 @@ public function execute() $plain = false; if ($this->getRequest()->getParam('file')) { // download file - $fileName = $this->_objectManager->get('Magento\Core\Helper\Data') - ->urlDecode($this->getRequest()->getParam('file')); + $fileName = $this->urlDecoder->decode( + $this->getRequest()->getParam('file') + ); } elseif ($this->getRequest()->getParam('image')) { // show plain image - $fileName = $this->_objectManager->get( - 'Magento\Core\Helper\Data' - )->urlDecode( + $fileName = $this->urlDecoder->decode( $this->getRequest()->getParam('image') ); $plain = true; diff --git a/app/code/Magento/Rma/composer.json b/app/code/Magento/Rma/composer.json index 71f7033c8e4a6..2c259080b5fbd 100644 --- a/app/code/Magento/Rma/composer.json +++ b/app/code/Magento/Rma/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-custom-attribute-management": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-customer-custom-attributes": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-custom-attribute-management": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-customer-custom-attributes": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", "ext-gd": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rma/view/adminhtml/layout/adminhtml_rma_chooseorder.xml b/app/code/Magento/Rma/view/adminhtml/layout/adminhtml_rma_chooseorder.xml index b0a30e42f4896..052fbaa998755 100644 --- a/app/code/Magento/Rma/view/adminhtml/layout/adminhtml_rma_chooseorder.xml +++ b/app/code/Magento/Rma/view/adminhtml/layout/adminhtml_rma_chooseorder.xml @@ -6,14 +6,14 @@ --> - - + + - + diff --git a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php index b4b901d6673c2..7e8d7dfefe005 100644 --- a/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php +++ b/app/code/Magento/Rss/App/Action/Plugin/BackendAuthentication.php @@ -34,9 +34,7 @@ class BackendAuthentication extends \Magento\Backend\App\Action\Plugin\Authentic /** * @var array */ - protected $aclResources = [ - 'feed' => 'Magento_Rss::rss', - ]; + protected $aclResources; /** * @param \Magento\Backend\Model\Auth $auth @@ -47,6 +45,7 @@ class BackendAuthentication extends \Magento\Backend\App\Action\Plugin\Authentic * @param \Magento\Framework\HTTP\Authentication $httpAuthentication * @param \Magento\Framework\Logger $logger * @param \Magento\Framework\AuthorizationInterface $authorization + * @param array $aclResources */ public function __construct( \Magento\Backend\Model\Auth $auth, @@ -56,11 +55,13 @@ public function __construct( \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\HTTP\Authentication $httpAuthentication, \Magento\Framework\Logger $logger, - \Magento\Framework\AuthorizationInterface $authorization + \Magento\Framework\AuthorizationInterface $authorization, + array $aclResources ) { $this->httpAuthentication = $httpAuthentication; $this->logger = $logger; $this->authorization = $authorization; + $this->aclResources = $aclResources; parent::__construct($auth, $url, $response, $actionFlag, $messageManager); } @@ -72,6 +73,8 @@ public function __construct( * @param RequestInterface $request * @return ResponseInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) */ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, RequestInterface $request) { @@ -81,7 +84,10 @@ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, Reque : $this->aclResources[$request->getControllerName()] : null; - if (!$resource) { + $type = $request->getParam('type'); + $resourceType = isset($this->aclResources[$type]) ? $this->aclResources[$type] : null; + + if (!$resource || !$resourceType) { return parent::aroundDispatch($subject, $proceed, $request); } @@ -98,7 +104,8 @@ public function aroundDispatch(AbstractAction $subject, \Closure $proceed, Reque } // Verify if logged in and authorized - if (!$session->isLoggedIn() || !$this->authorization->isAllowed($resource)) { + if (!$session->isLoggedIn() || !$this->authorization->isAllowed($resource) + || !$this->authorization->isAllowed($resourceType)) { $this->httpAuthentication->setAuthenticationFailed('RSS Feeds'); return $this->_response; } diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index 3bd82567206c8..7c32665a8450b 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Rss/etc/adminhtml/di.xml b/app/code/Magento/Rss/etc/adminhtml/di.xml index f25790e4275fa..dd3194d60a8b0 100644 --- a/app/code/Magento/Rss/etc/adminhtml/di.xml +++ b/app/code/Magento/Rss/etc/adminhtml/di.xml @@ -8,4 +8,14 @@ + + + + Magento_Rss::rss + Magento_Catalog::catalog_inventory + Magento_Sales::actions_view + Magento_Reports::review_product + + + diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index ad484578953eb..2d66f205d8d8f 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php index 9f605a4566e7b..372999e56bc72 100644 --- a/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php +++ b/app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php @@ -139,10 +139,10 @@ interface OrderPaymentInterface extends \Magento\Framework\Api\ExtensibleDataInt /* * Last four digits of credit card number. */ - const CC_LAST4 = 'cc_last4'; + const CC_LAST_4 = 'cc_last_4'; /* * Credit card status description. - */ + * const CC_STATUS_DESCRIPTION = 'cc_status_description'; /* * eCheck type. @@ -439,7 +439,7 @@ public function getCcLast4(); /** * Gets the encrypted credit card number for the order payment. * - * @return string Encrypted credit card number . + * @return string Encrypted credit card number. */ public function getCcNumberEnc(); diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php index e78d2706b7fb0..f027b6b36e925 100644 --- a/app/code/Magento/Sales/Model/AdminOrder/Create.php +++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php @@ -471,7 +471,7 @@ public function initFromOrder(\Magento\Sales\Model\Order $order) $quote->getShippingAddress()->setShippingDescription($order->getShippingDescription()); $paymentData = $order->getPayment()->getData(); - unset($paymentData['cc_type'], $paymentData['cc_last4']); + unset($paymentData['cc_type'], $paymentData['cc_last_4']); unset($paymentData['cc_exp_month'], $paymentData['cc_exp_year']); $quote->getPayment()->addData($paymentData); diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index 324f9af688ddb..b8ef9173022b8 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -297,6 +297,7 @@ public function getShippingAddress() public function getItemsCollection() { $collection = $this->_cmItemCollectionFactory->create()->setCreditmemoFilter($this->getId()); + if ($this->getId()) { foreach ($collection as $item) { $item->setCreditmemo($this); diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index ea62df34f56b2..d4ed96c547cbf 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -1957,13 +1957,13 @@ public function getCcExpYear() } /** - * Returns cc_last4 + * Returns cc_last_4 * * @return string */ public function getCcLast4() { - return $this->getData(OrderPaymentInterface::CC_LAST4); + return $this->getData(OrderPaymentInterface::CC_LAST_4); } /** diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index 1f94e48474048..2a3013319bd2f 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -746,7 +746,6 @@ public function addCustomerAddress(\Magento\Customer\Api\Data\AddressInterface $ ->setAddresses($addresses) ->create(); $this->setCustomer($customer); - return $this; } diff --git a/app/code/Magento/Sales/Model/Resource/Entity.php b/app/code/Magento/Sales/Model/Resource/Entity.php index 94a94466b9b06..9331aff68ade4 100644 --- a/app/code/Magento/Sales/Model/Resource/Entity.php +++ b/app/code/Magento/Sales/Model/Resource/Entity.php @@ -126,6 +126,22 @@ protected function _afterSave(\Magento\Framework\Model\AbstractModel $object) if ($this->gridAggregator) { $this->gridAggregator->refresh($object->getId()); } + + $adapter = $this->_getReadAdapter(); + $columns = $adapter->describeTable($this->getMainTable()); + + if (isset($columns['created_at'], $columns['updated_at'])) { + $select = $adapter->select() + ->from($this->getMainTable(), ['created_at', 'updated_at']) + ->where($this->getIdFieldName() . ' = :entity_id'); + $row = $adapter->fetchRow($select, [':entity_id' => $object->getId()]); + + if (is_array($row) && isset($row['created_at'], $row['updated_at'])) { + $object->setCreatedAt($row['created_at']); + $object->setUpdatedAt($row['updated_at']); + } + } + parent::_afterSave($object); return $this; } diff --git a/app/code/Magento/Sales/Model/Resource/Order.php b/app/code/Magento/Sales/Model/Resource/Order.php index 12e3071d9e784..08f92e636d516 100644 --- a/app/code/Magento/Sales/Model/Resource/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Order.php @@ -146,8 +146,8 @@ protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object) $store->getName(), ]; $object->setStoreName(implode("\n", $name)); + $object->setTotalItemCount($this->calculateItems($object)); } - $object->setTotalItemCount($this->calculateItems($object)); $object->setData( 'protect_code', substr(md5(uniqid(Random::getRandomNumber(), true) . ':' . microtime(true)), 5, 6) diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index f249f12c5ee06..6d804ffd3b84c 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -3,32 +3,32 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-sales-rule": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-gift-message": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-wishlist": "0.1.0-alpha107", - "magento/module-email": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-sales-rule": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-gift-message": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-wishlist": "0.1.0-alpha108", + "magento/module-email": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml index cf8df651132ac..253cc3e865f13 100644 --- a/app/code/Magento/Sales/etc/fieldset.xml +++ b/app/code/Magento/Sales/etc/fieldset.xml @@ -362,7 +362,7 @@ - + @@ -690,7 +690,7 @@ - + diff --git a/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php b/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php index 5fb8066334fd6..5b60d80169151 100644 --- a/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php +++ b/app/code/Magento/Sales/sql/sales_setup/install-2.0.0.php @@ -1887,11 +1887,11 @@ [], 'Cc Approval' )->addColumn( - 'cc_last4', + 'cc_last_4', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 255, [], - 'Cc Last4' + 'Cc Last 4' )->addColumn( 'cc_status_description', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, @@ -3147,6 +3147,12 @@ '12,4', [], 'Base Hidden Tax Amount' +)->addColumn( + 'tax_ratio', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 512, + [], + 'Ratio of tax invoiced over tax of the order item' )->addIndex( $this->getIdxName('sales_invoice_item', ['parent_id']), ['parent_id'] @@ -3893,6 +3899,12 @@ '12,4', [], 'Base Hidden Tax Amount' +)->addColumn( + 'tax_ratio', + \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 512, + [], + 'Ratio of tax in the creditmemo item over tax of the order item' )->addIndex( $this->getIdxName('sales_creditmemo_item', ['parent_id']), ['parent_id'] @@ -5312,11 +5324,11 @@ [], 'Cc Number Enc' )->addColumn( - 'cc_last4', + 'cc_last_4', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 255, [], - 'Cc Last4' + 'Cc Last 4' )->addColumn( 'cc_cid_enc', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, diff --git a/app/code/Magento/SalesArchive/composer.json b/app/code/Magento/SalesArchive/composer.json index 6230df140ccc6..858a50fd9f786 100644 --- a/app/code/Magento/SalesArchive/composer.json +++ b/app/code/Magento/SalesArchive/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index 5dc80bc7a7316..f81f1bde2345c 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -3,25 +3,25 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-rule": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/module-catalog-rule": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-rule": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/module-catalog-rule": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/ScheduledImportExport/composer.json b/app/code/Magento/ScheduledImportExport/composer.json index fa11cfe2a8730..863f3420ff6f7 100644 --- a/app/code/Magento/ScheduledImportExport/composer.json +++ b/app/code/Magento/ScheduledImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cron": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cron": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index f60768e53f680..eba2fa71e5b23 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sendfriend/composer.json b/app/code/Magento/Sendfriend/composer.json index c7d39b37f1358..4de648ebc2aa2 100644 --- a/app/code/Magento/Sendfriend/composer.json +++ b/app/code/Magento/Sendfriend/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index fb2aa855d2e16..fd8deb4b4397b 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -3,27 +3,27 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-contact": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-payment": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-contact": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-payment": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "ext-gd": "*", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-fedex": "0.1.0-alpha107", - "magento/module-ups": "0.1.0-alpha107" + "magento/module-fedex": "0.1.0-alpha108", + "magento/module-ups": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index cc23d349b9301..0434892300242 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog-url-rewrite": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog-url-rewrite": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Solr/Model/Layer/Category/Filter/Category.php b/app/code/Magento/Solr/Model/Layer/Category/Filter/Category.php index b92bc1938cbd7..4a34fed9d1c54 100644 --- a/app/code/Magento/Solr/Model/Layer/Category/Filter/Category.php +++ b/app/code/Magento/Solr/Model/Layer/Category/Filter/Category.php @@ -4,7 +4,7 @@ */ namespace Magento\Solr\Model\Layer\Category\Filter; -use Magento\Catalog\Api\CategoryRepositoryInterface; +use Magento\Catalog\Model\Layer\Filter\DataProvider\CategoryFactory; /** * Layer category filter @@ -26,9 +26,7 @@ class Category extends \Magento\Catalog\Model\Layer\Filter\Category * @param \Magento\Catalog\Model\Layer $layer * @param \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder * @param \Magento\Framework\Escaper $escaper - * @param \Magento\Catalog\Model\Layer\Filter\DataProvider\CategoryFactory $categoryFactory - * @param \Magento\Framework\Registry $coreRegistry - * @param CategoryRepositoryInterface $categoryRepository + * @param CategoryFactory $categoryDataProviderFactory * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param array $data */ @@ -38,20 +36,17 @@ public function __construct( \Magento\Catalog\Model\Layer $layer, \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder, \Magento\Framework\Escaper $escaper, - \Magento\Catalog\Model\Layer\Filter\DataProvider\CategoryFactory $categoryFactory, - \Magento\Framework\Registry $coreRegistry, - CategoryRepositoryInterface $categoryRepository, + CategoryFactory $categoryDataProviderFactory, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = [] ) { - $this->_scopeConfig = $scopeConfig; parent::__construct( $filterItemFactory, $storeManager, $layer, $itemDataBuilder, $escaper, - $categoryFactory, + $categoryDataProviderFactory, $data ); } diff --git a/app/code/Magento/Solr/composer.json b/app/code/Magento/Solr/composer.json index 13346cdae4932..0509396b8e04d 100644 --- a/app/code/Magento/Solr/composer.json +++ b/app/code/Magento/Solr/composer.json @@ -3,21 +3,21 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog-search": "0.1.0-alpha107", - "magento/module-search": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog-search": "0.1.0-alpha108", + "magento/module-search": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index becd8fa2819b2..2d51a5f161858 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -1177,7 +1177,8 @@ public function setCookie() { $cookieMetadata = $this->_cookieMetadataFactory->createPublicCookieMetadata() ->setHttpOnly(true) - ->setDurationOneYear(); + ->setDurationOneYear() + ->setPath($this->getStorePath()); $this->_cookieManager->setPublicCookie( self::COOKIE_NAME, $this->getCode(), @@ -1203,7 +1204,18 @@ public function getStoreCodeFromCookie() */ public function deleteCookie() { - $this->_cookieManager->deleteCookie(self::COOKIE_NAME); + $cookieMetadata = $this->_cookieMetadataFactory->createPublicCookieMetadata() + ->setPath($this->getStorePath()); + $this->_cookieManager->deleteCookie(self::COOKIE_NAME, $cookieMetadata); return $this; } + + /** + * @return string + */ + public function getStorePath() + { + $parsedUrl = parse_url($this->getBaseUrl()); + return isset($parsedUrl['path']) ? $parsedUrl['path'] : '/'; + } } diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 7fc270613f011..0aac9d8f09e72 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-core": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/TargetRule/composer.json b/app/code/Magento/TargetRule/composer.json index 9b2c91b171882..c372bef118264 100644 --- a/app/code/Magento/TargetRule/composer.json +++ b/app/code/Magento/TargetRule/composer.json @@ -3,24 +3,24 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-rule": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer-segment": "0.1.0-alpha107", - "magento/module-indexer": "0.1.0-alpha107", - "magento/module-page-cache": "0.1.0-alpha107", - "magento/module-import-export": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-rule": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer-segment": "0.1.0-alpha108", + "magento/module-indexer": "0.1.0-alpha108", + "magento/module-page-cache": "0.1.0-alpha108", + "magento/module-import-export": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Tax/Helper/Data.php b/app/code/Magento/Tax/Helper/Data.php index e0ce1a0427a9e..26e3386435f47 100644 --- a/app/code/Magento/Tax/Helper/Data.php +++ b/app/code/Magento/Tax/Helper/Data.php @@ -150,25 +150,25 @@ class Data extends \Magento\Framework\App\Helper\AbstractHelper protected $priceCurrency; /** - * @param \Magento\Framework\App\Helper\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Framework\Registry $coreRegistry - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param Config $taxConfig - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Magento\Framework\Locale\FormatInterface $localeFormat - * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory - * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\ItemFactory $taxItemFactory + * @param \Magento\Framework\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Framework\Registry $coreRegistry + * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param Config $taxConfig + * @param \Magento\Store\Model\StoreManagerInterface $storeManager + * @param \Magento\Framework\Locale\FormatInterface $localeFormat + * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory + * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\ItemFactory $taxItemFactory * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $orderTaxCollectionFactory - * @param \Magento\Framework\Locale\ResolverInterface $localeResolver - * @param QuoteDetailsDataBuilder $quoteDetailsBuilder - * @param QuoteDetailsItemDataBuilder $quoteDetailsItemBuilder - * @param TaxClassKeyDataBuilder $taxClassKeyBuilder - * @param TaxCalculationInterface $taxCalculation - * @param CustomerSession $customerSession - * @param \Magento\Catalog\Helper\Data $catalogHelper - * @param OrderTaxManagementInterface $orderTaxManagement - * @param PriceCurrencyInterface $priceCurrency + * @param \Magento\Framework\Locale\ResolverInterface $localeResolver + * @param QuoteDetailsDataBuilder $quoteDetailsBuilder + * @param QuoteDetailsItemDataBuilder $quoteDetailsItemBuilder + * @param TaxClassKeyDataBuilder $taxClassKeyBuilder + * @param TaxCalculationInterface $taxCalculation + * @param CustomerSession $customerSession + * @param \Magento\Catalog\Helper\Data $catalogHelper + * @param OrderTaxManagementInterface $orderTaxManagement + * @param PriceCurrencyInterface $priceCurrency */ public function __construct( \Magento\Framework\App\Helper\Context $context, @@ -223,6 +223,7 @@ public function getPostCodeSubStringLength() if ($len <= 0) { $len = 10; } + return $len; } @@ -239,8 +240,8 @@ public function getConfig() /** * Check if product prices inputed include tax * - * @param null|int|string|Store $store - * @return bool + * @param null|int|string|Store $store + * @return bool */ public function priceIncludesTax($store = null) { @@ -250,8 +251,8 @@ public function priceIncludesTax($store = null) /** * Check what taxes should be applied after discount * - * @param null|int|string|Store $store - * @return bool + * @param null|int|string|Store $store + * @return bool */ public function applyTaxAfterDiscount($store = null) { @@ -264,7 +265,7 @@ public function applyTaxAfterDiscount($store = null) * 2 - Including tax * 3 - Both * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return int */ public function getPriceDisplayType($store = null) @@ -276,7 +277,7 @@ public function getPriceDisplayType($store = null) * Check if necessary do product price conversion * If it necessary will be returned conversion type (minus or plus) * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function needPriceConversion($store = null) @@ -287,7 +288,7 @@ public function needPriceConversion($store = null) /** * Check if need display full tax summary information in totals block * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayFullSummary($store = null) @@ -298,7 +299,7 @@ public function displayFullSummary($store = null) /** * Check if need display zero tax in subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayZeroTax($store = null) @@ -309,7 +310,7 @@ public function displayZeroTax($store = null) /** * Check if need display cart prices included tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayCartPriceInclTax($store = null) @@ -320,7 +321,7 @@ public function displayCartPriceInclTax($store = null) /** * Check if need display cart prices excluding price * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayCartPriceExclTax($store = null) @@ -331,7 +332,7 @@ public function displayCartPriceExclTax($store = null) /** * Check if need display cart prices excluding and including tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displayCartBothPrices($store = null) @@ -342,7 +343,7 @@ public function displayCartBothPrices($store = null) /** * Check if need display order prices included tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesPriceInclTax($store = null) @@ -353,7 +354,7 @@ public function displaySalesPriceInclTax($store = null) /** * Check if need display order prices excluding price * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesPriceExclTax($store = null) @@ -364,7 +365,7 @@ public function displaySalesPriceExclTax($store = null) /** * Check if need display order prices excluding and including tax * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesBothPrices($store = null) @@ -375,7 +376,7 @@ public function displaySalesBothPrices($store = null) /** * Check if we need display price include and exclude tax for order/invoice subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesSubtotalBoth($store = null) @@ -386,7 +387,7 @@ public function displaySalesSubtotalBoth($store = null) /** * Check if we need display price include tax for order/invoice subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesSubtotalInclTax($store = null) @@ -397,7 +398,7 @@ public function displaySalesSubtotalInclTax($store = null) /** * Check if we need display price exclude tax for order/invoice subtotal * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return bool */ public function displaySalesSubtotalExclTax($store = null) @@ -408,7 +409,7 @@ public function displaySalesSubtotalExclTax($store = null) /** * Get prices javascript format json * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return string */ public function getPriceFormat($store = null) @@ -419,6 +420,7 @@ public function getPriceFormat($store = null) if ($store) { $priceFormat['pattern'] = $this->_storeManager->getStore($store)->getCurrentCurrency()->getOutputFormat(); } + return $this->_coreData->jsonEncode($priceFormat); } @@ -456,7 +458,7 @@ public function displayBothPrices($store = null) /** * Check if shipping prices include tax * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function shippingPriceIncludesTax($store = null) @@ -467,7 +469,7 @@ public function shippingPriceIncludesTax($store = null) /** * Get shipping price display type * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return int */ public function getShippingPriceDisplayType($store = null) @@ -508,7 +510,7 @@ public function displayShippingBothPrices() /** * Get tax class id specified for shipping tax estimation * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return int */ public function getShippingTaxClass($store) @@ -519,11 +521,11 @@ public function getShippingTaxClass($store) /** * Get shipping price * - * @param float $price - * @param bool|null $includingTax - * @param Address|null $shippingAddress - * @param int|null $ctc - * @param null|string|bool|int|Store $store + * @param float $price + * @param bool|null $includingTax + * @param Address|null $shippingAddress + * @param int|null $ctc + * @param null|string|bool|int|Store $store * @return float */ public function getShippingPrice($price, $includingTax = null, $shippingAddress = null, $ctc = null, $store = null) @@ -546,13 +548,14 @@ public function getShippingPrice($price, $includingTax = null, $shippingAddress $store, $this->shippingPriceIncludesTax($store) ); + return $price; } /** * Get configuration setting "Apply Discount On Prices Including Tax" value * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function discountTax($store = null) @@ -563,7 +566,7 @@ public function discountTax($store = null) /** * Get value of "Apply Tax On" custom/original price configuration settings * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return string|null */ public function getTaxBasedOn($store = null) @@ -578,12 +581,12 @@ public function getTaxBasedOn($store = null) /** * Check if tax can be applied to custom price * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function applyTaxOnCustomPrice($store = null) { - return (int)$this->_scopeConfig->getValue( + return (int) $this->_scopeConfig->getValue( Config::CONFIG_XML_PATH_APPLY_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store @@ -593,12 +596,12 @@ public function applyTaxOnCustomPrice($store = null) /** * Check if tax should be applied just to original price * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return bool */ public function applyTaxOnOriginalPrice($store = null) { - return (int)$this->_scopeConfig->getValue( + return (int) $this->_scopeConfig->getValue( Config::CONFIG_XML_PATH_APPLY_ON, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store @@ -611,7 +614,7 @@ public function applyTaxOnOriginalPrice($store = null) * This sequence depends on "Catalog price include tax", "Apply Tax After Discount" * and "Apply Discount On Prices Including Tax" configuration options. * - * @param null|int|string|Store $store + * @param null|int|string|Store $store * @return string */ public function getCalculationSequence($store = null) @@ -622,7 +625,7 @@ public function getCalculationSequence($store = null) /** * Get tax calculation algorithm code * - * @param null|string|bool|int|Store $store + * @param null|string|bool|int|Store $store * @return string */ public function getCalculationAgorithm($store = null) @@ -643,7 +646,7 @@ public function getCalculationAgorithm($store = null) * ) * ) * - * @param \Magento\Sales\Model\Order|\Magento\Sales\Model\Order\Invoice|\Magento\Sales\Model\Order\Creditmemo $source + * @param \Magento\Sales\Model\Order|\Magento\Sales\Model\Order\Invoice|\Magento\Sales\Model\Order\Creditmemo $source * @return array */ public function getCalculatedTaxes($source) @@ -683,9 +686,9 @@ public function getCalculatedTaxes($source) * ) * ) * - * @param array $taxClassAmount - * @param OrderTaxDetailsItemInterface $itemTaxDetail - * @param float $ratio + * @param array $taxClassAmount + * @param OrderTaxDetailsItemInterface $itemTaxDetail + * @param float $ratio * @return array */ private function _aggregateTaxes($taxClassAmount, OrderTaxDetailsItemInterface $itemTaxDetail, $ratio) @@ -709,13 +712,14 @@ private function _aggregateTaxes($taxClassAmount, OrderTaxDetailsItemInterface $ $taxClassAmount[$taxCode]['base_tax_amount'] += $baseTaxAmount; } } + return $taxClassAmount; } /** * Returns the array of tax rates for the order * - * @param \Magento\Sales\Model\Order $order + * @param \Magento\Sales\Model\Order $order * @return array */ protected function _getTaxRateSubtotals($order) @@ -752,16 +756,16 @@ public function getDefaultProductTaxClass() /** * Return whether cross border trade is enabled or not * - * @param null|int|string|Store $store - * @return bool + * @param null|int|string|Store $store + * @return bool */ public function isCrossBorderTradeEnabled($store = null) { - return (bool)$this->_config->crossBorderTradeEnabled($store); + return (bool) $this->_config->crossBorderTradeEnabled($store); } /** - * @param EntityInterface $current + * @param EntityInterface $current * @return array */ protected function calculateTaxForOrder(EntityInterface $current) @@ -777,12 +781,13 @@ protected function calculateTaxForOrder(EntityInterface $current) $taxClassAmount[$taxCode]['title'] = $appliedTax->getTitle(); $taxClassAmount[$taxCode]['percent'] = $appliedTax->getPercent(); } + return $taxClassAmount; } /** - * @param EntityInterface $order - * @param EntityInterface $salesItem + * @param EntityInterface $order + * @param EntityInterface $salesItem * @return array */ protected function calculateTaxForItems(EntityInterface $order, EntityInterface $salesItem) @@ -810,7 +815,7 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface // Apply any taxes for the items /** @var $item \Magento\Sales\Model\Order\Invoice\Item|\Magento\Sales\Model\Order\Creditmemo\Item */ - foreach ($salesItem->getItemsCollection() as $item) { + foreach ($salesItem->getItems() as $item) { $orderItem = $item->getOrderItem(); $orderItemId = $orderItem->getId(); $orderItemTax = $orderItem->getTaxAmount(); @@ -828,13 +833,17 @@ protected function calculateTaxForItems(EntityInterface $order, EntityInterface } elseif ($itemTaxDetail->getAssociatedItemId() == $orderItemId) { $taxableItemType = $itemTaxDetail->getType(); $ratio = $itemRatio; - if ($item->getTaxRatio() && isset($item->getTaxRatio()[$taxableItemType])) { - $ratio = $item->getTaxRatio()[$taxableItemType]; + if ($item->getTaxRatio()) { + $taxRatio = unserialize($item->getTaxRatio()); + if (isset($taxRatio[$taxableItemType])) { + $ratio = $taxRatio[$taxableItemType]; + } } $taxClassAmount = $this->_aggregateTaxes($taxClassAmount, $itemTaxDetail, $ratio); } } } + return $taxClassAmount; } } diff --git a/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php b/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php index 944244b0ab4c0..d871fde75bad8 100644 --- a/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php +++ b/app/code/Magento/Tax/Model/Calculation/AbstractCalculator.php @@ -160,6 +160,7 @@ public function __construct( /** * Set billing address * + * @codeCoverageIgnoreStart * @param CustomerAddress $billingAddress * @return void */ @@ -200,6 +201,7 @@ public function setCustomerId($customerId) { $this->customerId = $customerId; } + // @codeCoverageIgnoreEnd /** * Calculate tax details for quote item with given quantity diff --git a/app/code/Magento/Tax/Model/TaxRateCollection.php b/app/code/Magento/Tax/Model/TaxRateCollection.php index c33bb2f0c1412..ddb152ef3210d 100644 --- a/app/code/Magento/Tax/Model/TaxRateCollection.php +++ b/app/code/Magento/Tax/Model/TaxRateCollection.php @@ -35,9 +35,9 @@ class TaxRateCollection extends AbstractServiceCollection * @param EntityFactory $entityFactory * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder + * @param SortOrderBuilder $sortOrderBuilder * @param TaxRateRepositoryInterface $rateService * @param \Magento\Tax\Model\Calculation\Rate\Converter $rateConverter - * @param SortOrderBuilder $sortOrderBuilder */ public function __construct( EntityFactory $entityFactory, diff --git a/app/code/Magento/Tax/Model/TaxRuleCollection.php b/app/code/Magento/Tax/Model/TaxRuleCollection.php index b47797af4d86e..0e95e9f78d811 100644 --- a/app/code/Magento/Tax/Model/TaxRuleCollection.php +++ b/app/code/Magento/Tax/Model/TaxRuleCollection.php @@ -29,8 +29,8 @@ class TaxRuleCollection extends AbstractServiceCollection * @param EntityFactory $entityFactory * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder - * @param TaxRuleRepositoryInterface $ruleService * @param SortOrderBuilder $sortOrderBuilder + * @param TaxRuleRepositoryInterface $ruleService */ public function __construct( EntityFactory $entityFactory, diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index 2d23a1282b800..1cc1ae2c1c93e 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -3,22 +3,22 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-reports": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-reports": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index b8869f3e5d112..fcc2dc7de627d 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -3,15 +3,15 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php index 239dbf69718f7..469630e6a7b61 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme.php @@ -23,7 +23,7 @@ public function _construct() $this->getLayout()->getBlock('page-title')->setPageTitle('Themes'); } - $this->buttonList->update('add', 'label', __('Add New Theme')); + $this->buttonList->remove('add'); } /** diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 0f3c6e2062839..2aec9c687ed28 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-require-js": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-require-js": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-translation": "0.1.0-alpha107" + "magento/module-translation": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml b/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml index 13298d49f39d8..10a6fd1622d98 100644 --- a/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/html/topmenu.phtml @@ -12,10 +12,9 @@ ?> getColumnsLimit() ?: 0; ?> getHtml('level-top', 'submenu', $columnsLimit) ?> - + - diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index 2849dd2623859..a9d1c7cad17c2 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-core": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-core": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/DataProvider/Config/Converter.php b/app/code/Magento/Ui/DataProvider/Config/Converter.php index 08d8b167b096b..f9de00aa191be 100644 --- a/app/code/Magento/Ui/DataProvider/Config/Converter.php +++ b/app/code/Magento/Ui/DataProvider/Config/Converter.php @@ -26,7 +26,7 @@ class Converter implements ConverterInterface 'text' => 'input', 'textarea' => 'textarea', 'multiline' => 'input', - 'date' => 'input', + 'date' => 'date', 'select' => 'select', 'multiselect' => 'multiselect', 'boolean' => 'select', diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index 245631abc35ba..e89e925a69078 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -3,14 +3,14 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Ui/view/base/layout/ui_components.xml b/app/code/Magento/Ui/view/base/layout/ui_components.xml index befa97ceabc7e..4259756180edd 100644 --- a/app/code/Magento/Ui/view/base/layout/ui_components.xml +++ b/app/code/Magento/Ui/view/base/layout/ui_components.xml @@ -92,6 +92,17 @@ + + + + Magento_Ui/js/form/element/multiselect + + multiselect + ui/form/element/multiselect + + + + diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js index 4c259b1938443..02630769a7d82 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/components/types.js @@ -15,6 +15,8 @@ define([ this.types = {}; this.set(types); + + return this; }, set: function(types){ diff --git a/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js b/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js index cb5a231e8563d..023fcf3bda0b5 100644 --- a/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js +++ b/app/code/Magento/Ui/view/base/web/js/core/renderer/renderer.js @@ -12,6 +12,8 @@ define([ initialize: function(data){ this.types = new Types(data.types); this.layout = new Layout(data.layout, this.types); + + return this; }, render: function(data){ diff --git a/app/code/Magento/Ui/view/base/web/js/form.js b/app/code/Magento/Ui/view/base/web/js/form.js index 4fabc0e7999d8..2f4c262c956e8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form.js +++ b/app/code/Magento/Ui/view/base/web/js/form.js @@ -2,14 +2,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ + 'underscore', 'Magento_Ui/js/form/component', 'Magento_Ui/js/lib/spinner', './form/adapter' -], function (Component, loader, adapter) { +], function (_, Component, loader, adapter) { 'use strict'; - var __super__ = Component.prototype; - function collectData(selector){ var items = document.querySelectorAll(selector), result = {}; @@ -26,11 +25,12 @@ define([ return Component.extend({ initialize: function(){ - __super__.initialize.apply(this, arguments); - - this.initAdapter() + this._super() + .initAdapter() .initSelector() .hideLoader(); + + return this; }, initAdapter: function(){ diff --git a/app/code/Magento/Ui/view/base/web/js/form/client.js b/app/code/Magento/Ui/view/base/web/js/form/client.js index ef2917fdea29c..0f14d56053bf7 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/client.js +++ b/app/code/Magento/Ui/view/base/web/js/form/client.js @@ -47,6 +47,8 @@ define([ */ initialize: function(config) { _.extend(this, defaults, config); + + return this; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/component.js b/app/code/Magento/Ui/view/base/web/js/form/component.js index 4ff4518146b83..1387ff258148b 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/component.js +++ b/app/code/Magento/Ui/view/base/web/js/form/component.js @@ -74,7 +74,9 @@ define([ this.initProperties() .initObservable() .initListeners() - .initUnique() + .initUnique(); + + return this; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/area.js b/app/code/Magento/Ui/view/base/web/js/form/components/area.js index cc5416c74285f..cd8e9f9391461 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/area.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/area.js @@ -7,27 +7,22 @@ define([ ], function(_, Tab) { 'use strict'; - var defaults = { - uniqueNs: 'activeArea', - template: 'ui/area', - changed: false, - loading: false - }; - - var __super__ = Tab.prototype; - return Tab.extend({ + defaults: { + uniqueNs: 'activeArea', + template: 'ui/area', + changed: false, + loading: false + }, /** * Extends instance with defaults. Invokes parent initialize method. * Calls initListeners and pushParams methods. */ initialize: function() { - _.extend(this, defaults); - _.bindAll(this, 'onChildrenUpdate', 'onContentLoading', 'onContentLoaded'); - __super__.initialize.apply(this, arguments); + return this._super(); }, /** @@ -36,9 +31,8 @@ define([ * @return {Object} - reference to instance */ initObservable: function() { - __super__.initObservable.apply(this, arguments); - - this.observe('changed loading'); + this._super() + .observe('changed loading'); return this; }, @@ -50,7 +44,7 @@ define([ * @return {Object} - reference to instance */ initElement: function(elem){ - __super__.initElement.apply(this, arguments); + this._super(); elem.on({ 'update': this.onChildrenUpdate, diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js b/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js index 13ac50f8aa4a3..642a7d2bc5915 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collapsible.js @@ -2,27 +2,14 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - 'underscore', 'Magento_Ui/js/form/component' -], function(_, Component) { +], function(Component) { 'use strict'; - var defaults = { - collapsible: false, - opened: true - }; - - var __super__ = Component.prototype; - return Component.extend({ - - /** - * Merges 'defaults' to instance, calls 'initialize' of parent - */ - initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); + defaults: { + collapsible: false, + opened: true }, /** @@ -31,9 +18,8 @@ define([ * @return {Object} - reference to instance */ initObservable: function(){ - __super__.initObservable.apply(this, arguments); - - this.observe('opened'); + this._super() + .observe('opened'); return this; }, diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collection.js b/app/code/Magento/Ui/view/base/web/js/form/components/collection.js index d99f30520030f..54c3f017480a8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collection.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collection.js @@ -2,20 +2,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ + 'underscore', 'mage/utils', + 'Magento_Ui/js/lib/registry/registry', 'Magento_Ui/js/form/component', - 'underscore', - 'Magento_Ui/js/lib/registry/registry' -], function (utils, Component, _, registry) { +], function (_, utils, registry, Component) { 'use strict'; - var __super__ = Component.prototype; - - var defaults = { - lastIndex: 0, - template: 'ui/form/components/collection' - }; - var childTemplate = { template: "{name}.{itemTemplate}", parent: "{name}", @@ -24,17 +17,20 @@ define([ }; return Component.extend({ + defaults: { + lastIndex: 0, + template: 'ui/form/components/collection' + }, /** * Extends instance with default config, calls initialize of parent * class, calls initChildren method. */ initialize: function () { - _.extend(this, defaults); + this._super() + .initChildren(); - __super__.initialize.apply(this, arguments); - - this.initChildren(); + return this; }, /** @@ -42,12 +38,14 @@ define([ * * @param {Object} elem - Incoming child. */ - initElement: function (elem) { - __super__.initElement.apply(this, arguments); + initElement: function(elem) { + this._super(); elem.activate(); this.trigger('update'); + + return this; }, /** @@ -56,19 +54,18 @@ define([ * * @returns {Collection} Chainable. */ - initChildren: function () { + initChildren: function() { var data = this.provider.data, children = data.get(this.dataScope), initial = this.initialItems = []; - - _.each(children, function(item, index){ + + _.each(children, function(item, index) { initial.push(index); this.addChild(index); }, this); return this; }, - /** * Creates new item of collection, based on incoming 'index'. * If not passed creates one with 'new_' prefix. diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js b/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js index 8178efb00563a..84874211d8ea0 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/collection/item.js @@ -2,27 +2,17 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - '../tab', 'underscore', - 'mage/utils' -], function (Tab, _, utils) { + 'mage/utils', + '../tab' +], function (_, utils, Tab) { 'use strict'; - var defaults = { - template: 'ui/form/components/collection/item', - displayArea: 'body', - label: '', - uniqueNs: 'activeCollectionItem', - previewTpl: 'ui/form/components/collection/preview' - }; - var previewConfig = { separator: ' ', prefix: '' }; - var __super__ = Tab.prototype; - /** * Parses incoming data and returnes result merged with default preview config * @@ -42,16 +32,20 @@ define([ } return Tab.extend({ + defaults: { + template: 'ui/form/components/collection/item', + label: '', + uniqueNs: 'activeCollectionItem', + previewTpl: 'ui/form/components/collection/preview' + }, /** * Extends instance with default config, calls initializes of parent class */ initialize: function () { - _.extend(this, defaults); - _.bindAll(this, 'buildPreview', 'hasPreview'); - __super__.initialize.apply(this, arguments); + return this._super(); }, /** @@ -61,7 +55,7 @@ define([ * @return {Object} - reference to instance */ initProperties: function () { - __super__.initProperties.apply(this, arguments); + this._super(); this.displayed = []; @@ -77,7 +71,7 @@ define([ * @return {Object} - reference to instance */ initObservable: function () { - __super__.initObservable.apply(this, arguments); + this._super(); this.observe({ 'noPreview': true, @@ -95,9 +89,10 @@ define([ * @param {Object} elem */ initElement: function (elem) { - __super__.initElement.apply(this, arguments); + this._super() + .insertToIndexed(elem); - this.insertToIndexed(elem); + return this; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js index 4eb1fb139142f..7414584470629 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/fieldset.js @@ -2,27 +2,13 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - 'underscore', './collapsible' -], function(_, Collapsible) { +], function(Collapsible) { 'use strict'; - var defaults = { - template: 'ui/fieldset/fieldset' - }; - - var __super__ = Collapsible.prototype; - return Collapsible.extend({ - - /** - * Extends instance with default config, binds required methods - * to instance, calls initialize method of parent class. - */ - initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); + defaults: { + template: 'ui/fieldset/fieldset' } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/group.js b/app/code/Magento/Ui/view/base/web/js/form/components/group.js index 61300a431a61c..650dfc3321056 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/group.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/group.js @@ -7,18 +7,7 @@ define([ 'mage/utils' ], function(_, Component, utils) { 'use strict'; - - var defaults = { - hidden: false, - label: '', - required: false, - template: 'ui/group/group', - fieldTemplate: 'ui/group/field', - breakLine: true - }; - - var __super__ = Component.prototype; - + function extractData(container, field){ var data, value; @@ -37,6 +26,14 @@ define([ } return Component.extend({ + defaults: { + hidden: false, + label: '', + required: false, + template: 'ui/group/group', + fieldTemplate: 'ui/group/field', + breakLine: true + }, /** * Extends this with defaults and config. @@ -44,12 +41,10 @@ define([ * * @param {Object} config */ - initialize: function() { - _.extend(this, defaults); - + initialize: function() { _.bindAll(this, 'toggle'); - __super__.initialize.apply(this, arguments); + return this._super(); }, /** @@ -59,9 +54,10 @@ define([ * @return {Object} - reference to instance */ initObservable: function(){ - __super__.initObservable.apply(this, arguments); + this._super() + .observe('hidden label required'); - return this.observe('hidden label required'); + return this; }, /** @@ -71,7 +67,7 @@ define([ * @return {Object} - reference to instance */ initElement: function(elem){ - __super__.initElement.apply(this, arguments); + this._super(); elem.on({ 'toggle': this.toggle diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/html.js b/app/code/Magento/Ui/view/base/web/js/form/components/html.js index a1c45636cf5d2..7700d79cab5e8 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/html.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/html.js @@ -8,29 +8,25 @@ define([ ], function($, _, Component) { 'use strict'; - var defaults = { - content: '', - showSpinner: false, - loading: false, - template: 'ui/content/content' - }; - - var __super__ = Component.prototype; - return Component.extend({ + defaults: { + content: '', + showSpinner: false, + loading: false, + template: 'ui/content/content' + }, /** * Extends instance with default config, calls 'initialize' method of * parent, calls 'initAjaxConfig' */ initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); - _.bindAll(this, 'onContainerToggle', 'onDataLoaded'); - this.initAjaxConfig(); + this._super() + .initAjaxConfig(); + + return this; }, /** @@ -39,10 +35,9 @@ define([ * * @return {Object} - reference to instance */ - initObservable: function(){ - __super__.initObservable.apply(this, arguments); - - this.observe('content loading'); + initObservable: function() { + this._super() + .observe('content loading'); return this; }, @@ -52,18 +47,18 @@ define([ * * @return {Object} - reference to instance */ - initListeners: function () { - __super__.initListeners.apply(this, arguments); + initListeners: function() { + this._super(); - this.loading.subscribe(function(value){ + this.loading.subscribe(function(value) { this.trigger(value ? 'loading' : 'loaded'); }, this); return this; }, - initContainer: function(parent){ - __super__.initContainer.apply(this, arguments); + initContainer: function(parent) { + this._super(); parent.on('active', this.onContainerToggle); @@ -91,8 +86,8 @@ define([ * * @param {Boolean} active */ - onContainerToggle: function(active){ - if(active && this.shouldLoad()){ + onContainerToggle: function(active) { + if (active && this.shouldLoad()) { this.loadData(); } }, @@ -102,7 +97,7 @@ define([ * * @return {Boolean} [description] */ - hasData: function(){ + hasData: function() { return !!this.content(); }, @@ -111,7 +106,7 @@ define([ * * @return {Boolean} */ - shouldLoad: function(){ + shouldLoad: function() { return this.source && !this.hasData() && !this.loading(); }, @@ -120,7 +115,7 @@ define([ * * @return {Object} - reference to instance */ - loadData: function(){ + loadData: function() { this.loading(true); $.ajax(this.ajaxConfig); @@ -134,9 +129,9 @@ define([ * * @param {String} data */ - onDataLoaded: function(data){ + onDataLoaded: function(data) { this.updateContent(data) - .loading(false); + .loading(false); }, /** @@ -145,7 +140,7 @@ define([ * @param {String} content * @return {Object} - reference to instance */ - updateContent: function(content){ + updateContent: function(content) { this.content(content); return this; diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/tab.js b/app/code/Magento/Ui/view/base/web/js/form/components/tab.js index cccf9bc1f8cc2..cfe3ddc938905 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/tab.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/tab.js @@ -2,31 +2,24 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ - 'underscore', '../component' -], function(_, Component) { +], function(Component) { 'use strict'; - var defaults = { - uniqueProp: 'active', - active: false, - wasActivated: false - }; - - var __super__ = Component.prototype; - return Component.extend({ + defaults: { + uniqueProp: 'active', + active: false, + wasActivated: false + }, /** * Extends instance with defaults. Invokes parent initialize method. * Calls initListeners and pushParams methods. */ initialize: function() { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); - - this.setUnique(); + this._super() + .setUnique(); }, /** @@ -35,9 +28,8 @@ define([ * @return {Object} - reference to instance */ initObservable: function() { - __super__.initObservable.apply(this, arguments); - - this.observe('active wasActivated'); + this._super() + .observe('active wasActivated'); return this; }, @@ -45,7 +37,7 @@ define([ onUniqueUpdate: function(name){ var active = name === this.name; - __super__.onUniqueUpdate.apply(this, arguments); + this._super(); this.trigger('active', active); }, diff --git a/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js b/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js index 86582276b46a5..831d0e84982be 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js +++ b/app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js @@ -2,13 +2,12 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ define([ + 'underscore', './collapsible', 'Magento_Ui/js/lib/spinner' -], function(Collapsible, loader) { +], function(_, Collapsible, loader) { 'use strict'; - var __super__ = Collapsible.prototype; - return Collapsible.extend({ /** @@ -18,9 +17,8 @@ define([ * @returns {Object} - reference to instance */ initElement: function(elem){ - __super__.initElement.apply(this, arguments); - - this.initActivation(elem) + this._super() + .initActivation(elem) .hideLoader(); return this; @@ -35,7 +33,7 @@ define([ var data = this.provider.data, handler = this.onValidate.bind(this); - __super__.initListeners.apply(this, arguments); + this._super(); data.on('validate', handler, this.name); @@ -45,8 +43,9 @@ define([ /** * Activates element if one is first or if one has 'active' propert * set to true. + * * @param {Object} elem - * @return {Object} - reference to instance + * @returns {Object} - reference to instance */ initActivation: function(elem){ var elems = this.elems(), @@ -68,6 +67,7 @@ define([ * of params storage, and if defined, activates element, sets * 'allValid' property of instance to false and sets invalid's * 'focused' property to true. + * * @param {Object} elem */ validate: function(elem){ diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js index a09d7fe8ed96c..553df7c5a7f38 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/abstract.js @@ -8,28 +8,34 @@ define([ 'Magento_Ui/js/lib/validation/validator' ], function (_, utils, Component, validator) { 'use strict'; - - var defaults = { - hidden: false, - preview: '', - focused: false, - tooltip: null, - required: false, - disabled: false, - tmpPath: 'ui/form/element/', - tooltipTpl: 'ui/form/element/helper/tooltip', - input_type: 'input', - placeholder: null, - noticeid: null, - description: '', - label: '', - error: '', - notice: null - }; - - var __super__ = Component.prototype; + + /** + * Checks wether the incoming value is not empty, + * e.g. not 'null' or 'undefined' + * + * @param {*} value - Value to check. + * @returns {Boolean} + */ + function isEmpty(value){ + return _.isUndefined(value) || _.isNull(value); + } return Component.extend({ + defaults: { + hidden: false, + preview: '', + focused: false, + required: false, + disabled: false, + tmpPath: 'ui/form/element/', + tooltipTpl: 'ui/form/element/helper/tooltip', + input_type: 'input', + placeholder: '', + description: '', + label: '', + error: '', + notice: '' + }, /** * Invokes initialize method of parent class, contains initialization @@ -38,14 +44,13 @@ define([ * @param {Object} config - form element configuration */ initialize: function () { - _.extend(this, defaults); - _.bindAll(this, 'onUpdate', 'reset'); - __super__.initialize.apply(this, arguments); - - this.setHidden(this.hidden()) + this._super() + .setHidden(this.hidden()) .store(this.value()); + + return this; }, /** @@ -54,18 +59,15 @@ define([ * @returns {Abstract} Chainable. */ initObservable: function () { - var value = this.getInititalValue(), - rules; - - __super__.initObservable.apply(this, arguments); + var rules = this.validation = this.validation || {}; - rules = this.validation = this.validation || {}; + this._super(); - this.initialValue = value; + this.initialValue = this.getInititalValue(); this.observe('error disabled focused preview hidden') .observe({ - 'value': value, + 'value': this.initialValue, 'required': !!rules['required-entry'] }); @@ -78,11 +80,14 @@ define([ * @returns {Abstract} Chainable. */ initProperties: function () { - __super__.initProperties.apply(this, arguments); + var uid = utils.uniqueid(); + + this._super(); _.extend(this, { - 'uid': utils.uniqueid(), - 'inputName': utils.serializeName(this.dataScope) + 'uid': uid, + 'noticeId': 'notice-' + this.uid, + 'inputName': utils.serializeName(this.dataScope) }); _.defaults(this, { @@ -101,7 +106,7 @@ define([ var provider = this.provider, data = provider.data; - __super__.initListeners.apply(this, arguments); + this._super(); data.on('reset', this.reset, this.name); @@ -117,22 +122,14 @@ define([ */ getInititalValue: function(){ var data = this.provider.data, - value = data.get(this.dataScope); - - if(_.isUndefined(value) || _.isNull(value)){ - value = ''; - } + values = [data.get(this.dataScope), this.default], + value; - return value; - }, + values.some(function(v){ + return !isEmpty(value = v); + }); - /** - * Defines notice id for the element. - * - * @returns {String} Notice id. - */ - getNoticeId: function () { - return 'notice-' + this.uid; + return isEmpty(value) ? '': value; }, /** @@ -262,6 +259,6 @@ define([ .trigger('update', this.hasChanged()); this.validate(); - }, + } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js index 43b6f531b89f7..895d0b95f522a 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/boolean.js @@ -6,8 +6,6 @@ define([ ], function (Abstract) { 'use strict'; - var __super__ = Abstract.prototype; - return Abstract.extend({ /** * Converts the result of parent 'getInitialValue' call to boolean @@ -15,9 +13,7 @@ define([ * @return {Boolean} */ getInititalValue: function(){ - var value = __super__.getInititalValue.apply(this, arguments); - - return !!+value; + return !!+this._super(); }, /** @@ -28,7 +24,7 @@ define([ * @return {Object} - reference to instance */ store: function() { - __super__.store.apply(this, arguments); + this._super(); if (this.hasUnique) { this.setUnique(); diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js index 24299eb448b4a..4341e01143506 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/multiselect.js @@ -8,23 +8,15 @@ define([ ], function (_, utils, Select) { 'use strict'; - var defaults = { - size: 5, - template: 'ui/form/element/multiselect' - }; - - var __super__ = Select.prototype; - return Select.extend({ + defaults: { + size: 5 + }, - /** - * Extends instance with defaults, extends config with formatted values - * and options, and invokes initialize method of AbstractElement class. - */ - initialize: function () { - _.extend(this, defaults); - - __super__.initialize.apply(this, arguments); + getInititalValue: function(){ + var value = __super__.getInititalValue.apply(this, arguments); + + return _.isString(value) ? value.split(',') : value; }, /** diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/select.js b/app/code/Magento/Ui/view/base/web/js/form/element/select.js index 0dc58cf2fc48e..9622115017dfd 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/select.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/select.js @@ -8,12 +8,6 @@ define([ ], function (_, utils, Abstract) { 'use strict'; - var defaults = { - template: 'ui/form/element/select' - }; - - var __super__ = Abstract.prototype; - var inputNode = { name: '{index}_input', type: 'input', @@ -87,6 +81,9 @@ define([ } return Abstract.extend({ + defaults: { + template: 'ui/form/element/select' + }, /** * Extends instance with defaults, extends config with formatted values @@ -94,15 +91,14 @@ define([ * If instance's 'customEntry' property is set to true, calls 'initInput' */ initialize: function (config) { - _.extend(this, defaults); - - this.initOptions(config); - - __super__.initialize.apply(this, arguments); + this.initOptions(config) + ._super(); if(this.customEntry){ this.initInput(); } + + return this; }, /** @@ -112,7 +108,7 @@ define([ * @returns {Select} Chainable. */ initObservable: function(){ - __super__.initObservable.apply(this, arguments); + this._super(); this.initialOptions = this.options; @@ -158,7 +154,7 @@ define([ * @returns {Number|String} */ getInititalValue: function(){ - var value = __super__.getInititalValue.apply(this, arguments); + var value = this._super(); if(value !== ''){ return value; diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js b/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js index d446d7270550b..3c85f544b1421 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/textarea.js @@ -6,21 +6,11 @@ define([ ], function (Abstract) { 'use strict'; - var defaults = { - cols: 15, - rows: 2, - template: 'ui/form/element/textarea' - }; - return Abstract.extend({ - - /** - * Invokes initialize method of parent class. - */ - initialize: function (config) { - _.extend(this, defaults); - - Abstract.prototype.initialize.apply(this, arguments); + defaults: { + cols: 15, + rows: 2, + template: 'ui/form/element/textarea' } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/js/lib/class.js b/app/code/Magento/Ui/view/base/web/js/lib/class.js index a5d741608e854..5d43b55d5bde9 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/class.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/class.js @@ -6,38 +6,89 @@ define([ ], function(_) { 'use strict'; + var superReg = /\b_super\b/; + + /** + * Checks wether the incoming method contains calls of the '_super' property. + * + * @param {Function} method - Method to be checked. + * @returns {Boolean} + */ + function hasSuper(method){ + return _.isFunction(method) && superReg.test(method); + } + + /** + * Wraps the incoming method to implement support of the '_super' method. + * + * @param {Object} parent - Reference to parents' prototype. + * @param {String} name - Name of the method. + * @param {Function} method - Method to be wrapped. + * @returns {Function} Wrapped method. + */ + function superWrapper(parent, name, method){ + return function(){ + var superTmp = this._super, + args = arguments, + result; + + this._super = function(){ + var superArgs = arguments.length ? arguments : args; + + return parent[name].apply(this, superArgs); + }; + + result = method.apply(this, args); + + this._super = superTmp; + + return result; + } + } + /** * Analogue of Backbone.extend function. - * @param {Object} protoProps - object, that describes the prototype of - * created constructor. - * @return {Function} - new constructor + * + * @param {Object} extender - + * Object, that describes the prototype of + * created constructor. + * @param {...Object} Multiple amount of mixins. + * @returns {Function} New constructor. */ - function extend( protoProps ){ - var parent = this, + function extend(extender){ + var parent = this, + parentProto = parent.prototype, + defaults = extender.defaults || {}, child, - args, - hasConstructor; + childProto, + mixins; - protoProps = protoProps || {}; - hasConstructor = protoProps.hasOwnProperty('constructor'); + child = function(){ + _.defaults(this, defaults); - child = hasConstructor ? - protoProps.constructor : - function() { - return parent.apply(this, arguments); - }; + parent.apply(this, arguments); + }; + + delete extender.defaults; + + childProto = child.prototype = Object.create(parentProto); - child.prototype = Object.create( parent.prototype ); - child.prototype.constructor = child; + childProto.constructor = child; - args = [child.prototype]; + _.each(extender, function(method, name){ + childProto[name] = hasSuper(method) ? + superWrapper(parentProto, name, method) : + method; + }); - args.push.apply(args, arguments); + mixins = _.toArray(arguments).slice(1); - _.extend.apply(_, args); + mixins.forEach(function(mixin){ + _.extend(childProto, mixin); + }); - child.extend = extend; - child.__super__ = parent.prototype; + child.__super__ = parentProto; + child.extend = extend; return child; } diff --git a/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js b/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js index 81138a56f2fbf..17903b02635b7 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/ko/scope.js @@ -57,12 +57,6 @@ define([ return this; }, - compute: function (path, defs) { - this[path] = ko.computed(defs); - - return this; - }, - /** * Reads it's params from provider and stores it into its params object * @return {Object} reference to instance @@ -104,18 +98,6 @@ define([ reload: function() { this.pushParams() .provider.refresh(); - }, - - updateObservable: function (defs) { - var field; - - _.each(defs, function (value, key) { - field = this[key]; - - if (ko.isObservable(field)) { - field(value); - } - }, this); } }); }); \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html index 2e9e1150f5ced..e12267216a5ad 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/checkbox.html @@ -16,6 +16,6 @@ -
    +
    \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/date.html b/app/code/Magento/Ui/view/base/web/templates/form/element/date.html index 12c98400d84b8..2f15cb8f30941 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/date.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/date.html @@ -10,6 +10,6 @@ value: value, name: inputName, placeholder: placeholder, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, disabled: disabled }" /> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/email.html b/app/code/Magento/Ui/view/base/web/templates/form/element/email.html index 714bddc3fe94e..6bd0a7e98c600 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/email.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/email.html @@ -9,7 +9,7 @@ attr: { name: inputName, placeholder: placeholder, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, id: uid, disabled: disabled }"/> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/input.html b/app/code/Magento/Ui/view/base/web/templates/form/element/input.html index aca1ef2e9362d..9b9589278ce94 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/input.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/input.html @@ -9,7 +9,7 @@ attr: { name: inputName, placeholder: placeholder, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, id: uid, disabled: disabled }" /> \ No newline at end of file diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/media.html b/app/code/Magento/Ui/view/base/web/templates/form/element/media.html index dd98e90468139..87b5bfe9d4b1c 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/media.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/media.html @@ -8,7 +8,7 @@ attr: { name: inputName, id: uid, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, disabled: disabled }, hasFocus: focused" diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html b/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html index dc9c313aa86a2..12bd338a57b59 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/multiselect.html @@ -9,7 +9,7 @@ id: uid, size: size, disabled: disabled, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, placeholder: placeholder }, hasFocus: focused, diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/select.html b/app/code/Magento/Ui/view/base/web/templates/form/element/select.html index e3aa654a1df95..d8502f82ff290 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/select.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/select.html @@ -8,7 +8,7 @@ name: inputName, id: uid, disabled: disabled, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, placeholder: placeholder }, hasFocus: focused, diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html b/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html index 31347b346a230..d10a8703ac74a 100644 --- a/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html +++ b/app/code/Magento/Ui/view/base/web/templates/form/element/textarea.html @@ -10,7 +10,7 @@ name: inputName, cols: cols, rows: rows, - 'aria-describedby': noticeid, + 'aria-describedby': noticeId, placeholder: placeholder, id: uid }" diff --git a/app/code/Magento/Ui/view/base/web/templates/group/field.html b/app/code/Magento/Ui/view/base/web/templates/group/field.html index ae890464e9607..a43266bb8031d 100644 --- a/app/code/Magento/Ui/view/base/web/templates/group/field.html +++ b/app/code/Magento/Ui/view/base/web/templates/group/field.html @@ -35,7 +35,7 @@ -
    +
    diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 6b72c10d40d7f..86a2f8b5bb2f7 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -249,7 +249,7 @@ public function setRequest(RateRequest $request) ); } - $rowRequest->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getIso2Code()); + $rowRequest->setOrigCountry($this->_countryFactory->create()->load($origCountry)->getData('iso2_code')); if ($request->getOrigRegionCode()) { $origRegionCode = $request->getOrigRegionCode(); @@ -307,7 +307,7 @@ public function setRequest(RateRequest $request) $destCountry = self::GUAM_COUNTRY_ID; } - $rowRequest->setDestCountry($this->_countryFactory->create()->load($destCountry)->getIso2Code()); + $rowRequest->setDestCountry($this->_countryFactory->create()->load($destCountry)->getData('iso2_code')); $rowRequest->setDestRegionCode($request->getDestRegionCode()); diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index e57b8f880b519..c1370e7426f6f 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index 1a6e0d2391e48..9674b31b22ecb 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog-url-rewrite": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-cms-url-rewrite": "0.1.0-alpha107", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog-url-rewrite": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-cms-url-rewrite": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Save.php b/app/code/Magento/User/Controller/Adminhtml/User/Save.php index df41a697c17e3..048bf50ddba33 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Save.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Save.php @@ -62,8 +62,11 @@ public function execute() $this->_redirect('adminhtml/*/'); } catch (\Magento\Framework\Model\Exception $e) { $this->messageManager->addMessages($e->getMessages()); - if ($e->getMessage()) { - $this->messageManager->addError($e->getMessage()); + $messages = $e->getMessages(); + if (empty($messages)) { + if ($e->getMessage()) { + $this->messageManager->addError($e->getMessage()); + } } $this->_getSession()->setUserData($data); $arguments = $model->getId() ? ['user_id' => $model->getId()] : []; diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index cb32db654f251..d0ee6d7f45794 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-integration": "0.1.0-alpha107", - "magento/module-store": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-require-js": "0.1.0-alpha107", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-integration": "0.1.0-alpha108", + "magento/module-store": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-require-js": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Usps/Model/Carrier.php b/app/code/Magento/Usps/Model/Carrier.php index 14b501c6e3180..d6aebb495fcf7 100644 --- a/app/code/Magento/Usps/Model/Carrier.php +++ b/app/code/Magento/Usps/Model/Carrier.php @@ -59,14 +59,6 @@ class Carrier extends AbstractCarrierOnline implements \Magento\Shipping\Model\C */ protected $_code = self::CODE; - /** - * Destination Zip Code required flag - * - * @var boolean - * @deprecated since 1.7.0 functionality implemented in \Magento\Shipping\Model\Carrier\AbstractCarrierOnline - */ - protected $_isZipCodeRequired; - /** * Rate request data * diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index ebef2f7cd1f65..8424859cebbe6 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-shipping": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-shipping": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "lib-libxml": "*", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Hierarchy/Edit/Form.php b/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Hierarchy/Edit/Form.php index 925178932e5cf..8997d621d90f1 100644 --- a/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Hierarchy/Edit/Form.php +++ b/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Hierarchy/Edit/Form.php @@ -680,7 +680,7 @@ protected function _getStore() if (!$store) { $store = $this->_storeManager->getDefaultStoreView(); if (!$store) { - foreach ($this->getStores() as $store) { + foreach ($this->_storeManager->getStores() as $store) { return $store; } } diff --git a/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Page/Revision/Edit.php b/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Page/Revision/Edit.php index bd4af39817238..0a9fec5132591 100644 --- a/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Page/Revision/Edit.php +++ b/app/code/Magento/VersionsCms/Block/Adminhtml/Cms/Page/Revision/Edit.php @@ -179,7 +179,10 @@ function newVersionAction(e){ $this->removeButton('save'); $this->removeButton('saveandcontinue'); } - + $pageMainTitle = $this->getLayout()->getBlock('page-title'); + if ($pageMainTitle) { + $pageMainTitle->setPageTitle($this->getHeaderText()); + } return $this; } diff --git a/app/code/Magento/VersionsCms/composer.json b/app/code/Magento/VersionsCms/composer.json index 3891071fc6e15..d8f80629a7fe6 100644 --- a/app/code/Magento/VersionsCms/composer.json +++ b/app/code/Magento/VersionsCms/composer.json @@ -3,18 +3,18 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-widget": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-user": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-widget": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-user": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/VersionsCms/view/adminhtml/templates/page/revision/info.phtml b/app/code/Magento/VersionsCms/view/adminhtml/templates/page/revision/info.phtml index 4127c465c2152..bd449e89efc74 100644 --- a/app/code/Magento/VersionsCms/view/adminhtml/templates/page/revision/info.phtml +++ b/app/code/Magento/VersionsCms/view/adminhtml/templates/page/revision/info.phtml @@ -10,28 +10,29 @@ */ ?>
    - - - - - getRevisionNumber()): ?> - - - - - - - - - - - - - - - - - - -
    getRevisionNumber() ?>
    getAuthor() ?>
    getCreatedAt() ?>
    escapeHtml($this->getVersionLabel()) ?>
    +
    +
    + + getRevisionNumber()): ?> + getRevisionNumber() ?> + + + + +
    + + + + + + + + + + + + + +
    getAuthor() ?>
    getCreatedAt() ?>
    escapeHtml($this->getVersionLabel()) ?>
    +
    diff --git a/app/code/Magento/VersionsCms/view/adminhtml/templates/page/version/form.phtml b/app/code/Magento/VersionsCms/view/adminhtml/templates/page/version/form.phtml index 8f7978d4bce6e..d5a34d5180a6d 100644 --- a/app/code/Magento/VersionsCms/view/adminhtml/templates/page/version/form.phtml +++ b/app/code/Magento/VersionsCms/view/adminhtml/templates/page/version/form.phtml @@ -8,14 +8,15 @@ /* @var $this \Magento\Cms\Block\Adminhtml\Page\Edit\Form */ ?> -
    +
    getFormHtml() ?>
    -
    -
    -

    -
    -
    - getParentBlock()->getChildHtml('cms_page_version_edit_revisions_grid') ?> + +
    +
    + + +
    + getParentBlock()->getChildHtml('cms_page_version_edit_revisions_grid') ?>
    diff --git a/app/code/Magento/Webapi/Controller/Request.php b/app/code/Magento/Webapi/Controller/Request.php index ac433b51fc23b..ca37b0b20007d 100644 --- a/app/code/Magento/Webapi/Controller/Request.php +++ b/app/code/Magento/Webapi/Controller/Request.php @@ -51,4 +51,22 @@ public function getCookie($name = null, $default = null) { return $this->_cookieReader->getCookie($name, $default); } + + /** + * {@inheritdoc} + * + * Added CGI environment support. + */ + public function getHeader($header) + { + $headerValue = parent::getHeader($header); + if ($headerValue == false) { + /** Workaround for php-fpm environment */ + $header = strtoupper(str_replace('-', '_', $header)); + if (isset($_SERVER[$header]) && in_array($header, ['CONTENT_TYPE', 'CONTENT_LENGTH'])) { + $headerValue = $_SERVER[$header]; + } + } + return $headerValue; + } } diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index 25fc9a05d73dc..ddd77845a7a70 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -3,19 +3,19 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-authorization": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-integration": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-authorization": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-integration": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-user": "0.1.0-alpha107" + "magento/module-user": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/WebsiteRestriction/Model/Restrictor.php b/app/code/Magento/WebsiteRestriction/Model/Restrictor.php index 5f5410fdb85b8..3ec7e2c8583cc 100644 --- a/app/code/Magento/WebsiteRestriction/Model/Restrictor.php +++ b/app/code/Magento/WebsiteRestriction/Model/Restrictor.php @@ -15,9 +15,9 @@ class Restrictor protected $_config; /** - * @var \Magento\Framework\UrlInterface + * @var \Magento\Framework\UrlFactory */ - protected $_url; + protected $_urlFactory; /** * @var \Magento\Framework\App\ActionFlag @@ -75,7 +75,7 @@ public function __construct( $this->_customerSession = $customerSession; $this->_session = $session; $this->_scopeConfig = $scopeConfig; - $this->_url = $urlFactory; + $this->_urlFactory = $urlFactory; $this->_actionFlag = $actionFlag; } @@ -134,11 +134,11 @@ public function restrict($request, $response, $isCustomerLoggedIn) || $request->getFullActionName() === $cmsPageViewAction && $request->getAlias('rewrite_request_path') !== $pageIdentifier ) { - $redirectUrl = $this->_url->getUrl('', ['_direct' => $pageIdentifier]); + $redirectUrl = $this->_urlFactory->create()->getUrl('', ['_direct' => $pageIdentifier]); } } elseif (!in_array($request->getFullActionName(), $allowedActionNames)) { // to login form - $redirectUrl = $this->_url->getUrl('customer/account/login'); + $redirectUrl = $this->_urlFactory->create()->getUrl('customer/account/login'); } if ($redirectUrl) { @@ -152,7 +152,7 @@ public function restrict($request, $response, $isCustomerLoggedIn) if ($redirectToDashboard) { $afterLoginUrl = $this->customerUrl->getDashboardUrl(); } else { - $afterLoginUrl = $this->_url->getUrl(); + $afterLoginUrl = $this->_urlFactory->create()->getUrl(); } $this->_session->setWebsiteRestrictionAfterLoginUrl($afterLoginUrl); } elseif ($this->_session->hasWebsiteRestrictionAfterLoginUrl()) { diff --git a/app/code/Magento/WebsiteRestriction/composer.json b/app/code/Magento/WebsiteRestriction/composer.json index 7ec9f9e9a61f3..c082b8a34d8f9 100644 --- a/app/code/Magento/WebsiteRestriction/composer.json +++ b/app/code/Magento/WebsiteRestriction/composer.json @@ -3,17 +3,17 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-theme": "0.1.0-alpha107" + "magento/module-theme": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php index 456dc199b29e2..d9d09e6511f66 100644 --- a/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Attribute/Backend/Weee/Tax.php @@ -140,7 +140,7 @@ public function afterSave($object) if (isset($tax['state']) && $tax['state']) { $state = $tax['state']; } else { - $state = '*'; + $state = '0'; } $data = []; diff --git a/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php b/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php index 655bc0a6c6146..0dfc5cebce1c6 100644 --- a/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Creditmemo/Weee.php @@ -24,7 +24,7 @@ class Weee extends \Magento\Sales\Model\Order\Creditmemo\Total\AbstractTotal * attributes This behavior may change in child classes * * @param \Magento\Weee\Helper\Data $weeeData - * @param array $data + * @param array $data */ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = []) { @@ -35,7 +35,7 @@ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = [ /** * Collect Weee amounts for the credit memo * - * @param Creditmemo $creditmemo + * @param Creditmemo $creditmemo * @return $this */ public function collect(Creditmemo $creditmemo) @@ -113,12 +113,12 @@ public function collect(Creditmemo $creditmemo) //Set the ratio of the tax amount in invoice item compared to tax amount in order item //This information is needed to calculate tax per tax rate later if ($orderItemTaxAmount != 0) { - if (!$item->getTaxRatio()) { - $item->setTaxRatio([]); + $taxRatio = []; + if ($item->getTaxRatio()) { + $taxRatio = unserialize($item->getTaxRatio()); } - $taxRatio = $item->getTaxRatio(); $taxRatio[\Magento\Weee\Model\Total\Quote\Weee::ITEM_TYPE] = $itemTaxAmount / $orderItemTaxAmount; - $item->setTaxRatio($taxRatio); + $item->setTaxRatio(serialize($taxRatio)); } $totalWeeeAmountInclTax += $weeeAmountInclTax; @@ -128,11 +128,11 @@ public function collect(Creditmemo $creditmemo) $applied = $this->_weeeData->getApplied($orderItem); foreach ($applied as $one) { $title = $one['title']; - $one['base_row_amount'] = $creditmemo->roundPrice($one['base_row_amount'] * $ratio, $title . '_base'); + $one['base_row_amount'] = $creditmemo->roundPrice($one['base_row_amount'] * $ratio, $title.'_base'); $one['row_amount'] = $creditmemo->roundPrice($one['row_amount'] * $ratio, $title); $one['base_row_amount_incl_tax'] = $creditmemo->roundPrice( $one['base_row_amount_incl_tax'] * $ratio, - $title . '_base' + $title.'_base' ); $one['row_amount_incl_tax'] = $creditmemo->roundPrice($one['row_amount_incl_tax'] * $ratio, $title); diff --git a/app/code/Magento/Weee/Model/Total/Invoice/Weee.php b/app/code/Magento/Weee/Model/Total/Invoice/Weee.php index 14aa8c37feddb..d0539a81325c0 100644 --- a/app/code/Magento/Weee/Model/Total/Invoice/Weee.php +++ b/app/code/Magento/Weee/Model/Total/Invoice/Weee.php @@ -22,7 +22,7 @@ class Weee extends \Magento\Sales\Model\Order\Invoice\Total\AbstractTotal * attributes This behavior may change in child classes * * @param \Magento\Weee\Helper\Data $weeeData - * @param array $data + * @param array $data */ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = []) { @@ -33,7 +33,7 @@ public function __construct(\Magento\Weee\Helper\Data $weeeData, array $data = [ /** * Collect Weee amounts for the invoice * - * @param \Magento\Sales\Model\Order\Invoice $invoice + * @param \Magento\Sales\Model\Order\Invoice $invoice * @return $this */ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) @@ -87,12 +87,12 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) //Set the ratio of the tax amount in invoice item compared to tax amount in order item //This information is needed to calculate tax per tax rate later if ($orderItemWeeeTax != 0) { - if (!$item->getTaxRatio()) { - $item->setTaxRatio([]); + $taxRatio = []; + if ($item->getTaxRatio()) { + $taxRatio = unserialize($item->getTaxRatio()); } - $taxRatio = $item->getTaxRatio(); $taxRatio[\Magento\Weee\Model\Total\Quote\Weee::ITEM_TYPE] = $itemWeeeTax / $orderItemWeeeTax; - $item->setTaxRatio($taxRatio); + $item->setTaxRatio(serialize($taxRatio)); } $item->setWeeeTaxAppliedRowAmount($weeeAmount); @@ -101,11 +101,11 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) $applied = $this->_weeeData->getApplied($orderItem); foreach ($applied as $one) { $title = $one['title']; - $one['base_row_amount'] = $invoice->roundPrice($one['base_row_amount'] * $ratio, $title . '_base'); + $one['base_row_amount'] = $invoice->roundPrice($one['base_row_amount'] * $ratio, $title.'_base'); $one['row_amount'] = $invoice->roundPrice($one['row_amount'] * $ratio, $title); $one['base_row_amount_incl_tax'] = $invoice->roundPrice( $one['base_row_amount_incl_tax'] * $ratio, - $title . '_base' + $title.'_base' ); $one['row_amount_incl_tax'] = $invoice->roundPrice($one['row_amount_incl_tax'] * $ratio, $title); diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index d1110d875d92c..dc740b5e71034 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -3,20 +3,20 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-tax": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-directory": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-eav": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-tax": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-directory": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-eav": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index ad2b72c6a2dc7..7f36bf1a53a6b 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -3,16 +3,16 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-cms": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-cms": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml index 0607e7ea74776..7d616b11baa7c 100644 --- a/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml +++ b/app/code/Magento/Widget/view/adminhtml/templates/instance/edit/layout.phtml @@ -27,9 +27,9 @@ var pageGroupTemplate = '
    '+ getDisplayOnContainers() as $container): ?> '
    '+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -42,9 +42,9 @@ var pageGroupTemplate = '
     '+ + ' '+ '
    '+ - ' '+ + ' '+ ''+ ''+ '
    '+ @@ -61,10 +61,10 @@ var pageGroupTemplate = '
    '+ - ''+ - ''+ + ''+ + ''+ '

    ' + - ' ' + + ' ' + '' + '<?php echo $this->escapeJsQuote(__('Open Chooser')); ?>' + ' ' + @@ -77,10 +77,10 @@ var pageGroupTemplate = '

    '+ - ''+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ + ''+ ''+ ''+ ''+ @@ -108,9 +108,9 @@ var pageGroupTemplate = '
    '+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ '
    '+ ''+ ''+ @@ -139,9 +139,9 @@ var pageGroupTemplate = '
    '+ - ''+ - ''+ - ''+ + ''+ + ''+ + ''+ '
    '+ ''+ ''+ @@ -269,6 +269,9 @@ var WidgetInstance = { container.removeClassName('no-display'); container.removeClassName('ignore-validate'); container.up('.fieldset-wrapper').addClassName('opened'); + container.select('input', 'select').each(function(element) { + $(element).removeAttribute('disabled'); + }); container.show(); } }, @@ -277,6 +280,9 @@ var WidgetInstance = { if (container) { container.addClassName('no-display'); container.addClassName('ignore-validate'); + container.select('input', 'select').each(function(element) { + $(element).writeAttribute('disabled', 'disabled'); + }); container.hide(); } }, diff --git a/app/code/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/Text.php b/app/code/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/Text.php new file mode 100644 index 0000000000000..402e32b634c8e --- /dev/null +++ b/app/code/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/Text.php @@ -0,0 +1,18 @@ + $this->getValue()]; + } +} diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index 935967b72518e..68decafc77964 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -3,28 +3,28 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/module-store": "0.1.0-alpha107", - "magento/module-customer": "0.1.0-alpha107", - "magento/module-catalog": "0.1.0-alpha107", - "magento/module-core": "0.1.0-alpha107", - "magento/module-checkout": "0.1.0-alpha107", - "magento/module-theme": "0.1.0-alpha107", - "magento/module-catalog-inventory": "0.1.0-alpha107", - "magento/module-rss": "0.1.0-alpha107", - "magento/module-backend": "0.1.0-alpha107", - "magento/module-sales": "0.1.0-alpha107", - "magento/module-grouped-product": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", - "magento/module-ui": "0.1.0-alpha107", + "magento/module-store": "0.1.0-alpha108", + "magento/module-customer": "0.1.0-alpha108", + "magento/module-catalog": "0.1.0-alpha108", + "magento/module-core": "0.1.0-alpha108", + "magento/module-checkout": "0.1.0-alpha108", + "magento/module-theme": "0.1.0-alpha108", + "magento/module-catalog-inventory": "0.1.0-alpha108", + "magento/module-rss": "0.1.0-alpha108", + "magento/module-backend": "0.1.0-alpha108", + "magento/module-sales": "0.1.0-alpha108", + "magento/module-grouped-product": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", + "magento/module-ui": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "suggest": { - "magento/module-configurable-product": "0.1.0-alpha107", - "magento/module-downloadable": "0.1.0-alpha107", - "magento/module-bundle": "0.1.0-alpha107" + "magento/module-configurable-product": "0.1.0-alpha108", + "magento/module-downloadable": "0.1.0-alpha108", + "magento/module-bundle": "0.1.0-alpha108" }, "type": "magento2-module", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/code/Magento/Wishlist/i18n/de_DE.csv b/app/code/Magento/Wishlist/i18n/de_DE.csv index f73d9f1b6bd0e..43fc5de10f58c 100644 --- a/app/code/Magento/Wishlist/i18n/de_DE.csv +++ b/app/code/Magento/Wishlist/i18n/de_DE.csv @@ -95,7 +95,9 @@ Message,Nachricht "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/i18n/en_US.csv b/app/code/Magento/Wishlist/i18n/en_US.csv index f87bcc62d780b..125f7266ade2b 100644 --- a/app/code/Magento/Wishlist/i18n/en_US.csv +++ b/app/code/Magento/Wishlist/i18n/en_US.csv @@ -95,7 +95,9 @@ Message,Message "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/i18n/es_ES.csv b/app/code/Magento/Wishlist/i18n/es_ES.csv index 8b59b17ff1726..cd8aab6a37915 100644 --- a/app/code/Magento/Wishlist/i18n/es_ES.csv +++ b/app/code/Magento/Wishlist/i18n/es_ES.csv @@ -95,7 +95,9 @@ Message,Mensaje "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/i18n/fr_FR.csv b/app/code/Magento/Wishlist/i18n/fr_FR.csv index 2728681ff8475..512c6ad4ec38d 100644 --- a/app/code/Magento/Wishlist/i18n/fr_FR.csv +++ b/app/code/Magento/Wishlist/i18n/fr_FR.csv @@ -95,7 +95,9 @@ Message,Message "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/i18n/nl_NL.csv b/app/code/Magento/Wishlist/i18n/nl_NL.csv index 1cc87637e2282..9a25398b7cdad 100644 --- a/app/code/Magento/Wishlist/i18n/nl_NL.csv +++ b/app/code/Magento/Wishlist/i18n/nl_NL.csv @@ -95,7 +95,9 @@ Message,Boodschap "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/i18n/pt_BR.csv b/app/code/Magento/Wishlist/i18n/pt_BR.csv index 166bb8a60612b..9e297438a2bcf 100644 --- a/app/code/Magento/Wishlist/i18n/pt_BR.csv +++ b/app/code/Magento/Wishlist/i18n/pt_BR.csv @@ -95,7 +95,9 @@ Message,Mensagem "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/i18n/zh_CN.csv b/app/code/Magento/Wishlist/i18n/zh_CN.csv index 1311c54dc871b..9c0338dae0053 100644 --- a/app/code/Magento/Wishlist/i18n/zh_CN.csv +++ b/app/code/Magento/Wishlist/i18n/zh_CN.csv @@ -95,7 +95,9 @@ Message,信息 "General Options","General Options" "Share Options","Share Options" "Max Emails Allowed to be Sent","Max Emails Allowed to be Sent" +"10 by default. Max - 10000","10 by default. Max - 10000" "Email Text Length Limit","Email Text Length Limit" +"255 by default","255 by default" "My Wish List Link","My Wish List Link" "Display Wish List Summary","Display Wish List Summary" "No Items Found","No Items Found" diff --git a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml index 6662a31b1eea8..621cc2d9cee6c 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml @@ -34,6 +34,7 @@ Productproduct_nameproduct_name + Magento\Wishlist\Block\Adminhtml\Widget\Grid\Column\Filter\TextMagento\Customer\Block\Adminhtml\Edit\Tab\View\Grid\Renderer\Itemcol-namecol-name @@ -109,5 +110,6 @@ + diff --git a/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less index d4f4b9564eac9..fc05de4c15513 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Theme/web/css/source/module.less @@ -27,6 +27,13 @@ body { font-weight: @baseFontWeight; .font-size(@baseFontSize); background: @primary7; + .vendor-prefix-display(flex); + .vendor-prefix-flex-direction(column); + & > * { + .vendor-prefix-flex-grow(0); + .vendor-prefix-flex-shrink(0); + .vendor-prefix-flex-basis(auto); + } } .page-wrapper { @@ -36,18 +43,20 @@ body { width: 100%; max-width: 100%; min-width: @layout-min-width + 2 * @layout-indent; - .ie10 &, - .ie11 & { - height: 100%; + & > * { + .vendor-prefix-flex-grow(0); + .vendor-prefix-flex-shrink(0); + .vendor-prefix-flex-basis(auto); } } + .page-header { &-wrapper { background-color: @color-dark; } &:extend(._layout-width all); text-align: right; - .clearer(); + .clearer(); .logo { margin-top: 5px; float: left; @@ -229,6 +238,9 @@ body { } .dropdown-menu { text-align: left; + .item { + display: block; + } } } // Fixed page actions @@ -237,7 +249,7 @@ body { top: 0; left: 0; right: 0; - z-index: 998; + z-index: 10; padding: 0; background: -webkit-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); // Use in 4.3 Android background: -ms-linear-gradient(top, rgba(245, 242, 237, 1) 0%, rgba(245, 242, 237, 1) 56%, rgba(245, 242, 237, 0) 100%); // Use in 10 IE @@ -299,6 +311,7 @@ body { .button-reset(); color: @color-link; line-height: normal; + margin-top: 2px; vertical-align: middle; } ul.dropdown-menu { @@ -481,25 +494,25 @@ button { } .footer-legal { - float:right; + float: right; width: 550px; .link-report, .magento-version, .copyright { - font-size:13px; + font-size: 13px; } &:before { content:""; display: inline-block; vertical-align: middle; - position:absolute; + position: absolute; z-index: 1; margin-top: 2px; margin-left: -35px; width: 30px; height: 35px; background-size: 109px 70px; - background: url("@{baseDir}images/logo.svg") no-repeat 0 -35px; + background: url("@{baseDir}images/logo.svg") no-repeat 0 -21px; } } diff --git a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less index 97ef170ba320c..09c353c16f52e 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less +++ b/app/design/adminhtml/Magento/backend/Magento_Ui/web/css/source/formelements.less @@ -133,6 +133,14 @@ box-sizing: border-box; max-width: 380px; } + .control-addon { + + .mage-error { + .no-flexbox.no-flexboxlegacy & { + display: inline-block; + width: 100%; + } + } + } } .form__field { diff --git a/app/design/adminhtml/Magento/backend/Magento_VersionsCms/web/css/source/module.less b/app/design/adminhtml/Magento/backend/Magento_VersionsCms/web/css/source/module.less new file mode 100644 index 0000000000000..3e2ef7780f343 --- /dev/null +++ b/app/design/adminhtml/Magento/backend/Magento_VersionsCms/web/css/source/module.less @@ -0,0 +1,11 @@ +// /** +// * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) +// */ + +.version-fieldset { + .grid-actions { + border-bottom: 1px solid #f2ebde; + margin: 0 0 15px; + padding: 0 0 15px; + } +} diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index 626b5da294324..801a7e061ea94 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/adminhtml/Magento/backend/web/css/admin.less b/app/design/adminhtml/Magento/backend/web/css/admin.less index a77d45ae5c9e8..ebd3fc8361b2b 100644 --- a/app/design/adminhtml/Magento/backend/web/css/admin.less +++ b/app/design/adminhtml/Magento/backend/web/css/admin.less @@ -7,6 +7,7 @@ @import "../less/styles/vars.less"; @import "../less/styles/base.less"; @import "../less/lib/buttons.less"; +@import 'source/lib/utilities.less'; .dont-use-this-class-big-size { font-size: 18px; @@ -636,9 +637,9 @@ textarea[readonly] { color: #999; } -select[disabled].multiselect > option[selected] { +select[disabled] option[selected] { color: #fff; - background: #6d6d6d; + background: #aaa; } textarea:-moz-placeholder, @@ -710,6 +711,11 @@ fieldset.field [class^='fields-group-'] .field .control { vertical-align: middle; } +.form-inline > form > div > .message { + margin-left: 18px; + margin-right: 18px; +} + .control > input { width: 100%; } @@ -1399,8 +1405,8 @@ address { background-image: url(../images/fam_application_form_delete.png); } -.x-tree-node-ct { - overflow: hidden; +.x-tree-node { + overflow: auto; } /* @@ -1426,7 +1432,7 @@ address { color: #be0a0a; font-size: 16px; font-weight: 500; - margin: 0 0 6px 0; + margin: 0 0 6px; } .tipsy-inner .error p { @@ -1787,7 +1793,8 @@ address { width: 262px; height: 64px; text-indent: -999em; - background: url(Magento_Backend::images/logo-magento.png) no-repeat; + .url('images/logo-magento.png', 'Magento_Backend'); + background: url("@{url}") no-repeat; } .page-login { @@ -3643,3 +3650,5 @@ tr.dynamic-grid input.input-text { .fieldset-wrapper-title:after { clear: both; } +@baseDir: "../"; //default + diff --git a/app/design/adminhtml/Magento/backend/web/css/pages.less b/app/design/adminhtml/Magento/backend/web/css/pages.less index 7525066fe2691..18539d219757d 100644 --- a/app/design/adminhtml/Magento/backend/web/css/pages.less +++ b/app/design/adminhtml/Magento/backend/web/css/pages.less @@ -728,6 +728,13 @@ padding: 18px; } +.customer-current-activity .action-refresh { + float: right; + &:hover { + text-decoration: none; + } +} + .order-currency { padding: 18px; } diff --git a/app/design/adminhtml/Magento/backend/web/less/styles/debug.less b/app/design/adminhtml/Magento/backend/web/less/styles/debug.less index 373955cceed6d..df8fc09eb2aab 100644 --- a/app/design/adminhtml/Magento/backend/web/less/styles/debug.less +++ b/app/design/adminhtml/Magento/backend/web/less/styles/debug.less @@ -301,8 +301,11 @@ border: 0; } -.accordion .config .comment a { - .style3(); +.accordion .config { + .comment a, + .link-more { + .style3(); + } } .accordion .config legend { @@ -367,7 +370,25 @@ .accordion .config .value { width: 50%; - padding-right:40px; + padding-right: 40px; + .checkboxes { + list-style: none; + padding: 0; + margin: -3px 0 0; + + li { + margin: 7px 0; + } + + input, + label { + vertical-align: middle; + } + + label { + margin-left: 5px; + } + } } .accordion .config .value.with-tooltip { diff --git a/app/design/adminhtml/Magento/backend/web/less/styles/pages.less b/app/design/adminhtml/Magento/backend/web/less/styles/pages.less index f71c3e670c030..20f7f4caab162 100644 --- a/app/design/adminhtml/Magento/backend/web/less/styles/pages.less +++ b/app/design/adminhtml/Magento/backend/web/less/styles/pages.less @@ -1114,9 +1114,6 @@ tr.row-totals:nth-child(odd) + tr.summary-details ~ tr.summary-total:not(.show-d } } } -.customer-current-activity .action-refresh { - float: right; -} .customer-current-activity .action-refresh, .customer-current-activity .data-table .icon { diff --git a/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less index 7b31d2f686814..f5188ca211300 100644 --- a/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Bundle/web/css/source/module.less @@ -80,6 +80,7 @@ .box-tocart { .actions { margin-bottom: @indent-s-base; + display: inline-block; } .action.primary { &:extend(.abs-button-l all); diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less index ca11877ac9366..d265e43b02fbe 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/module.less @@ -468,9 +468,6 @@ &:extend(.abs-revert-field-type-desktop all); } - .table-wrapper.comparison { - .table-overflow(); - } } // diff --git a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less index b6c2421aa28cf..282c3d0cc6f58 100644 --- a/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less +++ b/app/design/frontend/Magento/blank/Magento_Catalog/web/css/source/widgets.less @@ -68,12 +68,21 @@ .responsive-min-l(@break) when (@break = @screen-l) { .block.widget .products-grid .product-item { width: 100%/5 } - .page-layout-1column .block.widget .products-grid .product-item { width: 100%/6 } + .page-layout-1column .block.widget .products-grid .product-item { + width: 100%/6; + margin-left: calc(~"(100% - 5 * (100%/6)) / 4"); + &:nth-child(4n+1) { + margin-left: calc(~"(100% - 5 * (100%/6)) / 4"); + } + &:nth-child(5n+1) { + margin-left: 0; + } + } .page-layout-3columns .block.widget .products-grid .product-item { width: 100%/4 } .block.widget .products-grid .product-items { margin: 0; } .block.widget .products-grid .product-item { - width: 22%; - margin-left: calc(~"(100% - 4 * 22%) / 3"); + width: 24%; + margin-left: calc(~"(100% - 4 * 24%) / 3"); padding: 0; &:nth-child(4n+1) { margin-left: 0; diff --git a/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less b/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less index 9c7a72ea9f1f0..24229d8a6b207 100644 --- a/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less +++ b/app/design/frontend/Magento/blank/Magento_Paypal/web/css/source/module.less @@ -34,12 +34,12 @@ } } -.product-info-main, +.box-tocart, .block-minicart { - .paypal img { + .paypal img { display: block; margin: 0 auto; - } + } } .form-new-agreement { diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index 043c9997962fd..30452ec592d84 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -3,11 +3,11 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/blank/web/css/source/layout.less b/app/design/frontend/Magento/blank/web/css/source/layout.less index 99763e87ef675..cc63bc589340a 100644 --- a/app/design/frontend/Magento/blank/web/css/source/layout.less +++ b/app/design/frontend/Magento/blank/web/css/source/layout.less @@ -81,7 +81,7 @@ margin-left: auto; margin-right: auto; width: auto; - max-width: @layout-max-width + @layout-indent * 2; + max-width: @layout-max-width; box-sizing: border-box; } .page-main { diff --git a/app/design/frontend/Magento/blank/web/css/source/tables.less b/app/design/frontend/Magento/blank/web/css/source/tables.less index 2f7993414733e..bded4ea48e3a8 100644 --- a/app/design/frontend/Magento/blank/web/css/source/tables.less +++ b/app/design/frontend/Magento/blank/web/css/source/tables.less @@ -45,7 +45,7 @@ table { .table-wrapper { .table-overflow(); position: relative; // to hide unnecessary horizontal scrollbar in Safari - .table:not(.cart):not(.totals) { + .table:not(.cart):not(.totals):not(.table-comparison) { .table-responsive(); tbody > tr { > td:first-child { diff --git a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less index a962298d28b60..6c26974875092 100644 --- a/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less +++ b/app/design/frontend/Magento/luma/Magento_Catalog/web/css/source/module.less @@ -849,10 +849,6 @@ body.catalog-product-compare-index { } } -.compare.wrapper { - display: none; -} - } // @@ -869,13 +865,18 @@ body.catalog-product-compare-index { } } } +.responsive-max-m(@break) when (@break = @screen-m) { + .compare.wrapper, + [class*="block-compare"] { + display: none; + } +} // // Desktop //-------------------------------------- .responsive-min-l(@break) when (@break = @screen-m) { .compare.wrapper { - display: block; float: right; .list-reset-styles(); .action.compare { @@ -901,9 +902,6 @@ body.catalog-product-compare-index { } } } - .table-wrapper.comparison { - .table-overflow(); - } } // diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less index e5acdf98c9abd..469dadae1a7d5 100644 --- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less +++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/module.less @@ -436,15 +436,19 @@ body { @_dropdown-toggle-active-icon-content: @icon-up, @_icon-font-text-hide: true, @_icon-font-size: 10px, - @_icon-font-line-height: 22px + @_icon-font-line-height: 22px, + @_dropdown-list-pointer-position: right, + @_dropdown-list-position-right: 0 ); .action.switch { .button-reset(); - color: @color-white; + .css(color, @color-white); + } + .header.links { + min-width: 175px; } li { &:extend(.switcher li all); - min-width: 120px; a { .link( @_link-color: @color-gray20, diff --git a/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less b/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less index 8086bfc3f0633..bac1fcf66843a 100644 --- a/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less +++ b/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/module.less @@ -76,6 +76,7 @@ .link.wishlist { .counter { color: @text-color-muted; + white-space: nowrap; &:before { content: "("; } diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 6bf89d6a12aaf..32ffb035bfdc4 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -3,12 +3,12 @@ "description": "N/A", "require": { "php": "~5.4.11|~5.5.0", - "magento/theme-frontend-blank": "0.1.0-alpha107", - "magento/framework": "0.1.0-alpha107", + "magento/theme-frontend-blank": "0.1.0-alpha108", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-theme", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/app/design/frontend/Magento/luma/web/css/source/tables.less b/app/design/frontend/Magento/luma/web/css/source/tables.less index 4ee6c68778c82..45c887c3ccc12 100644 --- a/app/design/frontend/Magento/luma/web/css/source/tables.less +++ b/app/design/frontend/Magento/luma/web/css/source/tables.less @@ -47,7 +47,7 @@ table { border-top: @table-border-width @table-border-style @table-border-color; .table-overflow(); position: relative; // to hide unnecessary horizontal scrollbar in Safari - .table:not(.totals):not(.cart) { + .table:not(.totals):not(.cart):not(.table-comparison) { .table-responsive(); tbody { > tr { diff --git a/app/etc/di.xml b/app/etc/di.xml index 2e71ad93764a9..11bb9ee59bbfd 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -8,6 +8,7 @@ + @@ -49,7 +50,6 @@ - @@ -85,7 +85,6 @@ - Magento\Framework\Model\ActionValidator\RemoveAction\Proxy diff --git a/app/i18n/magento/de_de/composer.json b/app/i18n/magento/de_de/composer.json index c3f84920c6c65..45c4e058908a9 100644 --- a/app/i18n/magento/de_de/composer.json +++ b/app/i18n/magento/de_de/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-de_de", "description": "German (Germany) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/en_us/composer.json b/app/i18n/magento/en_us/composer.json index 525dfdbdb298c..78f32008c4c82 100644 --- a/app/i18n/magento/en_us/composer.json +++ b/app/i18n/magento/en_us/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-en_us", "description": "English (United States) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/es_es/composer.json b/app/i18n/magento/es_es/composer.json index 58f0832c99c5b..0a74fdc4543ab 100644 --- a/app/i18n/magento/es_es/composer.json +++ b/app/i18n/magento/es_es/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-es_es", "description": "Spanish (Spain) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/fr_fr/composer.json b/app/i18n/magento/fr_fr/composer.json index 8206762a233b5..d915ee76f3399 100644 --- a/app/i18n/magento/fr_fr/composer.json +++ b/app/i18n/magento/fr_fr/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-fr_fr", "description": "French (France) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/nl_nl/composer.json b/app/i18n/magento/nl_nl/composer.json index 3d2a5bd9bd092..65bba789606d5 100644 --- a/app/i18n/magento/nl_nl/composer.json +++ b/app/i18n/magento/nl_nl/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-nl_nl", "description": "Dutch (Netherlands) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/pt_br/composer.json b/app/i18n/magento/pt_br/composer.json index 1c3d2f00e2620..1990858131225 100644 --- a/app/i18n/magento/pt_br/composer.json +++ b/app/i18n/magento/pt_br/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-pt_br", "description": "Portuguese (Brazil) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/app/i18n/magento/zh_cn/composer.json b/app/i18n/magento/zh_cn/composer.json index f37be23fd6cb2..5b4acb09b6a31 100644 --- a/app/i18n/magento/zh_cn/composer.json +++ b/app/i18n/magento/zh_cn/composer.json @@ -1,13 +1,13 @@ { "name": "magento/language-zh_cn", "description": "Chinese (China) language", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" ], "require": { - "magento/framework": "0.1.0-alpha107", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*" }, "type": "magento2-language", diff --git a/composer.json b/composer.json index e8de85bf2453b..f2571f1d26235 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/project-mainline", "description": "Magento project mainline", "type": "project", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" @@ -15,12 +15,37 @@ "zendframework/zend-soap": "2.3.1", "zendframework/zend-uri": "2.3.1", "zendframework/zend-validator": "2.3.1", - "magento/zendframework1": "1.12.9" + "zendframework/zend-console": "2.3.1", + "zendframework/zend-modulemanager": "2.3.1", + "zendframework/zend-mvc": "2.3.1", + "zendframework/zend-text": "2.3.1", + "zendframework/zend-eventmanager": "2.3.1", + "zendframework/zend-view": "2.3.1", + "zendframework/zend-servicemanager": "2.3.1", + "zendframework/zend-json": "2.3.1", + "zendframework/zend-config": "2.3.1", + "zendframework/zend-form": "2.3.1", + "zendframework/zend-di": "2.3.1", + "zendframework/zend-serializer": "2.3.1", + "zendframework/zend-log": "2.3.1", + "zendframework/zend-http": "2.3.1", + "magento/zendframework1": "1.12.9", + "composer/composer": "1.0.0-alpha8" }, "require-dev": { "phpunit/phpunit": "4.1.0", "squizlabs/php_codesniffer": "1.5.3", "phpmd/phpmd": "@stable", + "lib-libxml": "*", + "ext-ctype": "*", + "ext-gd": "*", + "ext-spl": "*", + "ext-dom": "*", + "ext-simplexml": "*", + "ext-mcrypt": "*", + "ext-hash": "*", + "ext-curl": "*", + "ext-iconv": "*", "sjparkinson/static-review": "~4.1", "fabpot/php-cs-fixer": "~1.2" }, @@ -170,8 +195,8 @@ "tinymce/tinymce": "3.4.7" }, "suggest": { - "magento/module-fedex": "0.1.0-alpha107", - "magento/module-ups": "0.1.0-alpha107" + "magento/module-fedex": "0.1.0-alpha108", + "magento/module-ups": "0.1.0-alpha108" }, "extra": { "component_paths": { @@ -195,8 +220,7 @@ ], "twbs/bootstrap": [ "lib/web/jquery/jquery.tabs.js", - "lib/web/jquery/jquery.popups.js", - "lib/web/jquery/bootstrap-carousel" + "lib/web/jquery/jquery.popups.js" ], "tinymce/tinymce": "lib/web/tiny_mce" } @@ -213,11 +237,11 @@ "psr-4": { "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/", "Magento\\Tools\\": "dev/tools/Magento/Tools/", - "Magento\\Tools\\License\\": "dev/build/publication/license/", "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/", "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/", "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/", - "Magento\\ToolkitFramework\\": "dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/" + "Magento\\ToolkitFramework\\": "dev/tools/performance-toolkit/framework/Magento/ToolkitFramework/", + "Magento\\Setup\\": "setup/module/Magento/Setup/src/" } } } diff --git a/composer.lock b/composer.lock index 6f94239312700..4cb34eef437d6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,133 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4f94eeba215f332b20af69f76977efc9", + "hash": "7f476cdbf96cb6a904a0c30eb9343069", "packages": [ + { + "name": "composer/composer", + "version": "1.0.0-alpha8", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "1eb1df44a97fb2daca1bb8b007f3bee012f0aa46" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/1eb1df44a97fb2daca1bb8b007f3bee012f0aa46", + "reference": "1eb1df44a97fb2daca1bb8b007f3bee012f0aa46", + "shasum": "" + }, + "require": { + "justinrainbow/json-schema": "1.1.*", + "php": ">=5.3.2", + "seld/jsonlint": "1.*", + "symfony/console": "~2.3", + "symfony/finder": "~2.2", + "symfony/process": "~2.1" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.10" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives, and allows gzip compression of all internet traffic" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-0": { + "Composer": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be", + "role": "Developer" + }, + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de", + "role": "Developer" + } + ], + "description": "Dependency Manager", + "homepage": "http://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "time": "2014-01-06 18:39:59" + }, + { + "name": "justinrainbow/json-schema", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/05ff6d8d79fe3ad190b0663d80d3f9deee79416c", + "reference": "05ff6d8d79fe3ad190b0663d80d3f9deee79416c", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonSchema": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "NewBSD" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch", + "homepage": "http://wiedler.ch/igor/" + }, + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Robert Schönthal", + "email": "robert.schoenthal@gmail.com", + "homepage": "http://digitalkaoz.net" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2012-01-03 00:33:17" + }, { "name": "magento/zendframework1", "version": "1.12.9", @@ -54,112 +179,1091 @@ "time": "2014-11-24 22:50:41" }, { - "name": "zendframework/zend-code", - "version": "2.3.1", - "target-dir": "Zend/Code", + "name": "seld/jsonlint", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendCode.git", - "reference": "3e7cc92f946c23fb28959457fa0608c5eba29ed8" + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "a7bc2ec9520ad15382292591b617c43bdb1fec35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendCode/zipball/3e7cc92f946c23fb28959457fa0608c5eba29ed8", - "reference": "3e7cc92f946c23fb28959457fa0608c5eba29ed8", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/a7bc2ec9520ad15382292591b617c43bdb1fec35", + "reference": "a7bc2ec9520ad15382292591b617c43bdb1fec35", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-eventmanager": "self.version" + "php": ">=5.3.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2014-09-05 15:36:20" + }, + { + "name": "symfony/console", + "version": "v2.6.1", + "target-dir": "Symfony/Component/Console", + "source": { + "type": "git", + "url": "https://github.com/symfony/Console.git", + "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", + "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" }, "require-dev": { - "doctrine/common": ">=2.1", - "zendframework/zend-stdlib": "self.version" + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1", + "symfony/process": "~2.1" }, "suggest": { - "doctrine/common": "Doctrine\\Common >=2.1 for annotation features", - "zendframework/zend-stdlib": "Zend\\Stdlib component" + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" + "dev-master": "2.6-dev" } }, "autoload": { "psr-0": { - "Zend\\Code\\": "" + "Symfony\\Component\\Console\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "description": "provides facilities to generate arbitrary code using an object oriented interface", - "keywords": [ - "code", - "zf2" + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } ], - "time": "2014-04-15 15:28:49" + "description": "Symfony Console Component", + "homepage": "http://symfony.com", + "time": "2014-12-02 20:19:20" }, { - "name": "zendframework/zend-escaper", - "version": "2.3.1", - "target-dir": "Zend/Escaper", + "name": "symfony/finder", + "version": "v2.6.1", + "target-dir": "Symfony/Component/Finder", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendEscaper.git", - "reference": "dddee2104337bbf3522f9ef591c361a40aabf7cc" + "url": "https://github.com/symfony/Finder.git", + "reference": "0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendEscaper/zipball/dddee2104337bbf3522f9ef591c361a40aabf7cc", - "reference": "dddee2104337bbf3522f9ef591c361a40aabf7cc", + "url": "https://api.github.com/repos/symfony/Finder/zipball/0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721", + "reference": "0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721", "shasum": "" }, "require": { - "php": ">=5.3.23" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev", - "dev-develop": "2.4-dev" + "dev-master": "2.6-dev" } }, "autoload": { "psr-0": { - "Zend\\Escaper\\": "" + "Symfony\\Component\\Finder\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "keywords": [ - "escaper", - "zf2" + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } ], - "time": "2014-04-15 15:29:16" + "description": "Symfony Finder Component", + "homepage": "http://symfony.com", + "time": "2014-12-02 20:19:20" }, { - "name": "zendframework/zend-eventmanager", + "name": "symfony/process", + "version": "v2.6.1", + "target-dir": "Symfony/Component/Process", + "source": { + "type": "git", + "url": "https://github.com/symfony/Process.git", + "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Process/zipball/bf0c9bd625f13b0b0bbe39919225cf145dfb935a", + "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "autoload": { + "psr-0": { + "Symfony\\Component\\Process\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Process Component", + "homepage": "http://symfony.com", + "time": "2014-12-02 20:19:20" + }, + { + "name": "zendframework/zend-code", "version": "2.3.1", - "target-dir": "Zend/EventManager", + "target-dir": "Zend/Code", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendEventManager.git", - "reference": "957faa0580c40ef6bf6cf3e87a36d594042fe133" + "url": "https://github.com/zendframework/Component_ZendCode.git", + "reference": "3e7cc92f946c23fb28959457fa0608c5eba29ed8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendCode/zipball/3e7cc92f946c23fb28959457fa0608c5eba29ed8", + "reference": "3e7cc92f946c23fb28959457fa0608c5eba29ed8", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-eventmanager": "self.version" + }, + "require-dev": { + "doctrine/common": ">=2.1", + "zendframework/zend-stdlib": "self.version" + }, + "suggest": { + "doctrine/common": "Doctrine\\Common >=2.1 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Code\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "keywords": [ + "code", + "zf2" + ], + "time": "2014-04-15 15:28:49" + }, + { + "name": "zendframework/zend-config", + "version": "2.3.1", + "target-dir": "Zend/Config", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendConfig.git", + "reference": "61b81c6ea60c1947e13b4effbfffcd9bb59c2180" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendConfig/zipball/61b81c6ea60c1947e13b4effbfffcd9bb59c2180", + "reference": "61b81c6ea60c1947e13b4effbfffcd9bb59c2180", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-filter": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-servicemanager": "self.version" + }, + "suggest": { + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json to use the Json reader or writer classes", + "zendframework/zend-servicemanager": "Zend\\ServiceManager for use with the Config Factory to retrieve reader and writer instances" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Config\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a nested object property based user interface for accessing this configuration data within application code", + "keywords": [ + "config", + "zf2" + ], + "time": "2014-04-15 15:29:04" + }, + { + "name": "zendframework/zend-console", + "version": "2.3.1", + "target-dir": "Zend/Console", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendConsole.git", + "reference": "6720a94d30272eefe10bef4801cc41a027530b1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendConsole/zipball/6720a94d30272eefe10bef4801cc41a027530b1c", + "reference": "6720a94d30272eefe10bef4801cc41a027530b1c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Console\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "console", + "zf2" + ], + "time": "2014-04-15 15:29:14" + }, + { + "name": "zendframework/zend-di", + "version": "2.3.1", + "target-dir": "Zend/Di", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendDi.git", + "reference": "45450000c83937a73a261a32480637b4198f4cea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendDi/zipball/45450000c83937a73a261a32480637b4198f4cea", + "reference": "45450000c83937a73a261a32480637b4198f4cea", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-code": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-servicemanager": "self.version" + }, + "suggest": { + "zendframework/zend-servicemanager": "Zend\\ServiceManager component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Di\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "di", + "zf2" + ], + "time": "2014-04-15 15:29:10" + }, + { + "name": "zendframework/zend-escaper", + "version": "2.3.1", + "target-dir": "Zend/Escaper", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendEscaper.git", + "reference": "dddee2104337bbf3522f9ef591c361a40aabf7cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendEscaper/zipball/dddee2104337bbf3522f9ef591c361a40aabf7cc", + "reference": "dddee2104337bbf3522f9ef591c361a40aabf7cc", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Escaper\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "escaper", + "zf2" + ], + "time": "2014-04-15 15:29:16" + }, + { + "name": "zendframework/zend-eventmanager", + "version": "2.3.1", + "target-dir": "Zend/EventManager", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendEventManager.git", + "reference": "957faa0580c40ef6bf6cf3e87a36d594042fe133" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendEventManager/zipball/957faa0580c40ef6bf6cf3e87a36d594042fe133", + "reference": "957faa0580c40ef6bf6cf3e87a36d594042fe133", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\EventManager\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "eventmanager", + "zf2" + ], + "time": "2014-04-15 14:47:18" + }, + { + "name": "zendframework/zend-filter", + "version": "2.3.1", + "target-dir": "Zend/Filter", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendFilter.git", + "reference": "1889b7aa499beccadac770780a73e1a40e0f8a53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendFilter/zipball/1889b7aa499beccadac770780a73e1a40e0f8a53", + "reference": "1889b7aa499beccadac770780a73e1a40e0f8a53", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-crypt": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-uri": "self.version" + }, + "suggest": { + "zendframework/zend-crypt": "Zend\\Crypt component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-uri": "Zend\\Uri component for UriNormalize filter" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Filter\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a set of commonly needed data filters", + "keywords": [ + "filter", + "zf2" + ], + "time": "2014-04-15 15:28:47" + }, + { + "name": "zendframework/zend-form", + "version": "2.3.1", + "target-dir": "Zend/Form", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendForm.git", + "reference": "2e91090e63f865c1c0b8c21157d4eaffad341f59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendForm/zipball/2e91090e63f865c1c0b8c21157d4eaffad341f59", + "reference": "2e91090e63f865c1c0b8c21157d4eaffad341f59", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-captcha": "self.version", + "zendframework/zend-code": "self.version", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-validator": "self.version", + "zendframework/zend-view": "self.version", + "zendframework/zendservice-recaptcha": "*" + }, + "suggest": { + "zendframework/zend-captcha": "Zend\\Captcha component", + "zendframework/zend-code": "Zend\\Code component", + "zendframework/zend-eventmanager": "Zend\\EventManager component", + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-validator": "Zend\\Validator component", + "zendframework/zend-view": "Zend\\View component", + "zendframework/zendservice-recaptcha": "ZendService\\ReCaptcha component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Form\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "form", + "zf2" + ], + "time": "2014-04-15 15:29:02" + }, + { + "name": "zendframework/zend-http", + "version": "2.3.1", + "target-dir": "Zend/Http", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendHttp.git", + "reference": "b13fc4c30c39364409ef68a9f9b5975765a3ff5a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendHttp/zipball/b13fc4c30c39364409ef68a9f9b5975765a3ff5a", + "reference": "b13fc4c30c39364409ef68a9f9b5975765a3ff5a", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-loader": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-uri": "self.version", + "zendframework/zend-validator": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Http\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an easy interface for performing Hyper-Text Transfer Protocol (HTTP) requests", + "keywords": [ + "http", + "zf2" + ], + "time": "2014-04-15 14:47:18" + }, + { + "name": "zendframework/zend-inputfilter", + "version": "2.3.1", + "target-dir": "Zend/InputFilter", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendInputFilter.git", + "reference": "a45d2180c819f9ff9e74be1bf4c5c8dd1d9649e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendInputFilter/zipball/a45d2180c819f9ff9e74be1bf4c5c8dd1d9649e9", + "reference": "a45d2180c819f9ff9e74be1bf4c5c8dd1d9649e9", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-filter": "self.version", + "zendframework/zend-stdlib": "self.version", + "zendframework/zend-validator": "self.version" + }, + "require-dev": { + "zendframework/zend-servicemanager": "self.version" + }, + "suggest": { + "zendframework/zend-servicemanager": "To support plugin manager support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\InputFilter\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "inputfilter", + "zf2" + ], + "time": "2014-04-15 14:47:18" + }, + { + "name": "zendframework/zend-json", + "version": "2.3.1", + "target-dir": "Zend/Json", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendJson.git", + "reference": "eb281da42d3f5bba5acb664359029b6fa7c62e28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendJson/zipball/eb281da42d3f5bba5acb664359029b6fa7c62e28", + "reference": "eb281da42d3f5bba5acb664359029b6fa7c62e28", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-http": "self.version", + "zendframework/zend-server": "self.version" + }, + "suggest": { + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-server": "Zend\\Server component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Json\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides convenience methods for serializing native PHP to JSON and decoding JSON to native PHP", + "keywords": [ + "json", + "zf2" + ], + "time": "2014-04-15 14:47:18" + }, + { + "name": "zendframework/zend-loader", + "version": "2.3.1", + "target-dir": "Zend/Loader", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendLoader.git", + "reference": "37abb23b0b2608584673f8388d1563a1fd604f09" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendLoader/zipball/37abb23b0b2608584673f8388d1563a1fd604f09", + "reference": "37abb23b0b2608584673f8388d1563a1fd604f09", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Loader\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "loader", + "zf2" + ], + "time": "2014-04-15 15:28:53" + }, + { + "name": "zendframework/zend-log", + "version": "2.3.1", + "target-dir": "Zend/Log", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendLog.git", + "reference": "606ef20717a935afec1400f54bd1b03faf859c47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendLog/zipball/606ef20717a935afec1400f54bd1b03faf859c47", + "reference": "606ef20717a935afec1400f54bd1b03faf859c47", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-console": "self.version", + "zendframework/zend-db": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-mail": "self.version", + "zendframework/zend-validator": "self.version" + }, + "suggest": { + "ext-mongo": "*", + "zendframework/zend-console": "Zend\\Console component", + "zendframework/zend-db": "Zend\\Db component", + "zendframework/zend-escaper": "Zend\\Escaper component, for use in the XML formatter", + "zendframework/zend-mail": "Zend\\Mail component", + "zendframework/zend-validator": "Zend\\Validator component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "component for general purpose logging", + "keywords": [ + "log", + "logging", + "zf2" + ], + "time": "2014-04-15 15:28:45" + }, + { + "name": "zendframework/zend-math", + "version": "2.3.1", + "target-dir": "Zend/Math", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMath.git", + "reference": "be6de5ba3d47e3f9a6732badea8bc724c49d0552" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMath/zipball/be6de5ba3d47e3f9a6732badea8bc724c49d0552", + "reference": "be6de5ba3d47e3f9a6732badea8bc724c49d0552", + "shasum": "" + }, + "require": { + "php": ">=5.3.23" + }, + "suggest": { + "ext-bcmath": "If using the bcmath functionality", + "ext-gmp": "If using the gmp functionality", + "ircmaxell/random-lib": "Fallback random byte generator for Zend\\Math\\Rand if OpenSSL/Mcrypt extensions are unavailable", + "zendframework/zend-servicemanager": ">= current version, if using the BigInteger::factory functionality" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Math\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "math", + "zf2" + ], + "time": "2014-04-15 15:29:09" + }, + { + "name": "zendframework/zend-modulemanager", + "version": "2.3.1", + "target-dir": "Zend/ModuleManager", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendModuleManager.git", + "reference": "bfff608492fdfea1f2b815285e0ed8b467a99c9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendModuleManager/zipball/bfff608492fdfea1f2b815285e0ed8b467a99c9f", + "reference": "bfff608492fdfea1f2b815285e0ed8b467a99c9f", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-config": "self.version", + "zendframework/zend-console": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-servicemanager": "self.version" + }, + "suggest": { + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-console": "Zend\\Console component", + "zendframework/zend-loader": "Zend\\Loader component", + "zendframework/zend-mvc": "Zend\\Mvc component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\ModuleManager\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "modulemanager", + "zf2" + ], + "time": "2014-04-15 15:28:50" + }, + { + "name": "zendframework/zend-mvc", + "version": "2.3.1", + "target-dir": "Zend/Mvc", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendMvc.git", + "reference": "d7708af7028aa6c42255fe2d9ece53f0e5d76e2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendMvc/zipball/d7708af7028aa6c42255fe2d9ece53f0e5d76e2c", + "reference": "d7708af7028aa6c42255fe2d9ece53f0e5d76e2c", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-authentication": "self.version", + "zendframework/zend-console": "self.version", + "zendframework/zend-di": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-form": "self.version", + "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-inputfilter": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-log": "self.version", + "zendframework/zend-modulemanager": "self.version", + "zendframework/zend-serializer": "self.version", + "zendframework/zend-session": "self.version", + "zendframework/zend-text": "self.version", + "zendframework/zend-uri": "self.version", + "zendframework/zend-validator": "self.version", + "zendframework/zend-version": "self.version", + "zendframework/zend-view": "self.version" + }, + "suggest": { + "zendframework/zend-authentication": "Zend\\Authentication component for Identity plugin", + "zendframework/zend-config": "Zend\\Config component", + "zendframework/zend-console": "Zend\\Console component", + "zendframework/zend-di": "Zend\\Di component", + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-form": "Zend\\Form component", + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-i18n": "Zend\\I18n component for translatable segments", + "zendframework/zend-inputfilter": "Zend\\Inputfilter component", + "zendframework/zend-json": "Zend\\Json component", + "zendframework/zend-log": "Zend\\Log component", + "zendframework/zend-modulemanager": "Zend\\ModuleManager component", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-session": "Zend\\Session component for FlashMessenger, PRG, and FPRG plugins", + "zendframework/zend-stdlib": "Zend\\Stdlib component", + "zendframework/zend-text": "Zend\\Text component", + "zendframework/zend-uri": "Zend\\Uri component", + "zendframework/zend-validator": "Zend\\Validator component", + "zendframework/zend-version": "Zend\\Version component", + "zendframework/zend-view": "Zend\\View component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Mvc\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "mvc", + "zf2" + ], + "time": "2014-04-15 15:29:05" + }, + { + "name": "zendframework/zend-serializer", + "version": "2.3.1", + "target-dir": "Zend/Serializer", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendSerializer.git", + "reference": "3187aa2a9c9713932f84006700f922ee1253328d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendSerializer/zipball/3187aa2a9c9713932f84006700f922ee1253328d", + "reference": "3187aa2a9c9713932f84006700f922ee1253328d", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-json": "self.version", + "zendframework/zend-math": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-servicemanager": "self.version" + }, + "suggest": { + "zendframework/zend-servicemanager": "To support plugin manager support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Serializer\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides an adapter based interface to simply generate storable representation of PHP types by different facilities, and recover", + "keywords": [ + "serializer", + "zf2" + ], + "time": "2014-04-15 15:29:03" + }, + { + "name": "zendframework/zend-server", + "version": "2.3.1", + "target-dir": "Zend/Server", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendServer.git", + "reference": "b491a401b1710785b5dbf69e77ee2f13764fb0ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendEventManager/zipball/957faa0580c40ef6bf6cf3e87a36d594042fe133", - "reference": "957faa0580c40ef6bf6cf3e87a36d594042fe133", + "url": "https://api.github.com/repos/zendframework/Component_ZendServer/zipball/b491a401b1710785b5dbf69e77ee2f13764fb0ff", + "reference": "b491a401b1710785b5dbf69e77ee2f13764fb0ff", "shasum": "" }, "require": { "php": ">=5.3.23", + "zendframework/zend-code": "self.version", "zendframework/zend-stdlib": "self.version" }, "type": "library", @@ -171,7 +1275,7 @@ }, "autoload": { "psr-0": { - "Zend\\EventManager\\": "" + "Zend\\Server\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -179,30 +1283,34 @@ "BSD-3-Clause" ], "keywords": [ - "eventmanager", + "server", "zf2" ], "time": "2014-04-15 14:47:18" }, { - "name": "zendframework/zend-server", + "name": "zendframework/zend-servicemanager", "version": "2.3.1", - "target-dir": "Zend/Server", + "target-dir": "Zend/ServiceManager", "source": { "type": "git", - "url": "https://github.com/zendframework/Component_ZendServer.git", - "reference": "b491a401b1710785b5dbf69e77ee2f13764fb0ff" + "url": "https://github.com/zendframework/Component_ZendServiceManager.git", + "reference": "652ab6e142b7afd1eede8f0f33b47d2599786c84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/Component_ZendServer/zipball/b491a401b1710785b5dbf69e77ee2f13764fb0ff", - "reference": "b491a401b1710785b5dbf69e77ee2f13764fb0ff", + "url": "https://api.github.com/repos/zendframework/Component_ZendServiceManager/zipball/652ab6e142b7afd1eede8f0f33b47d2599786c84", + "reference": "652ab6e142b7afd1eede8f0f33b47d2599786c84", "shasum": "" }, "require": { - "php": ">=5.3.23", - "zendframework/zend-code": "self.version", - "zendframework/zend-stdlib": "self.version" + "php": ">=5.3.23" + }, + "require-dev": { + "zendframework/zend-di": "self.version" + }, + "suggest": { + "zendframework/zend-di": "Zend\\Di component" }, "type": "library", "extra": { @@ -213,7 +1321,7 @@ }, "autoload": { "psr-0": { - "Zend\\Server\\": "" + "Zend\\ServiceManager\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -221,10 +1329,10 @@ "BSD-3-Clause" ], "keywords": [ - "server", + "servicemanager", "zf2" ], - "time": "2014-04-15 14:47:18" + "time": "2014-04-15 15:28:43" }, { "name": "zendframework/zend-soap", @@ -325,6 +1433,48 @@ ], "time": "2014-04-15 15:28:48" }, + { + "name": "zendframework/zend-text", + "version": "2.3.1", + "target-dir": "Zend/Text", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendText.git", + "reference": "74215098b67b89e61ed8d1bf82c4fe79fa311885" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendText/zipball/74215098b67b89e61ed8d1bf82c4fe79fa311885", + "reference": "74215098b67b89e61ed8d1bf82c4fe79fa311885", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\Text\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "keywords": [ + "text", + "zf2" + ], + "time": "2014-04-15 15:29:13" + }, { "name": "zendframework/zend-uri", "version": "2.3.1", @@ -428,6 +1578,80 @@ "zf2" ], "time": "2014-04-15 15:28:42" + }, + { + "name": "zendframework/zend-view", + "version": "2.3.1", + "target-dir": "Zend/View", + "source": { + "type": "git", + "url": "https://github.com/zendframework/Component_ZendView.git", + "reference": "71b6c73d4ba2f5908fe64b2a554064b22443e327" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/Component_ZendView/zipball/71b6c73d4ba2f5908fe64b2a554064b22443e327", + "reference": "71b6c73d4ba2f5908fe64b2a554064b22443e327", + "shasum": "" + }, + "require": { + "php": ">=5.3.23", + "zendframework/zend-eventmanager": "self.version", + "zendframework/zend-loader": "self.version", + "zendframework/zend-stdlib": "self.version" + }, + "require-dev": { + "zendframework/zend-authentication": "self.version", + "zendframework/zend-escaper": "self.version", + "zendframework/zend-feed": "self.version", + "zendframework/zend-filter": "self.version", + "zendframework/zend-http": "self.version", + "zendframework/zend-i18n": "self.version", + "zendframework/zend-json": "self.version", + "zendframework/zend-mvc": "self.version", + "zendframework/zend-navigation": "self.version", + "zendframework/zend-paginator": "self.version", + "zendframework/zend-permissions-acl": "self.version", + "zendframework/zend-servicemanager": "self.version", + "zendframework/zend-uri": "self.version" + }, + "suggest": { + "zendframework/zend-authentication": "Zend\\Authentication component", + "zendframework/zend-escaper": "Zend\\Escaper component", + "zendframework/zend-feed": "Zend\\Feed component", + "zendframework/zend-filter": "Zend\\Filter component", + "zendframework/zend-http": "Zend\\Http component", + "zendframework/zend-i18n": "Zend\\I18n component", + "zendframework/zend-json": "Zend\\Json component", + "zendframework/zend-mvc": "Zend\\Mvc component", + "zendframework/zend-navigation": "Zend\\Navigation component", + "zendframework/zend-paginator": "Zend\\Paginator component", + "zendframework/zend-permissions-acl": "Zend\\Permissions\\Acl component", + "zendframework/zend-servicemanager": "Zend\\ServiceManager component", + "zendframework/zend-uri": "Zend\\Uri component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev", + "dev-develop": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Zend\\View\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides a system of helpers, output filters, and variable escaping", + "keywords": [ + "view", + "zf2" + ], + "time": "2014-04-15 15:28:55" } ], "packages-dev": [ @@ -487,16 +1711,16 @@ }, { "name": "fabpot/php-cs-fixer", - "version": "v1.2", + "version": "v1.3", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "7aa4cff18c037935d07c27281a01fd4248a002c1" + "reference": "653cefbf33241185b58f7323157f1829552e370d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/7aa4cff18c037935d07c27281a01fd4248a002c1", - "reference": "7aa4cff18c037935d07c27281a01fd4248a002c1", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/653cefbf33241185b58f7323157f1829552e370d", + "reference": "653cefbf33241185b58f7323157f1829552e370d", "shasum": "" }, "require": { @@ -515,7 +1739,7 @@ "type": "application", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -528,13 +1752,17 @@ "MIT" ], "authors": [ + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" } ], "description": "A script to automatically fix Symfony Coding Standard", - "time": "2014-11-30 13:11:14" + "time": "2014-12-12 06:09:01" }, { "name": "league/climate", @@ -1479,63 +2707,6 @@ "homepage": "http://symfony.com", "time": "2014-12-02 20:15:53" }, - { - "name": "symfony/console", - "version": "v2.6.1", - "target-dir": "Symfony/Component/Console", - "source": { - "type": "git", - "url": "https://github.com/symfony/Console.git", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", - "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Console Component", - "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" - }, { "name": "symfony/dependency-injection", "version": "v2.5.8", @@ -1698,100 +2869,6 @@ "homepage": "http://symfony.com", "time": "2014-12-02 20:15:53" }, - { - "name": "symfony/finder", - "version": "v2.6.1", - "target-dir": "Symfony/Component/Finder", - "source": { - "type": "git", - "url": "https://github.com/symfony/Finder.git", - "reference": "0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721", - "reference": "0d3ef7f6ec55a7af5eca7914eaa0dacc04ccc721", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Finder Component", - "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" - }, - { - "name": "symfony/process", - "version": "v2.6.1", - "target-dir": "Symfony/Component/Process", - "source": { - "type": "git", - "url": "https://github.com/symfony/Process.git", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/bf0c9bd625f13b0b0bbe39919225cf145dfb935a", - "reference": "bf0c9bd625f13b0b0bbe39919225cf145dfb935a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "autoload": { - "psr-0": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Process Component", - "homepage": "http://symfony.com", - "time": "2014-12-02 20:19:20" - }, { "name": "symfony/stopwatch", "version": "v2.6.1", @@ -1843,11 +2920,23 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { + "composer/composer": 15, "phpmd/phpmd": 0 }, "prefer-stable": false, "platform": { "php": "~5.4.11|~5.5.0" }, - "platform-dev": [] + "platform-dev": { + "lib-libxml": "*", + "ext-ctype": "*", + "ext-gd": "*", + "ext-spl": "*", + "ext-dom": "*", + "ext-simplexml": "*", + "ext-mcrypt": "*", + "ext-hash": "*", + "ext-curl": "*", + "ext-iconv": "*" + } } diff --git a/dev/build/core_dev/api-functional/build.xml b/dev/build/core_dev/api-functional/build.xml index 6066ae56b78e5..58e04c0af6b1a 100644 --- a/dev/build/core_dev/api-functional/build.xml +++ b/dev/build/core_dev/api-functional/build.xml @@ -75,7 +75,6 @@ - diff --git a/dev/build/core_dev/api-functional/install-config-mysql.php b/dev/build/core_dev/api-functional/install-config-mysql.php index fc3da3acc2d47..279fd4e6c6b30 100644 --- a/dev/build/core_dev/api-functional/install-config-mysql.php +++ b/dev/build/core_dev/api-functional/install-config-mysql.php @@ -11,7 +11,6 @@ 'db_prefix' => '{{db_table_prefix}}', 'backend_frontname' => 'backend', 'base_url' => '{{url}}/', - 'base_url_secure' => '{{secure_url}}/', 'session_save' => 'db', 'admin_username' => \Magento\TestFramework\Bootstrap::ADMIN_NAME, 'admin_password' => \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD, diff --git a/dev/build/core_dev/functional/build.xml b/dev/build/core_dev/functional/build.xml index 36915bf83b4f5..74f53eab31f22 100644 --- a/dev/build/core_dev/functional/build.xml +++ b/dev/build/core_dev/functional/build.xml @@ -48,7 +48,6 @@ db_password: '', deploy_directory: '', http_host: ' (e.g. http://myhost.com/mypath/)', - https_host: ' (e.g. https://myhost.com/mypath/)', instance_count: '', selenium_browser: ' (e.g. firefox, googlechrome etc; see server.yml.dist)', selenium_host: '', @@ -197,13 +196,8 @@ - - - - - @@ -211,15 +205,35 @@ + + + + + + + + + + + - - + + + + + + + + + + + @@ -331,8 +345,7 @@ - + diff --git a/dev/build/core_dev/functional/config/install.php b/dev/build/core_dev/functional/config/install.php index 61ad412a0ea20..94b6889db8f61 100644 --- a/dev/build/core_dev/functional/config/install.php +++ b/dev/build/core_dev/functional/config/install.php @@ -13,8 +13,6 @@ 'db_name' => '{{db_name}}', 'db_user' => '{{db_user}}', 'db_pass' => '{{db_password}}', - 'use_secure' => '1', - 'use_secure_admin' => '1', 'admin_use_security_key' => '0', 'use_rewrites' => '1', 'admin_lastname' => 'Admin', @@ -23,7 +21,6 @@ 'admin_username' => 'admin', 'admin_password' => '123123q', // must be at least of 7 both numeric and alphanumeric characters 'base_url' => '{{url}}', - 'base_url_secure' => '{{secure_url}}', 'session_save' => 'db', 'backend_frontname' => 'backend', ], diff --git a/dev/build/core_dev/functional/config/install_data.yml.dist b/dev/build/core_dev/functional/config/install_data.yml.dist new file mode 100644 index 0000000000000..a9d5c87a2ee31 --- /dev/null +++ b/dev/build/core_dev/functional/config/install_data.yml.dist @@ -0,0 +1,8 @@ +db_credentials: + dbHost: {{db_host}} + dbUser: {{db_user}} + dbPassword: {{db_password}} + dbName: {{db_name}} +url: + base_url: {{url}} + backend_frontname: backend diff --git a/dev/build/core_dev/functional/phpunit.xml b/dev/build/core_dev/functional/phpunit.xml index 479bac8b895b2..237b8135393e2 100644 --- a/dev/build/core_dev/functional/phpunit.xml +++ b/dev/build/core_dev/functional/phpunit.xml @@ -34,9 +34,11 @@ + + diff --git a/dev/build/core_dev/integration/build.xml b/dev/build/core_dev/integration/build.xml index 2accd4501c6ae..842d4cbdaed86 100644 --- a/dev/build/core_dev/integration/build.xml +++ b/dev/build/core_dev/integration/build.xml @@ -105,7 +105,7 @@ - + - @@ -126,7 +125,6 @@ - @@ -135,7 +133,6 @@ - @@ -144,7 +141,6 @@ - diff --git a/dev/build/core_dev/util.xml b/dev/build/core_dev/util.xml index 96ab53c7ad9e5..1c1cf9d988a65 100644 --- a/dev/build/core_dev/util.xml +++ b/dev/build/core_dev/util.xml @@ -128,9 +128,6 @@ - - - diff --git a/dev/build/publication/edition/ee.txt b/dev/build/publication/edition/ee.txt index b859f74c8ba92..46532f3ed11f9 100644 --- a/dev/build/publication/edition/ee.txt +++ b/dev/build/publication/edition/ee.txt @@ -39,6 +39,9 @@ dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Logging {app/code,dev/tests/{integration,unit}/testsuite}/Magento/PricePermissions {app/code,dev/tests/{integration,unit}/testsuite}/Magento/PromotionPermissions {app/code,dev/tests/{integration,unit}/testsuite}/Magento/Reminder +{app/code,dev/tests/{integration,unit}/testsuite}/Magento/Authorizenet +{app/code,dev/tests/{integration,unit}/testsuite}/Magento/Ogone +{app/code,dev/tests/{integration,unit}/testsuite}/Magento/Paypal {app/code,dev/tests/{integration,unit}/testsuite}/Magento/Reward dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Reward @@ -59,6 +62,7 @@ LICENSE_EE.txt app/design/adminhtml/Magento/backend/Magento_Enterprise/ app/design/adminhtml/Magento/backend/Magento_GiftRegistry/ app/design/adminhtml/Magento/backend/Magento_Rma/ +app/design/adminhtml/Magento/backend/Magento_VersionsCms/ app/design/frontend/Magento/{blank,luma}/Magento_AdvancedCheckout app/design/frontend/Magento/{blank,luma}/Magento_Banner app/design/frontend/Magento/{blank,luma}/Magento_CatalogEvent @@ -73,6 +77,9 @@ app/design/frontend/Magento/{blank,luma}/Magento_GiftWrapping app/design/frontend/Magento/{blank,luma}/Magento_Reward app/design/frontend/Magento/{blank,luma}/Magento_Rma app/design/frontend/Magento/{blank,luma}/Magento_Invitation +app/design/frontend/Magento/{black,luma}/Magento_Paypal +app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_payflowexpress_review.xml +app/code/Magento/CheckoutAgreements/view/frontend/layout/paypal_express_review.xml dev/tools/Magento/Tools/SampleData/config/config_ee.php dev/tools/Magento/Tools/SampleData/fixtures/GiftCard @@ -81,8 +88,14 @@ dev/tools/Magento/Tools/SampleData/fixtures/Widget/cmsblock_giftcard.csv dev/tools/Magento/Tools/SampleData/Module/GiftCard dev/tools/Magento/Tools/SampleData/fixtures/TargetRule dev/tools/Magento/Tools/SampleData/Module/TargetRule +dev/tools/Magento/Tools/SampleData/fixtures/GiftRegistry +dev/tools/Magento/Tools/SampleData/Module/GiftRegistry +dev/tools/Magento/Tools/SampleData/fixtures/MultipleWishlist +dev/tools/Magento/Tools/SampleData/Module/MultipleWishlist +dev/tools/Magento/Tools/SampleData/Module/CustomerBalance dev/tests/integration/testsuite/Magento/Test/Design/Frontend/Enterprise +dev/tests/integration/testsuite/Magento/Centinel/CreateOrderTest.php dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ee.php dev/tests/static/testsuite/Magento/Test/Js/_files/{whitelist,blacklist}/ee.txt diff --git a/dev/build/publication/edition/internal.txt b/dev/build/publication/edition/internal.txt index 4578fe1e4e0d2..9934e0ed1943a 100644 --- a/dev/build/publication/edition/internal.txt +++ b/dev/build/publication/edition/internal.txt @@ -1,6 +1,8 @@ # Files included in testing builds, but nor ready/approved for publication dev/tools/Magento/Tools/SampleData +dev/tests/integration/testsuite/Magento/Tools/SampleData + dev/tools/Magento/Tools/Formatter dev/tools/PHP-Parser diff --git a/dev/build/publication/edition/no-edition.txt b/dev/build/publication/edition/no-edition.txt index 5a1263edc0af4..e1e5021fe984e 100644 --- a/dev/build/publication/edition/no-edition.txt +++ b/dev/build/publication/edition/no-edition.txt @@ -5,8 +5,6 @@ dev/build/core_dev/performance/benchmark dev/tests/api-functional -dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php - dev/tests/performance/testsuite/benchmark dev/tests/performance/testsuite/fixtures/benchmark dev/tests/performance/apply_fixture.php diff --git a/dev/build/publication/extra_files/ce/.travis.yml b/dev/build/publication/extra_files/ce/.travis.yml index 96feeb1024811..3b0108dd1abc7 100644 --- a/dev/build/publication/extra_files/ce/.travis.yml +++ b/dev/build/publication/extra_files/ce/.travis.yml @@ -10,32 +10,42 @@ env: - TEST_SUITE=static_annotation matrix: exclude: - - php: 5.5 + - php: 5.4 env: TEST_SUITE=static_phpcs - - php: 5.5 + - php: 5.4 env: TEST_SUITE=static_annotation before_install: - sudo apt-get update -qq - sudo apt-get install -y -qq postfix before_script: - # mock mail + # Mock mail - sudo service postfix stop - smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 & - echo -e '#!/usr/bin/env bash\nexit 0' | sudo tee /usr/sbin/sendmail - - echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' | sudo tee "/home/travis/.phpenv/versions/`php -i | grep "PHP Version" | head -n 1 | grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini" + - > + echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' + | sudo tee "/home/travis/.phpenv/versions/`php -i + | grep "PHP Version" + | head -n 1 + | grep -o -P '\d+\.\d+\.\d+.*'`/etc/conf.d/sendmail.ini" # Disable xDebug - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - # Create DB for Integration tests - - sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then mysql -e 'create database magento_integration_tests;'; mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; fi" - # Install tools for static tests - - sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ] || [ '$TEST_SUITE' = 'static_annotation' ]; then pear install pear/PHP_CodeSniffer-1.5.2; fi" - # Change memmory_limit for travis server + # Install MySQL 5.6, create DB for integration tests + - > + sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then + sudo apt-get remove --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5; + sudo apt-get autoremove; + sudo apt-get autoclean; + sudo apt-add-repository ppa:ondrej/mysql-5.6 -y; + sudo apt-get update; + sudo apt-get install mysql-server-5.6 mysql-client-5.6; + mysql -uroot -e 'SET @@global.sql_mode = NO_ENGINE_SUBSTITUTION; CREATE DATABASE magento_integration_tests;'; + mv dev/tests/integration/etc/install-config-mysql.travis.php.dist dev/tests/integration/etc/install-config-mysql.php; + fi" + # Change memory_limit for travis - echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - phpenv rehash; - - composer install --no-interaction --prefer-source --dev - - cd setup - - composer install --no-interaction --prefer-source --dev - - cd .. + - composer install --no-interaction --dev script: # Unit tests - sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi" diff --git a/dev/build/publication/extra_files/ce/CHANGELOG.md b/dev/build/publication/extra_files/ce/CHANGELOG.md index 8808060ef8cdd..42f7ae6ca9371 100644 --- a/dev/build/publication/extra_files/ce/CHANGELOG.md +++ b/dev/build/publication/extra_files/ce/CHANGELOG.md @@ -1,3 +1,164 @@ +0.1.0-alpha108 +============= +* Service Contracts: + * Implemented Bundle Product API + * Replaced Address Converted model with Address Mapper + * Refactored Customer web service routes and API functional tests to use latest service layer + * Implemented Configurable Product Module API + * Removed obsolete namespace Magento\Catalog\Service +* Price calculation logic: + * Removed complex JS price calculation on the frontend +* Fixed bugs: + * Fixed an issue where the path parameter routes were incorrectly matched in the REST web services + * Fixed an issue where $0.00 was shown as a configurable product price if variation did not add anything to product price + * Fixed an issue where the fatal error occurred when a user with read-only permissions for cart price rules attempted to open an existing cart price rule + * Fixed an issue where the 'An order with subscription items was registered.' message was displayed in an order if it has been placed using an online payment method + * Fixed an issue where the 'Warning: Division by zero' message was displayed when an invoice was opened for an order placed using an online payment method + * Fixed an issue where creating simple product through using API service led to an exception on the frontend + * Fixed an issue where it was impossible to perform advanced search for price range of 0 to 0 + * Fixed an issue with the broken Search Terms Report page + * Fixed an issue with the broken Search Terms page + * Fixed an issue with a notice appearing in the Advanced Search when searching by a custom multiselect attribute + * Fixed an issue where Search did not work if word-request contained a hyphen + * Fixed an issue where searching by a title of bundle option returned empty result + * Fixed an issue where Maximum Query Length was not applied to Quick Search + * Fixed an issue where searching by product name did not return suggested search terms + * Fixed an issue with an incorrect dependency of the MySQL search adapter on CatalogSearch + * Fixed an issue with incorrect dependency of the Search library on the MySQL adapter + * Fixed an issue where Advanced Search always returned empty result for multiselect product attributes + * Fixed an issue where an admin user was redirected to the 404 page after deleting search terms through using mass action + * Fixed an issue where a product page was frozen when a configurable attribute was added to a current product template during saving a configurable product + * Fixed an issue where it was impossible to place an order with downloadable product that contained a link + * Fixed an issue where only parent category was displayed in layered navigation on the Search results page + * Fixed an issue where the Price attribute was incorrectly displayed in layered navigation if searching by this attribute + * Fixed an issue where importing configurable products set them out of stock + * Fixed an issue where drop-down lists were closing by themselves in Internet Explorer 9 + * Fixed an issue where it was impossible to place an order using PayPal Payment Pro and 3D Secure + * Fixed an issue where bundle items were always marked as 'User Defined' + * Fixed an issue where view management selectors did not work in categories on the frontend + * Fixed an issue where the 'Base' image label was not applied to a first product image uploaded + * Fixed an issue where editing a product led to data loss and broken media links + * Fixed an issue where attributes could not be deleted from the Google Content Attributes page + * Fixed an issue where a product was unassigned from a category after it was edited by an admin user with read/edit permissions for product price only + * Fixed an issue where the fatal error occurred on the RSS page for new products and special products + * Fixed an issue where the fatal error occurred when adding a new Customer Address Attribute + * Fixed an issue where it was impossible to install Magento when specific time zones were set + * Fixed an issue where compiler.php failed not handle inheritance from virtual classes + * Fixed an issue where some locales were absent in the 'Interface Locales' drop-down in the backend + * Fixed an issue where the Offloader header did not work in the backend + * Fixed an issue where autoloader failed to load custom classes + * Fixed an issue where products did not disappear from the shopping cart after checkout + * Fixed an issue where changing quantity of a product in the shopping cart removed product from cart + * Fixed an issue where the Persistent Shopping Cart functionality was not available if Luma theme was applied + * Fixed an issue where the category tree was broken if editing a category name in specific cases + * Fixed an issue where 'Price as Configured' value was not updated for a bundle product after changing the value of the 'Price View' field + * Fixed an issue where the final product price was displayed incorrectly in a category and a product page if price display setting was set to exclude FPT, FPT description, and final price + * Fixed an issue where product price range was displayed incorrectly for bundle products + * Fixed an issue where the HTTP 500 error occurred on the Share Wishlist page + * Fixed an issue with the incorrect order of dispatching event adminhtml_cms_page_edit_tab_content_prepare_form and setting form values in the backend + * Fixed an issue where breadcrumbs were not displaying the fullpath + * Fixed an issue where only two of four widgets added to a CMS page were displayed + * Fixed an issue where it was impossible to save locale for an admin account after changing it + * Fixed an issue where icons were not loaded on a non-secure pages if secure URLs were used in the frontend + * Fixed an issue where overriding layouts did not work after renaming a theme + * Fixed an issue where the Permissions tree was not displayed when activating an integration + * Fixed an issue with duplicated and corrupted page layouts + * Fixed an issue where the 'Number of Products per Page' option did not work for widgets of the 'List' type + * Fixed an issue where HTTP and HTTPS pages shared cache content + * Fixed an issue where the 'Use Billing Address' checkbox did not affect did not affect the checkout experience + * Fixed an issue where it was impossible to create shipping labels + * Fixed an issue where the 'Payment Method' section was empty in billing agreements in the frontend if a billing agreement was created during the checkout + * Fixed an issue with Catalog Rule Product indexer invalidating the price index + * Fixed an issue where one of the price range fields was corrupted in the Advanced Search page + * Fixed an issue where a base product image that was smaller than the gallery image container was scaled up to fill the container on the View Product page in the frontend + * Fixed the layout issue on the Contact Us page + * Fixed an issue where search queries were not submitted when a search suggestion was clicked + * Fixed an issue where page footer overlapped products in categories in Internet Explorer 11 + * Fixed UI issues in the Luma theme + * Fixed an issue when the fatal error occurred if a category was moved to another category that already contained category with the same URL key + * Fixed an issue where incorrect products were displayed on the Reviews tab for a configurable product + * Fixed an issue where fatal errors occurred when calling id() on a null store object + * Fixed an issue where navigation through the tabs on the Dashboard did not work properly + * Fixed an issue where prices for bundle products were incorrect on the category view and search view pages + * Fixed an issue where custom Customer attributes and Customer Address attributes were not displayed on the 'Create/Edit Customer' page in thebackend + * Fixed an issue where there were no validation for whether an option of a bundle product was created through the API + * Fixed an issue where bundle products created through using the API were not appearing in the frontend + * Fixed an issue where entity ID was missing for product thumbnail labels values + * Fixed an issue with the bad return from the Indexer launch() method + * Fixed an issue where an attempt to select product SKU in a shopping cart price rule redirected to the Dashboard + * Fixed an issue where the Search Terms Reports and Search Terms list did not work + * Fixed an issue where an error occurred when configuring Google API + * Fixed an issue where it was impossible to add a configurable product variation to an order in the backend + * Fixed an issue where there were no confirmation on deleting CMS pages/Blocks + * Fixed an issue with incorrect behavior of validation in the Quick Search field in the frontend + * Fixed an issue where it was impossible to select a row in the grid of CMS pages and CMS Blocks + * Fixed an issue where validation for minimum and maximum field value length was not performed for Customer attributes and Customer Address attributes when creating or editing a customer in the backend + * Fixed an issue with broken 'validate-digits-range' validation + * Fixed an issue where it was impossible to delete product templates + * Fixed an issue where products were not shown on a second website + * Fixed an issue where customer group was empty when adding group price during creating a product + * Fixed an issue with incorrect interval in LN for small values + * Fixed an issue where product attribute of the Price type was not displayed in layered navigation + * Fixed an issue with testCreateCustomer failing in parallel run + * Fixed an issue with the value of the 'Bill to Name' field always displayed instead of the value of the 'Ship to Name' in all order-related grids + * Fixed an issue where an error occurred when submitting an order int he backend when shipping and billing addresses were different + * Fixed an issue where the navigation menu was absent on product pages with Varnish used + * Fixed an issue where the underscore character was incorrectly handled when used with digits + * Fixed an issue where it was impossible to localize comments in the 'Max Emails Allowed to be Sent' and 'Email Text Length Limit' fields in the Wishlist configuration + * Fixed an issue where there were a logical error in joining the same table two times with different aliases +* Sample data: + * Created Luma Sample Data script +* GitHub requests: + * [#775](https://github.com/magento/magento2/issues/775) -- Can't save changes in configuration in Configuration->Advanced->System + * [#716](https://github.com/magento/magento2/issues/716) -- Wrong mimetype returned by getMimeType from Magento library + * [#681](https://github.com/magento/magento2/issues/681) -- Magento\Framework\Xml\Parser class issues + * [#758](https://github.com/magento/magento2/issues/758) -- Coding standards: arrays + * [#169](https://github.com/magento/magento2/issues/169) -- DDL cache should be tagged + * [#738](https://github.com/magento/magento2/issues/738) -- pub/setup missing in 0.1.0-alpha103 +* Various improvements: + * Removed obsolete code from the Tax and Weee modules + * Merged the AdminNotification, Integration, Authorization, and WebAPI SQL scripts + * Removed the Customer Converter model and Address Converter model + * Created AJAX Authentication Endpoint for the frontend + * Removed Customer\Service\V1 service implementation in favor of the Customer\Api service implementation + * Removed the Recurring Billing functionality + * Added the 'suggest' node to composer.json files to mark modules that are optional + * Consolidated SQL install and data scripts for the rest of the modules + * Added static test verifying that README.md file exist in modules + * Removed obsolete code + * Removed license notices in files + * Eliminated invalid dependencies of the CatalogRule module + * Removed @deprecated methods from the code base + * Added test enforcing @covers annotation refers to only existing classes and methods + * Added the PHP Coding Standards Fixer configuration file to the project root + * Added Git hook to automatically correct coding style before actual push + * Added the ability to enforce no error log messages during tests execution + * Removed API interfaces from the Cms module + * Updated jQuery used to version 1.11 + * Added wildcard prefix for all search words in search requests for Match query + * Renamed frontend properties for some of the product attributes + * Fixed the Magento\Centinel\CreateOrderTest integration test + * Improved invoking for functional tests + * Refactored StoreManagerInterface to avoid violating the modularity principle + * Improved the logic in the isSubtotal method in Magento\Reports\Model\Resource\Report\Collection\AbstractCollection +* Framework improvements: + * Added a copy of dependencies for Magento components to the root composer.json file +* Setup Tool improvements: + * Moved dependencies from setup/composer.json to the root composer.json and removed the former one + * Removed dependencies on unnecessary ZF2 libraries + * Removed dependency on exec() calls + * Removed tool dev/shell/run_data_fixtures.php in favor of Setup Toolphp setup/index.php install-data + * Removed tool dev/shell/user_config_data.php in favor of Setup Tool php setup/index.php install-user-configuration + * Added validation of the required information on each installation step in the Setup tool: + * Web UI: + * Removed the 'Test Connection' button in web setup UI; checking connection to the database server is now performed when the 'Next' button is clicked + * Added validation of URL format + * Added automatic adding of the trailing slash to the base URL field if a user did not provide one + * Added validation of admin user password + * Added validation of HTTPS configuration + * CLI: + * Added validation of CLI to display missing/extra parameters and missing/unnecessary parameter values + 0.1.0-alpha107 ============= * Various improvements: diff --git a/dev/build/publication/extra_files/ce/README.md b/dev/build/publication/extra_files/ce/README.md index 5a4d56047c98b..c960876710193 100644 --- a/dev/build/publication/extra_files/ce/README.md +++ b/dev/build/publication/extra_files/ce/README.md @@ -1,71 +1,22 @@ [![Build Status](https://travis-ci.org/magento/magento2.svg?branch=master)](https://travis-ci.org/magento/magento2) - +

    Welcome

    Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting edge, feature-rich eCommerce solution that gets results. -#### Contents - -* Magento 2 system requirements -* Composer and Magento -* High-level installation roadmap -* Required server permissions -* Prerequisites -* Installing Composer -* Cloning the Magento 2 GitHub repository -* Installing or reinstalling the Magento software -* Verifying the installation -* Troubleshooting - -

    Magento 2 system requirements

    - -Before you install Magento 2, make sure your system meets or exceeds the following requirements: - -* Operating systems - - Linux distributions such as RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, and so on - -* Composer (latest stable version) -* Apache 2.2 or later -* PHP 5.4.11 or 5.5.x -* Required PHP extensions: - - * PDO/MySQL - * mbstring - * mcrypt - * mhash - * simplexml - * curl - * gd2, ImageMagick 6.3.7 (or later) or both - * soap - -* MySQL 5.6.x -* Mail Transfer Agent (MTA) or an SMTP server -* Optional but recommended: - - * php_xdebug2.2.0 or later (development environments only; can have an adverse effect on performance) - * PHPUnit (as a command-line tool) 4.1 or later - -

    Composer and Magento

    - -We now use Composer to install the Magento 2 software. Composer enables us to manage Magento 2, extensions, and their dependencies. +The installation instructions that used to be here are now published on our GitHub site. Use the information on this page to get started or go directly to the guide. -Composer provides you with the following advantages: +

    New to Magento? Need some help?

    +If you're not sure about the following, you probably need a little help before you start installing the Magento software: -* Enables you to reuse third-party libraries without bundling them with source code -* Component-based architecture with robust dependency management -* Manages dependencies to reduce extension conflicts and compatibility issues -* Versioned dependencies -* Semantic versioning -* Supports PHP Framework Interoperability standards +* Is the Magento software installed already? +* What's a terminal, command prompt, or Secure Shell (ssh)? +* Where's my Magento server and how do I access it? +* What's PHP? +* What's Apache? +* What's MySQL? -We'll have more information soon on how developers can use Composer to package extensions to distribute to Magento merchants and to other developers. +

    Step 1: Verify your prerequisites

    -

    High-level installation roadmap

    - -Following is a brief overview of how to install the Magento 2 software. - -

    Step 1: Verify your prerequisites

    - -Use the following table to verify you have the correct prerequisites to install the Magento 2 software. +Use the following table to verify you have the correct prerequisites to install the Magento software.
    @@ -75,772 +26,34 @@ Use the following table to verify you have the correct prerequisites to install - + - + - + - + - +
    For more information
    Apache 2.2 or laterApache 2.2 or 2.4 Ubuntu: apache -v
    CentOS: httpd -v
    ApacheApache
    PHP 5.4.11 or 5.5.xPHP 5.4.x (where x = 11 or later) or 5.5.x php -vPHPPHP Ubuntu
    PHP CentOS
    MySQL 5.6.x mysql -u [root user name] -pMySQLMySQL
    -

    Step 2: Prepare to install

    - -After verifying your prerequisites, perform the following tasks in order to prepare to install the Magento 2 software. - -1. Installing Composer -2. Cloning the Magento 2 GitHub repository - -

    Step 3: Install and verify

    - -1. Installing or reinstalling the Magento software -2. Verifying the installation - -

    Required server permissions

    - -Unless otherwise noted, all commands in this Readme must be entered as a user with `root` privileges and permission to write to the web server docroot. Depending on your system, that might mean you must use different user accounts or add users to the web server user group—provided that group has sufficient privileges. - -Installing software on Linux typically requires `root` privileges. You should generally not install the Magento 2 software in the web server docroot using `root` privileges; however, that is up to you. - -

    Prerequisites

    - -This section discusses how to install software required to install Magento 2. - -See one of the following sections: - -* Before you begin -* Apache -* PHP -* MySQL - - -

    Before you begin

    - -Before you install Magento, you must do all of the following: - -* Set up one or more hosts that meet the Magento 2 system requirements. -* Make sure you can back up your entire system at various points during the installation so you can roll back in the event of issues. - -

    Apache

    - -

    Installing Apache on Ubuntu

    - -
    1. Install Apache using the guidelines on the Ubuntu site.
    2. -
    3. Enable server rewrites: -
      • Apache 2.2: Use the guidelines on askubuntu.
      • -
      • Apache 2.4: Enter the following command: a2enmod rewrite
      -
    4. -
    5. Specify the type of directives that can be used in .htaccess. Magento uses .htaccess for redirects. For guidelines, see: -
      • Apache 2.2: The Apache 2.2 documentation.
      • -
      • Apache 2.4: The Apache 2.4 documentation.
        -Note that in Apache 2.4, the server's default site configuration file is /etc/apache2/sites-available/000-default.conf
        -For example, you can add the following to the bottom of 000-default.conf:
        -
        <Directory "/var/www">
        -AllowOverride [value from Apache site]
        -</Directory>
        -Note: You must change the value of AllowOverride in the directive for the directory to which you expect to install the Magento software. For example, to install in the web server docroot, edit the directive in <Directory /var/www>.
      -
    6. -
    7. Restart Apache: service apache2 restart
    - -

    Installing Apache on CentOS

    - -1. Install Apache: - - `yum -y install httpd` - - For additional information, see the Apache site. - -2. Enable server rewrites. - - **Note**: You must change the value of Allow Override in the directive for the directory to which you expect to install the Magento software. For example, to install in the web server docroot, edit the directive in <Directory "/var/www/html">. - -2. Set the type of directives that can be used in `.htaccess`. Magento uses `.htaccess` for redirects. Apache documentation. - -3. Restart Apache: `service httpd restart` - -

    MySQL

    - -

    Installing MySQL on Ubuntu

    - -1. Install MySQL on Ubuntu 12 or Ubuntu 14. -2. Configure the database instance. - -

    Installing and configuring MySQL on CentOS

    - -The following procedure is based on Install MySQL Server 5.6 in CentOS 6.x and Red Hat 6.x Linux. - -1. Install the MySQL database: - -
    cd /tmp
    -wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
    -rpm -ivh mysql-community-release-el6-5.noarch.rpm
    -yum -y install mysql-server
    - -2. Start MySQL. - - `service mysqld start` - -3. Set a password for the root user and set other security-related options. Enter the following command and follow the prompts on your screen to complete the configuration. - - `mysql_secure_installation` - -

    Configuring the Magento database instance

    - -This section discusses how to create a new database instance for Magento. Although a new database instance is recommended, you can optionally install Magento into an existing database instance. - -To configure a MySQL database instance: - -1. Log in to your database server as any user. -2. Enter the following command to get to a MySQL command prompt: - - `mysql -u root -p` - -3. Enter the MySQL `root` user's password when prompted. -4. Enter the following commands in the order shown to create a database instance named `magento` with user name `magento`: -
    create database magento;
    -GRANT ALL ON magento.* TO magento@localhost IDENTIFIED BY 'magento';
    - -5. Enter `exit` to quit the command prompt. - -

    PHP

    - -Magento 2 requires PHP 5.4.11 or later or PHP 5.5.x. - -**Note**: Magento 2 does *not* support PHP 5.6. - -

    PHP 5.5 or 5.4 on Ubuntu

    - -
    Install PHP 5.5 on Ubuntu 14
    - -To install PHP 5.5 on Ubuntu 14: - -1. Enter the following command: - - `apt-get -y install php5` - -2. Verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
    PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep  4 2014 06:56:34)
    -	Copyright (c) 1997-2014 The PHP Group
    -	Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    -    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    - -
    Install PHP 5.5 on Ubuntu 12
    - -1. Use the following commands from dev-metal: - -
    add-apt-repository ppa:ondrej/php5
    -	apt-get update
    -	sudo apt-get install php5
    - -2. Verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
    PHP 5.5.18-1+deb.sury.org~precise+1 (cli) (built: Oct 17 2014 15:11:34)
    -	Copyright (c) 1997-2014 The PHP Group
    -	Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    -    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    - -
    Install PHP 5.4 on Ubuntu 12
    - -To install PHP 5.4 on Ubuntu 12: - -1. Use the following instructions from askubuntu: - -
    add-apt-repository ppa:ondrej/php5-oldstable
    -	apt-get update
    -	apt-get upgrade
    -	apt-get install php5
    - -2. Verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
    PHP 5.4.33-2+deb.sury.org~precise+1 (cli) (built: Sep 25 2014 09:06:25)
    -	Copyright (c) 1997-2014 The PHP Group
    -	Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    - -3. Restart Apache: `service apache2 restart` - -
    Upgrade to PHP 5.4 on Ubuntu
    - -To upgrade to PHP 5.4 on Ubuntu: - -1. Use the instructions on phpave. -2. After upgrading, verify the PHP version by entering `php -v`. Messages similar to the following should display: - -
    PHP 5.4.33-2+deb.sury.org~precise+1 (cli) (built: Sep 25 2014 09:06:25)
    -	Copyright (c) 1997-2014 The PHP Group
    -	Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    - -3. Restart Apache: `service apache2 restart` - -

    Install required PHP extensions on Ubuntu

    - -Enter the following command to install required PHP extensions: - -
    apt-get -y install php5 php5-mhash php5-mcrypt php5-curl php5-cli php5-mysql php5-gd
    - -

    Ubuntu 14 only: workaround for mcrypt issue

    - -There is a known issue in Ubuntu 14 with the `mcrypt` PHP extension. To work around the issue, see askubuntu. - -

    PHP 5.5 or 5.4 on CentOS

    - -PHP 5.3 is the default PHP version on CentOS distributions. Upgrade to PHP 5.4 using a repository like remi. - -The following resources are also available: - -* kb.parallels -* stackoverflow -* remi repository - -To verify if PHP is installed already, enter `php -v`. If PHP is *not* installed, install it by entering the following command: - -
    yum -y install php php-xml
    - -
    PHP 5.5 on CentOS
    - -To upgrade to PHP 5.5: - -There is more than one way to upgrade CentOS 6.5 to PHP 5.5; the following is a suggestion only. Consult a reference for additional options. - -Enter the following commands in the order shown. - -
    cd /tmp
    -rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
    -yum -y remove php-common-5.3.3-40.el6_6.x86_64
    -yum -y install php55w php55w-opcache
    - -Restart Apache: `service httpd restart` - -
    PHP 5.4 on CentOS
    - -To upgrade to PHP 5.4: - -1. Enter the following commands: - -
    cd /tmp
    -	rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    -	rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    -	yum -y --enablerepo=remi install httpd php php-common
    - -2. To verify PHP 5.4 is installed, enter `php -v`. The command displays results similar to the following: - -
    PHP 5.4.33 (cli) (built: Sep 20 2014 16:20:03)
    -	Copyright (c) 1997-2014 The PHP Group
    -	Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    - -3. Restart Apache: `service httpd restart` - -

    Install required PHP extensions on CentOS

    - -Enter the following command to install required PHP extensions: - -`yum -y --enablerepo=remi install php-xml php-mcrypt.x86_64 gd gd-devel php-gd php-mysql` - -

    Setting the PHP timezone (all operating systems)

    - -Before you install Magento, you might need to set the system time zone for PHP; otherwise, errors like the following display during the installation and time-related operations like cron might not work: - -`PHP Warning: date(): It is not safe to rely on the system's timezone settings.` [more messages follow] - -To set your time zone: - -1. Locate your server's time zone in the available time zone settings. -2. Locate `php.ini` by entering the following command: - - `php -i | grep "Loaded Configuration File"` - - Typical locations follow: - - Ubuntu: `/etc/php5/cli/php.ini` - - CentOS: `/etc/php.ini` - -3. Open `php.ini` in a text editor. - -4. Locate the following setting and uncomment it if necessary: - - `date.timezone =` - -5. Add the time zone setting you found in step 1. -6. Save your changes to `php.ini` and exit the text editor. - -

    Setting the PHP memory limit (all operating systems)

    - -Increase `memory_limit` in `php.ini` to at least 512MB for normal operation or 2GB for testing: - -1. Open one of the following in a text editor: - - * Ubuntu: `/etc/php5/apache2/php.ini` - * CentOS: `/etc/php.ini` -2. Change `memory_limit` to: - - `memory_limit = 512M` or more for normal operation - - `memory_limit = 2G` or more for testing - -3. Save your changes and exit the text editor. - -4. Restart Apache: - - Ubuntu: `service apache2 restart` - - CentOS: `service httpd restart` - - -

    Installing Composer

    - -To install Composer: - -1. Change to or create an empty directory on your Magento server. - -2. Enter the following commands: - -
    curl -sS https://getcomposer.org/installer | php
    -	mv composer.phar /usr/local/bin/composer
    - - For additional installation options, see the Composer installation documentation. - -

    Cloning the Magento 2 GitHub repository

    - -To clone the Magento 2 GitHub repository: - -1. Change to your web server's docroot directory. - - Typically, for Ubuntu, it's `/var/www` and for CentOS it's `/var/www/html`. - -2. Enter any of the following commands as a user with privileges to write to the web server docroot: - - To clone using HTTPS, use either of the following: - - `git clone https://github.com/magento/magento2.git` - - `git clone https://[your github.com user name]:[password]@github.com/magento/magento2.git` - - To clone using SSH: `git clone git@github.com:magento/magento2.git` - -3. Wait for the repository to clone on your server. - -**Note**: If you get an error that includes `Permission denied (publickey)`, see Troubleshooting. - -

    Installing or reinstalling the Magento 2 software

    - -Before you begin, make sure that: - -1. Your system meets the requirements discussed in Magento 2 system requirements. -2. You completed all prerequisite tasks discussed in Prerequisites. -3. You installed Composer. -4. You cloned the Magento 2 GitHub repository. - -

    Setting file system permissions and ownership before you install

    - -To make sure the installation completes successfully, we suggest the following file system permissions and ownership: - -* All files and directories owned by the web server user -* Certain directories must be writable - -

    Finding the web server user

    - -To find the web server user, enter one of the following commands: - -* Ubuntu: `ps -ef | grep apache2` -* CentOS: `grep User /etc/httpd/conf/httpd.conf` - -

    Pre-installation permissions and ownership

    - -Before the installation, set the following permissions: - -* All directories have 700 permissions `(drwx------)`. - - 700 permissions give full control (that is, read/write/execute) to the owner and no permissions to anyone else. - -* All files have 600 permissions `(-rw-------)`. - - 600 permissions mean the owner can read and write but other users have no permissions. - -

    Setting permissions and ownership

    - -1. To set ownership, enter the following commands as a user with `root` privileges: - -
    cd [your Magento installation directory]
    -	chown -R [web server user name] .
    - - CentOS example: - -
    cd /var/www/html/magento2
    -	chown -R apache .
    - - Ubuntu example: - -
    cd /var/www/magento2
    -	chown -R www-data .
    - -2. Set file and directory permissions: - -
    find . -type d -exec chmod 700 {} \;
    -	find . -type f -exec chmod 600 {} \;
    - -

    Getting started with your installation

    - -After you complete the tasks discussed in the preceding section, update Composer and run the installer: - -1. Log in to your Magento server as a user with `root` privileges. -2. Change to the Magento 2 installation directory. For example, - - `cd /var/www/html/magento2` - - **Note**: On Ubuntu, you might have to use the `sudo -s` or equivalent command to access this directory. - -3. As user with privileges to write to the web server docroot, enter `composer install` - - This command updates package dependencies and can take a few minutes to complete. - -4. Change to the Magento 2 `setup` subdirectory and enter `composer install`. - -**Note**: You must run `composer install` from *both* directories. - -

    Running the Magento 2 installer

    - -This section discusses how to run the command-line installer for Magento 2. - -**Note**: You must install Magento from its `setup` subdirectory. - -The installer is designed to be run multiple times if necessary so you can: - -* Provide different values - - For example, after you configure your web server for Secure Sockets Layer (SSL), you can run the installer to set SSL options. -* Correct mistakes in previous installations -* Install Magento in a different database instance - -**Note**: By default, the installer doesn't overwrite the Magento database if you install the Magento software in the same database instance. You can use the optional clean_database parameter to change this behavior. - -**Note**: If you get errors during the installation, see Troubleshooting. - -Before you begin, you can run the following commands to find values for some required options: - - - - - - - - - - - - - - - - - - - - -
    Installer optionCommand
    Languagephp -f index.php help languages
    Time zonephp -f index.php help timezones
    Currencyphp -f index.php help currencies
    - -

    The format of the command follows:

    - - php -f index.php install [--[installation option name]=[installation option value] ... - -

    The following table discusses the meanings of installation option names and values. An example is provided in Sample localhost installation.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameValueRequired?
    base_url

    Base URL to use to access your Magento Admin and storefront in the format http[s]://[host or ip]/[your Magento base dir]/.

    -

    Note: The scheme (http:// or https://) and a trailing slash are both required.

    -

    [your Magento base dir] is the docroot-relative path in which to install the Magento 2 software. Depending on how you set up your web server and virtual hosts, the path might be magento2 or it might be blank.

    -

    To access Magento on localhost, you can use either http://localhost/[your Magento base dir]/ or http://127.0.0.1/[your Magento base dir]/.

    -
    Yes
    backend_frontnamePath to access the Magento Admin. This path is appended to Base URL. -For example, if Base URL is http://www.example.com and Admin Path is admin, the Admin Panel's URL is http://www.example.com/admin—provided you configured your web server for server rewrites.Yes
    db_host

    Use any of the following:

    -
    • The database server's fully qualified host name or IP address.
    • -
    • localhost if your database serve is on the same host as your web server.
    • -
    • UNIX socket; for example, /var/run/mysqld/mysqld.sock
    -

    Note: You can optionally specify the database server port in its host name like www.example.com:9000

    -
    Yes
    db_nameName of the Magento database instance in which you want to install the Magento database tables.Yes
    db_userUser name of the Magento database instance owner.Yes
    db_passMagento database instance owner's password.No
    db_prefix

    Use only if you're installing the Magento database tables in a database instance that has Magento tables in it already.

    -

    In that case, use a prefix to identify the Magento tables for this installation. Some customers have more than one Magento instance running on a server with all tables in the same database.

    -

    This option enables those customers to share the database server with more than one Magento installation.

    No
    admin_firstnameMagento administrator user's first name.Yes
    admin_lastnameMagento administrator user's last name.Yes
    admin_emailMagento administrator user's e-mail address.Yes
    admin_usernameMagento administrator user name.Yes
    admin_passwordMagento administrator user password.Yes
    languageLanguage code to use in the Admin and storefront. (If you have not done so already, you can view the list of language codes by entering php -f index.php help languages from the setup directory.)Yes
    currencyDefault currency to use in the storefront. (If you have not done so already, you can view the list of currencies by entering php -f index.php help currencies from the setup directory.)Yes
    timezoneDefault time zone to use in the Admin and storefront. (If you have not done so already, you can view the list of time zones by entering php -f index.php help timezones from the setup directory.)Yes
    use_secure

    1 enables the use of Secure Sockets Layer (SSL) in all URLs (both Admin and storefront). Make sure your web server supports SSL before you select this option.

    -

    0 disables the use of SSL with Magento. In this case, all other secure URL options are assumed to also be 0.

    No
    base_secure_url

    1 means SSL is preferred in Magento URLs designed to use it (for example, the checkout page). Make sure your web server supports SSL before you select this option.

    -

    0 means SSL is not used.

    No
    use_secure_admin

    1 means you use SSL to access the Magento Admin. Make sure your web server supports SSL before you select this option.

    -

    0 means you do not use SSL with the Admin.

    No
    admin_use_security_key

    1 causes the Magento software to use a randomly generated key value to access pages in the Magento Admin and in forms. These key values help prevent cross-site script forgery attacks.

    -

    0 disables the use of the key.

    No
    session_save

    Use any of the following:

    -
    • files to store session data in the file system. File-based session storage is appropriate unless the Magento file system access is slow or you have a clustered database.
    • -
    • db.files to store session data in the database. Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.
    No
    keyIf you have one, specify a key to encrypt sensitive data in the Magento database. (This includes passwords and personally identifiable customer information.) If you don't have one, Magento generates one for you.No
    cleanup_databaseTo drop database tables before installing the Magento 2 software, specify this parameter without a value. Otherwise, the Magento database is left intact.No
    db_init_statementsAdvanced MySQL configuration parameter. Uses database initialization statements to run when connecting to the MySQL database. Consult a reference similar to this one before you set any values.No
    sales_order_increment_prefixSpecify a string value to use as a prefix for sales orders. Typically, this is used to guarantee unique order numbers for payment processors.No
    - -

    Sample localhost installation

    - -The following example installs Magento with the following options: - -* The Magento software is installed in the `magento2` directory relative to the web server docroot on `localhost` and the path to the Magento Admin is `admin`; therefore: - - Your storefront URL is `http://localhost` and you can access the Magento Admin at `http://localhost/admin` - -* The database server is on the same host as the web server. - - The database name is `magento`, and the user name and password are both `magento` - -* The Magento administrator has the following properties: - - * First and last name are is `Magento User` - * User name is `admin` and the password is `iamtheadmin` - * E-mail address is `user@example.com` - -* Default language is `en_US` (U.S. English) -* Default currency is U.S. dollars -* Default time zone is U.S. Central (America/Chicago) - -
    php -f index.php install --base_url=http://localhost/magento2/
    -	--backend_frontname=admin 
    -	--db_host=localhost --db_name=magento 
    -	--db_user=magento --db_pass=magento 
    -	--admin_firstname=Magento --admin_lastname=User 
    -	--admin_email=user@example.com 	--admin_username=admin 
    -	--admin_password=iamtheadmin --language=en_US
    -	--currency=USD --timezone=America/Chicago
    - -

    Reinstalling the Magento 2 software

    - -This section discusses how to install the Magento 2 software after you installed it previously. You might do this in an development environment especially to get all the latest code changes. - -To reinstall the Magento 2 software: - -1. Optionally delete and re-create the database instance. -2. Log in to your Magento server as a user with permissions to modify files in the Magento file system. -3. Enter the following commands in the order shown: - -
    cd [your Magento install dir]
    -git pull
    -composer install
    -cd setup
    -composer install
    - -4. Repeat the tasks discussed in Installing or reinstalling the Magento 2 software. - -

    Verifying the installation

    - -

    Verifying the storefront

    - -Go to the storefront in a web browser. For example, if your Magento 2 installation base URL is `http://www.example.com`, enter it in your browser's address or location bar. - -The following figure shows a sample storefront page. If it displays as follows, your installation was a success! - -

    Magento storefront which verifies a successful installation

    - -If the page appears unconfigured (no styles, only text), see Troubleshooting. - -

    Verifying the Magento Admin

    - -Go to the Magento Admin in a web browser. For example, if your Magento 2 installation base URL is `http://www.example.com`, and the Admin URL is `admin`, enter `http://www.example.com/admin` in your browser's address or location bar. - -(The Admin URL is specified by the value of the `backend_frontname` installation parameter.) - -When prompted, log in as a Magento Administrator. - -The following figure shows a sample Magento Admin page. If it displays as follows, your installation was a success! - -

    Magento Admin which verifies a successful installation

    - -If the page appears unconfigured (no styles, only text), see Troubleshooting. - -If you get a 404 (Not Found) error similar to the following, see Troubleshooting: - -`The requested URL /magento2index.php/admin/admin/dashboard/index/key/0c81957145a968b697c32a846598dc2e/ was not found on this server.` - -

    Troubleshooting

    - -### Problem: Cannot clone the Magento 2 GitHub repository - -**Detail**: Error is similar to the following: - -
    Cloning into 'magento2'...
    -Permission denied (publickey).
    -fatal: The remote end hung up unexpectedly
    - -**Solution**: Upload your SSH key to GitHub as discussed in the GitHub help page. - -### Problem: Cannot run 'composer install' - -**Suggestion**: Change to the directory in which you installed Composer and enter the following command: - -`mv composer.phar /usr/local/bin/composer` - -### Problem: During installation, PHP date warning - -**Details**: During the installation, the following message displays: - -`PHP Warning: date(): It is not safe to rely on the system's timezone settings. [more]` - -**Solution**: Set the PHP timezone properly. - -### Problem: During installation, the following fatal error displays: - -`PHP Fatal error: Class 'PDO' not found in /var/www/html/magento2/setup/module/Magento/Setup/src/Module/Setup/ConnectionFactory.php on line 44` - -**Solution**: Make sure you installed all required PHP extensions. - -### Problem: You cannot access Magento in a web browser - -**Details**: The following message displays when you try to access the Magento storefront or Admin: - -
    Whoops, it looks like you have an invalid PHP version.
    -Magento supports PHP 5.4.11 or newer. 
    - -**Solution**: Either upgrade PHP or restart Apache (Apache might not be using the same PHP version as is on the file system). - -To restart Apache: - -* Ubuntu: `service apache2 restart` -* CentOS: `service httpd restart` - -### Problem: Error after logging in to the Magento Admin: - -`The requested URL /magento2index.php/admin/admin/dashboard/index/key/0c81957145a968b697c32a846598dc2e/ was not found on this server.` - -Note the lack of a slash character between magento2 and index.php in the URL. - -**Solution**: The base URL is not correct. The base URL must start with http:// or https:// *and* it must end with a slash (/). Run the installation again with a valid value. +

    Step 2: Prepare to install

    -### Problem: After installing, images and stylesheets do not load; only text displays, no graphics. +After verifying your prerequisites, perform the following tasks in order to prepare to install the Magento software. -**Details**: The path to images and stylesheets is not correct, either because of an incorrect base URL or because server rewrites are not set up properly. To confirm this is the case, use a web browser inspector to check the paths to static assets and verify those assets are located on the Magento file system. +1. Install Composer +2. Clone the Magento repository -Magento 2 static assets should be located under `[your Magento install dir]/pub/static/` (there should be `frontend` and `adminhtml` directories). +

    Step 3: Install and verify the installation

    -Verify your server rewrites setting and your base URL and try again. +1. Update installation dependencies +2. Install Magento: + * Install Magento software using the web interface + * Install Magento software using the command line +2. Verify the installation diff --git a/dev/build/publication/sanity/ce.xml b/dev/build/publication/sanity/ce.xml index 2c96791f9201b..81bd98f50f75c 100644 --- a/dev/build/publication/sanity/ce.xml +++ b/dev/build/publication/sanity/ce.xml @@ -81,9 +81,6 @@ vendor - - setup/vendor - CHANGELOG.md diff --git a/dev/build/publication/sanity/ee.xml b/dev/build/publication/sanity/ee.xml index 84a7af267d6af..e34f49c8222f0 100644 --- a/dev/build/publication/sanity/ee.xml +++ b/dev/build/publication/sanity/ee.xml @@ -22,9 +22,6 @@ vendor - - setup/vendor - CHANGELOG CHANGELOG.md diff --git a/dev/shell/cache.php b/dev/shell/cache.php index 8c785d9ad9f63..91724bbb25c24 100644 --- a/dev/shell/cache.php +++ b/dev/shell/cache.php @@ -40,11 +40,8 @@ $params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null; $bootstrap = Bootstrap::create(BP, $params); /** @var ManagerApp $app */ - $app = $bootstrap->createApplication('Magento\Framework\App\Cache\ManagerApp', ['request' => $opt]); + $app = $bootstrap->createApplication('Magento\Framework\App\Cache\ManagerApp', ['requestArgs' => $opt]); $bootstrap->run($app); - echo "Current status:\n"; - var_export($app->getStatusSummary()); - echo "\n"; } catch (\Exception $e) { echo $e; exit(1); diff --git a/dev/shell/run_data_fixtures.php b/dev/shell/run_data_fixtures.php deleted file mode 100644 index 2dee5994febd1..0000000000000 --- a/dev/shell/run_data_fixtures.php +++ /dev/null @@ -1,18 +0,0 @@ -mergeFromArgv($_SERVER, $_SERVER); -if (!isset($params[AppState::PARAM_MODE])) { - $params[AppState::PARAM_MODE] = AppState::MODE_DEVELOPER; -} -$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params); -/** @var \Magento\Framework\Module\Updater $updater */ -$updater = $bootstrap->getObjectManager()->create('\Magento\Framework\Module\Updater'); -$updater->updateData(); diff --git a/dev/shell/user_config_data.php b/dev/shell/user_config_data.php deleted file mode 100644 index 355068f9060a2..0000000000000 --- a/dev/shell/user_config_data.php +++ /dev/null @@ -1,39 +0,0 @@ - - pairs of \'path=value\' separated by \'&\', where ' . PHP_EOL - . ' \'path\' is path of the specified data group, e.g. web/unsecure/base_url, and ' . PHP_EOL - . ' \'value\' is value for the path specified, e.g. http://127.0.0.1/ ' . PHP_EOL - . '--bootstrap - add or override parameters of the bootstrap' . PHP_EOL - . ' NOTE: this tool supports writing data only in global scope ' . PHP_EOL - . ' Example Usage: php -f user_config_data.php -- ' - . ' --data=' . escapeshellarg('web/seo/use_rewrites=1&web/unsecure/base_url=http://127.0.0.1/') . PHP_EOL; - -$opt = getopt('', ['data:']); -if (empty($opt)) { - echo $usage; - exit(0); -} - -try { - $dataParam = new ComplexParameter('data'); - $request = $dataParam->mergeFromArgv($_SERVER); - $bootstrapParam = new ComplexParameter('bootstrap'); - $params = $bootstrapParam->mergeFromArgv($_SERVER, $_SERVER); - $params[Bootstrap::PARAM_REQUIRE_MAINTENANCE] = null; - $bootstrap = Bootstrap::create(BP, $params); - /** @var \Magento\Backend\App\UserConfig $app */ - $app = $bootstrap->createApplication('Magento\Backend\App\UserConfig', ['request' => $request]); - $bootstrap->run($app); -} catch (\Exception $e) { - echo $e; - exit(1); -} diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php index 1c2eb23501c57..32eca4e225633 100644 --- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementMeTest.php @@ -10,7 +10,6 @@ use Magento\Integration\Model\Oauth\Token as TokenModel; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Helper\Customer as CustomerHelper; -use Magento\TestFramework\TestCase\WebapiAbstract; use Magento\Webapi\Model\Rest\Config as RestConfig; /** @@ -31,9 +30,9 @@ class AccountManagementMeTest extends \Magento\TestFramework\TestCase\WebapiAbst private $customerRepository; /** - * @var CustomerBuilder + * @var AccountManagementInterface */ - private $customerBuilder; + private $customerAccountManagement; /** * @var CustomerRegistry @@ -75,9 +74,10 @@ public function setUp() 'Magento\Customer\Api\CustomerRepositoryInterface', ['customerRegistry' => $this->customerRegistry] ); - $this->customerBuilder = Bootstrap::getObjectManager()->create( - 'Magento\Customer\Api\Data\CustomerDataBuilder' - ); + + $this->customerAccountManagement = Bootstrap::getObjectManager() + ->get('Magento\Customer\Api\AccountManagementInterface'); + $this->customerHelper = new CustomerHelper(); $this->customerData = $this->customerHelper->createSampleCustomer(); @@ -118,15 +118,9 @@ public function testChangePassword() $requestData = ['currentPassword' => 'test@123', 'newPassword' => '123@test']; $this->assertTrue($this->_webApiCall($serviceInfo, $requestData)); - $serviceInfo = [ - 'rest' => [ - 'resourcePath' => '/V1/customers/login', - 'httpMethod' => RestConfig::HTTP_METHOD_POST, - ], - ]; - $requestData = ['email' => $this->customerData[CustomerInterface::EMAIL], 'password' => '123@test']; - $customerResponseData = $this->_webApiCall($serviceInfo, $requestData); - $this->assertEquals($this->customerData[CustomerInterface::ID], $customerResponseData[CustomerInterface::ID]); + $customerResponseData = $this->customerAccountManagement + ->authenticate($this->customerData[CustomerInterface::EMAIL], '123@test'); + $this->assertEquals($this->customerData[CustomerInterface::ID], $customerResponseData->getId()); } public function testUpdateCustomer() @@ -210,7 +204,7 @@ public function testGetCustomerActivateCustomer() */ protected function _getCustomerData($customerId) { - $data = $this->customerRepository->getById($customerId); + $data = $this->customerRepository->getById($customerId); $this->customerRegistry->remove($customerId); return $data; } diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php index 1229cb0f4be50..7511184acfb9e 100644 --- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/AccountManagementTest.php @@ -251,26 +251,6 @@ public function testGetCustomerActivateCustomer() $this->assertFalse(isset($customerResponseData[Customer::CONFIRMATION])); } - public function testAuthenticateCustomer() - { - $customerData = $this->_createCustomer(); - - $serviceInfo = [ - 'rest' => [ - 'resourcePath' => self::RESOURCE_PATH . '/login', - 'httpMethod' => RestConfig::HTTP_METHOD_POST, - ], - 'soap' => [ - 'service' => self::SERVICE_NAME, - 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'Authenticate', - ], - ]; - $requestData = ['email' => $customerData[Customer::EMAIL], 'password' => CustomerHelper::PASSWORD]; - $customerResponseData = $this->_webApiCall($serviceInfo, $requestData); - $this->assertEquals($customerData[Customer::ID], $customerResponseData[Customer::ID]); - } - public function testValidateResetPasswordLinkToken() { $customerData = $this->_createCustomer(); diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index c62e4dd43ee4d..1d80cfb8c4561 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "magento/mtf": "1.0.0-rc9", + "magento/mtf": "1.0.0-rc10", "php": ">=5.4.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", @@ -21,7 +21,6 @@ "Mtf\\": ["lib/Mtf/", "generated/Mtf/", "testsuites/Mtf/"], "Magento\\": ["generated/Magento/", "tests/app/Magento/"], "Test\\": "generated/Test/" - } } } diff --git a/dev/tests/functional/composer.json.dist b/dev/tests/functional/composer.json.dist index 00488d8d09689..2ea37c5b4a7aa 100644 --- a/dev/tests/functional/composer.json.dist +++ b/dev/tests/functional/composer.json.dist @@ -1,16 +1,16 @@ { "require": { - "magento/mtf": "dev-master", + "magento/mtf": "dev-develop", "php": ">=5.4.0", "phpunit/phpunit": "4.1.0", "phpunit/phpunit-selenium": ">=1.2", "netwing/selenium-server-standalone": ">=2.35" }, "autoload": { - "psr-0": { - "Mtf\\": "lib", - "Magento\\": "", - "": ["testsuites", "generated", "lib", "tests/app"] + "psr-4": { + "Mtf\\": ["lib/Mtf/", "generated/Mtf/", "testsuites/Mtf/"], + "Magento\\": ["generated/Magento/", "tests/app/Magento/"], + "Test\\": "generated/Test/" } } } diff --git a/dev/tests/functional/config/install_data.yml.dist b/dev/tests/functional/config/install_data.yml.dist new file mode 100644 index 0000000000000..4bffc0a19622d --- /dev/null +++ b/dev/tests/functional/config/install_data.yml.dist @@ -0,0 +1,9 @@ +# @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) +db_credentials: + dbHost: '127.0.0.1' + dbUser: 'root' + dbPassword: '123123q' + dbName: 'default' +url: + base_url: 'http://127.0.0.1/magento2/' + backend_frontname: 'backend' diff --git a/dev/tests/functional/lib/Mtf/App/State/State1.php b/dev/tests/functional/lib/Mtf/App/State/State1.php index 4efebde76be77..479f7bc0e2fc5 100644 --- a/dev/tests/functional/lib/Mtf/App/State/State1.php +++ b/dev/tests/functional/lib/Mtf/App/State/State1.php @@ -35,8 +35,10 @@ public function __construct(Config $config) public function apply() { parent::apply(); - $this->config->switchData('app_state1_configuration'); - $this->config->persist(); + if (file_exists(dirname(dirname(dirname(MTF_BP))) . '/app/etc/config.php')) { + $this->config->switchData('app_state1_configuration'); + $this->config->persist(); + } } /** diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php index e5a53c67fbaaf..358a5df3f25a7 100644 --- a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/ConditionsElement.php @@ -166,7 +166,7 @@ class ConditionsElement extends AbstractElement * * @var string */ - protected $ruleParamInput = '.element [name^="rule[conditions]"]'; + protected $ruleParamInput = '.element [name^="rule"]'; /** * Set value to conditions diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/GlobalsearchElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/GlobalsearchElement.php new file mode 100644 index 0000000000000..6d59992fcdfa3 --- /dev/null +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/GlobalsearchElement.php @@ -0,0 +1,192 @@ +_eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); + + $this->waitInitElement(); + + if (!$this->find($this->searchInput)->isVisible()) { + $this->find($this->searchIcon)->click(); + } + $this->selectWindow(); + $this->clear(); + $this->find($this->searchInput)->_getWrappedElement()->value($value); + $this->selectWindow(); + + $this->waitResult(); + } + + /** + * Clear value of element. + * + * @return void + */ + protected function clear() + { + $element = $this->find($this->searchInput); + while ('' != $element->getValue()) { + $element->keys([self::BACKSPACE]); + } + } + + /** + * Select to last window. + * + * @return void + */ + protected function selectWindow() + { + $windowHandles = $this->_driver->windowHandles(); + $this->_driver->window(end($windowHandles)); + } + + /** + * Wait init search suggest container. + * + * @return void + * @throws \Exception + */ + protected function waitInitElement() + { + $browser = clone $this; + $selector = $this->initializedSuggest; + + $browser->waitUntil( + function () use ($browser, $selector) { + return $browser->find($selector, Locator::SELECTOR_XPATH)->isVisible() ? true : null; + } + ); + } + + /** + * Wait for search result is visible. + * + * @return void + */ + public function waitResult() + { + $browser = clone $this; + $selector = $this->searchResult; + + $browser->waitUntil( + function () use ($browser, $selector) { + if ($browser->find($selector)->isVisible()) { + return true; + } else { + $browser->selectWindow(); + return null; + } + } + ); + } + + /** + * Get value. + * + * @throws \BadMethodCallException + */ + public function getValue() + { + throw new \BadMethodCallException('Not applicable for this class of elements (GlobalSearch)'); + } + + /** + * Checking exist value in search result. + * + * @param string $value + * @return bool + */ + public function isExistValueInSearchResult($value) + { + $searchResult = $this->find($this->searchResult); + if (!$searchResult->isVisible()) { + return false; + } + $searchResults = $this->getSearchResults(); + return in_array($value, $searchResults); + } + + /** + * Get search results. + * + * @return array + */ + protected function getSearchResults() + { + /** @var Element $searchResult */ + $searchResult = $this->find($this->searchResult); + $resultItems = $searchResult->find($this->resultItem)->getElements(); + $resultArray = []; + + /** @var Element $resultItem */ + foreach ($resultItems as $resultItem) { + $resultItemLink = $resultItem->find('a'); + $resultText = $resultItemLink->isVisible() + ? trim($resultItemLink->getText()) + : trim($resultItem->getText()); + $resultArray[] = $resultText; + } + + return $resultArray; + } +} diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php index 96ef33dad0a17..3457b67854d88 100644 --- a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/MultisuggestElement.php @@ -9,41 +9,40 @@ use Mtf\Client\Element\Locator; /** - * Class MultisuggestElement - * Typified element class for multi suggest element + * Typified element class for multi suggest element. */ class MultisuggestElement extends SuggestElement { /** - * Selector list choice + * Selector list choice. * * @var string */ protected $listChoice = './/ul[contains(@class,"mage-suggest-choices")]'; /** - * Selector choice item + * Selector choice item. * * @var string */ protected $choice = './/li/div[text()="%s"]/..'; /** - * Selector choice value + * Selector choice value. * * @var string */ protected $choiceValue = './/li[contains(@class,"mage-suggest-choice")]/div'; /** - * Selector remove choice item + * Selector remove choice item. * * @var string */ protected $choiceClose = '.mage-suggest-choice-close'; /** - * Set value + * Set value. * * @param array|string $values * @return void @@ -55,13 +54,14 @@ public function setValue($values) $this->clear(); foreach ((array)$values as $value) { if (!$this->isChoice($value)) { + $this->selectWindow(); parent::setValue($value); } } } /** - * Get value + * Get value. * * @return array */ @@ -81,7 +81,7 @@ public function getValue() } /** - * Check exist selected item + * Check exist selected item. * * @param string $value * @return bool @@ -92,7 +92,7 @@ protected function isChoice($value) } /** - * Clear element + * Clear element. * * @return void */ @@ -104,4 +104,15 @@ protected function clear() $choiceClose = $this->find($this->choiceClose); } } + + /** + * Select to last window. + * + * @return void + */ + protected function selectWindow() + { + $windowHandles = $this->_driver->windowHandles(); + $this->_driver->window(end($windowHandles)); + } } diff --git a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php index 1a4429d10c2b7..225f4634db5b0 100755 --- a/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php +++ b/dev/tests/functional/lib/Mtf/Client/Driver/Selenium/Element/SuggestElement.php @@ -14,6 +14,11 @@ */ class SuggestElement extends Element { + /** + * "Backspace" key code. + */ + const BACKSPACE = "\xEE\x80\x83"; + /** * Selector suggest input * @@ -45,11 +50,25 @@ public function setValue($value) { $this->_eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $this->find($this->suggest)->setValue($value); + $this->clear(); + $this->find($this->suggest)->_getWrappedElement()->value($value); $this->waitResult(); $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH)->click(); } + /** + * Clear value of element. + * + * @return void + */ + protected function clear() + { + $element = $this->find($this->suggest); + while ($element->getValue() != '') { + $element->keys([self::BACKSPACE]); + } + } + /** * Wait for search result is visible * diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index 3a26aa0bac228..3cfdfc5ccbdfe 100755 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -21,22 +21,23 @@ - + - + - - - - - - - - - + + + + + + + + + + diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMaxRequestedQtyFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMaxRequestedQtyFailMessage.php index 9beaa7e4a4b53..65e55b444f257 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMaxRequestedQtyFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMaxRequestedQtyFailMessage.php @@ -14,6 +14,10 @@ */ class AssertMaxRequestedQtyFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Error requested quantity message */ @@ -24,13 +28,6 @@ class AssertMaxRequestedQtyFailMessage extends AbstractConstraint */ const ERROR_MAXIMUM_QUANTITY_MESSAGE = 'The maximum quantity allowed for purchase is %d.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that requested quantity is more than allowed error message is displayed after adding products to cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMinRequestedQtyFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMinRequestedQtyFailMessage.php index 9dad90a04912d..e92242617f0bd 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMinRequestedQtyFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMinRequestedQtyFailMessage.php @@ -14,6 +14,10 @@ */ class AssertMinRequestedQtyFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Error requested quantity message */ @@ -24,13 +28,6 @@ class AssertMinRequestedQtyFailMessage extends AbstractConstraint */ const ERROR_MINIMUM_QUANTITY_MESSAGE = 'The minimum quantity allowed for purchase is %d.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that requested quantity is less than allowed error message is displayed after adding products to cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMsrpNotice.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMsrpNotice.php index a3a8c51d723a1..d0013df9ad1a4 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMsrpNotice.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertMsrpNotice.php @@ -14,12 +14,9 @@ */ class AssertMsrpNotice extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that notice is present that product with enabled MAP diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductConfiguringFromRequiringAttention.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductConfiguringFromRequiringAttention.php index b621ad6af1ce0..e028209c51be3 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductConfiguringFromRequiringAttention.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductConfiguringFromRequiringAttention.php @@ -15,18 +15,15 @@ */ class AssertProductConfiguringFromRequiringAttention extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success adding product to cart message */ const SUCCESS_MESSAGE = 'You added %s to your shopping cart.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that product can be configured and added to cart after added this product to cart by sku * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductIsOutOfStockFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductIsOutOfStockFailMessage.php index 02b0bb6de96e5..1897b7f6ae90c 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductIsOutOfStockFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductIsOutOfStockFailMessage.php @@ -14,18 +14,15 @@ */ class AssertProductIsOutOfStockFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Out of stock error message */ const ERROR_MESSAGE = 'Availability: Out of stock.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that out of stock error message is displayed after adding products to cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductRequiredAttentionFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductRequiredAttentionFailMessage.php index edef1e76c183a..d046d9dcd570c 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductRequiredAttentionFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductRequiredAttentionFailMessage.php @@ -14,18 +14,15 @@ */ class AssertProductRequiredAttentionFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Product requires attention error message */ const ERROR_MESSAGE = '%d %s requires your attention.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that product requires attention error message is displayed after adding products by sku to shopping cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductTierPriceMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductTierPriceMessage.php index 67423b56c6a15..5d52e0156d9ef 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductTierPriceMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductTierPriceMessage.php @@ -14,12 +14,9 @@ */ class AssertProductTierPriceMessage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product has tier price message appears after adding products by sku to shopping cart diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductWithPaymentAgreementsOrderFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductWithPaymentAgreementsOrderFailMessage.php index c3890b6ff1dd3..8b7924cf034f9 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductWithPaymentAgreementsOrderFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductWithPaymentAgreementsOrderFailMessage.php @@ -14,6 +14,10 @@ */ class AssertProductWithPaymentAgreementsOrderFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + // @codingStandardsIgnoreStart /** * Product with payment agreements can't be ordered with other items error message @@ -21,13 +25,6 @@ class AssertProductWithPaymentAgreementsOrderFailMessage extends AbstractConstra const ERROR_MESSAGE = 'Sorry, but items with payment agreements must be ordered one at a time To continue, please remove or buy the other items in your cart, then order this item by itself.'; // @codingStandardsIgnoreEnd - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error message that product with payment agreements can't be ordered with other items is displayed * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAbsentInRequiringAttention.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAbsentInRequiringAttention.php index 57f042ad79df6..98bdd7ac0f363 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAbsentInRequiringAttention.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAbsentInRequiringAttention.php @@ -13,12 +13,9 @@ */ class AssertProductsAbsentInRequiringAttention extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products are absent in requiring attention block. diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAddBySkuSuccessMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAddBySkuSuccessMessage.php index 0cea3a07d289c..4921efb139324 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAddBySkuSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertProductsAddBySkuSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertProductsAddBySkuSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success adding products to shopping cart message */ const SUCCESS_MESSAGE = 'You added %d %s to your shopping cart.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after adding products by sku to shopping cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIncrementsFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIncrementsFailMessage.php index 3339f4c72001c..e3a51833f8135 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIncrementsFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIncrementsFailMessage.php @@ -14,18 +14,15 @@ */ class AssertQtyIncrementsFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Qty increments error message */ const QTY_INCREMENTS_ERROR_MESSAGE = 'You can buy this product only in quantities of %d at a time.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that requested qty does not meet the increments error message is displayed after adding products to cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIsNotEnoughFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIsNotEnoughFailMessage.php index 6eea37449d8c8..db8a489509111 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIsNotEnoughFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertQtyIsNotEnoughFailMessage.php @@ -14,6 +14,10 @@ */ class AssertQtyIsNotEnoughFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Requested quantity is not available error message */ @@ -24,13 +28,6 @@ class AssertQtyIsNotEnoughFailMessage extends AbstractConstraint */ const LEFT_IN_STOCK_ERROR_MESSAGE = 'Only %d left in stock'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that requested quantity is not available error message is displayed after adding products by sku to cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertRequiringAttentionProductSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertRequiringAttentionProductSuccessDeleteMessage.php index 15b0cf20d1771..fd49476616791 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertRequiringAttentionProductSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertRequiringAttentionProductSuccessDeleteMessage.php @@ -13,18 +13,15 @@ */ class AssertRequiringAttentionProductSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success delete message. */ const SUCCESS_MESSAGE = 'You removed the item.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is present after requiring attention product has been deleted from cart. * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSkuNotFoundFailMessage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSkuNotFoundFailMessage.php index e67c5f69929a1..b8345daadc4f9 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSkuNotFoundFailMessage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSkuNotFoundFailMessage.php @@ -14,18 +14,15 @@ */ class AssertSkuNotFoundFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Sku not found error message */ const ERROR_MESSAGE = 'SKU not found in catalog.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that sku not found error message is displayed after adding products by sku to shopping cart * diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSpecifyProductOptionsLink.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSpecifyProductOptionsLink.php index f74be3dbd7ab1..3e7d7e027e69d 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSpecifyProductOptionsLink.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertSpecifyProductOptionsLink.php @@ -14,12 +14,9 @@ */ class AssertSpecifyProductOptionsLink extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that specify products options link is displayed after adding products to cart diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertWidgetOrderBySkuOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertWidgetOrderBySkuOnCategoryPage.php index 7914efa8e3ee0..c4124da00c6a2 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertWidgetOrderBySkuOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/Constraint/AssertWidgetOrderBySkuOnCategoryPage.php @@ -16,12 +16,9 @@ */ class AssertWidgetOrderBySkuOnCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Order By Sku widget displayed on frontend in Catalog diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromCustomerAccountTest/test.csv b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromCustomerAccountTest/test.csv index 0b7e03a589d9d..204b7f8a172fc 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromCustomerAccountTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromCustomerAccountTest/test.csv @@ -1,20 +1,20 @@ -"description";"products";"cartBlock";"orderOptions/sku";"orderOptions/qty";"config";"constraint";"issue" -"Two Simple products";"catalogProductSimple::default, catalogProductSimple::default";"cart, cart";"-, -";"1, 1";"-";"assertProductsAddBySkuSuccessMessage, assertProductPresentInShoppingCart";"" -"Simple product";"catalogProductSimple::default";"cart";"-";"1";"-";"assertProductsAddBySkuSuccessMessage, assertProductPresentInShoppingCart";"" -"Simple Out Of Stock";"catalogProductSimple::out_of_stock";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertProductIsOutOfStockFailMessage, assertCartIsEmpty";"" -"Simple product with qty > than available";"catalogProductSimple::default";"required_attention";"-";"26";"-";"assertProductRequiredAttentionFailMessage, assertQtyIsNotEnoughFailMessage, assertCartIsEmpty";"" -"Simple offline product";"catalogProductSimple::offline";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSkuNotFoundFailMessage, assertCartIsEmpty";"" -"Product, for which Visibility is set to Not Visible Individually";"catalogProductSimple::not_visible_individually";"cart";"-";"1";"-";"assertProductsAddBySkuSuccessMessage, assertProductIsNotEditable";"" -"Product, for which Qty is less than minimum allowed in cart";"catalogProductSimple::simple_with_cart_limits";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertMinRequestedQtyFailMessage, assertCartIsEmpty";"" -"Product, for which Qty exceeds maximum allowed in cart";"catalogProductSimple::simple_with_cart_limits";"required_attention";"-";"6";"-";"assertProductRequiredAttentionFailMessage, assertMaxRequestedQtyFailMessage, assertCartIsEmpty";"" -"Configurable product";"configurableProductInjectable::default";"required_attention";"-";"2";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty, assertProductConfiguringFromRequiringAttention";"" -"Bundle dynamic product ";"bundleProduct::bundle_dynamic_product";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty";"" -"Bundle fixed product";"bundleProduct::bundle_fixed_product";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty";"" -"Simple product with custom options";"catalogProductSimple::with_one_custom_option";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty";"" -"Simple product with custom options by compound sku";"catalogProductSimple::with_one_custom_option";"cart";"simpleWithOptionCompoundSku";"1";"-";"assertProductsAddBySkuSuccessMessage, assertProductPresentInShoppingCart";"" -"Simple product with qty increments";"catalogProductSimple::simple_with_qty_increments";"required_attention";"-";"3";"-";"assertProductRequiredAttentionFailMessage, assertQtyIncrementsFailMessage, assertCartIsEmpty";"Bug: MAGETWO-1541" -"Configurable product where all sub-items are disabled";"configurableProductInjectable::with_out_of_stock_item";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertProductIsOutOfStockFailMessage, assertCartIsEmpty";"" -"Simple product with tier price and qty > than available";"catalogProductSimple::simple_with_tier_price_and_qty";"required_attention";"-";"26";"-";"assertProductRequiredAttentionFailMessage, assertProductTierPriceMessage, assertCartIsEmpty";"" -"Product with displaying prices considering MAP settings";"catalogProductSimple::with_msrp";"required_attention";"-";"26";"msrp";"assertProductRequiredAttentionFailMessage, assertMsrpNotice, assertCartIsEmpty";"" -"Nonexistent product";"-";"required_attention";"nonExistentSku";"1";"-";"assertProductRequiredAttentionFailMessage, assertCartIsEmpty";"" -"Product with not valid qty";"catalogProductSimple::default";"required_attention";"-";"abc";"-";"assertCartIsEmpty";"" +"description";"products";"cartBlock";"orderOptions/sku";"orderOptions/qty";"config";"constraint" +"Two Simple products";"catalogProductSimple::default, catalogProductSimple::default";"cart, cart";"-, -";"1, 1";"-";"assertProductsAddBySkuSuccessMessage, assertProductPresentInShoppingCart" +"Simple product";"catalogProductSimple::default";"cart";"-";"1";"-";"assertProductsAddBySkuSuccessMessage, assertProductPresentInShoppingCart" +"Simple Out Of Stock";"catalogProductSimple::out_of_stock";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertProductIsOutOfStockFailMessage, assertCartIsEmpty" +"Simple product with qty > than available";"catalogProductSimple::default";"required_attention";"-";"26";"-";"assertProductRequiredAttentionFailMessage, assertQtyIsNotEnoughFailMessage, assertCartIsEmpty" +"Simple offline product";"catalogProductSimple::offline";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSkuNotFoundFailMessage, assertCartIsEmpty" +"Product, for which Visibility is set to Not Visible Individually";"catalogProductSimple::not_visible_individually";"cart";"-";"1";"-";"assertProductsAddBySkuSuccessMessage, assertProductIsNotEditable" +"Product, for which Qty is less than minimum allowed in cart";"catalogProductSimple::simple_with_cart_limits";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertMinRequestedQtyFailMessage, assertCartIsEmpty" +"Product, for which Qty exceeds maximum allowed in cart";"catalogProductSimple::simple_with_cart_limits";"required_attention";"-";"6";"-";"assertProductRequiredAttentionFailMessage, assertMaxRequestedQtyFailMessage, assertCartIsEmpty" +"Configurable product";"configurableProductInjectable::default";"required_attention";"-";"2";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty, assertProductConfiguringFromRequiringAttention" +"Bundle dynamic product ";"bundleProduct::bundle_dynamic_product";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty" +"Bundle fixed product";"bundleProduct::bundle_fixed_product";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty" +"Simple product with custom options";"catalogProductSimple::with_one_custom_option";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertSpecifyProductOptionsLink, assertCartIsEmpty" +"Simple product with custom options by compound sku";"catalogProductSimple::with_one_custom_option";"cart";"simpleWithOptionCompoundSku";"1";"-";"assertProductsAddBySkuSuccessMessage, assertProductPresentInShoppingCart" +"Simple product with qty increments";"catalogProductSimple::simple_with_qty_increments";"required_attention";"-";"3";"-";"assertProductRequiredAttentionFailMessage, assertQtyIncrementsFailMessage, assertCartIsEmpty" +"Configurable product where all sub-items are disabled";"configurableProductInjectable::with_out_of_stock_item";"required_attention";"-";"1";"-";"assertProductRequiredAttentionFailMessage, assertProductIsOutOfStockFailMessage, assertCartIsEmpty" +"Simple product with tier price and qty > than available";"catalogProductSimple::simple_with_tier_price_and_qty";"required_attention";"-";"26";"-";"assertProductRequiredAttentionFailMessage, assertProductTierPriceMessage, assertCartIsEmpty" +"Product with displaying prices considering MAP settings";"catalogProductSimple::with_msrp";"required_attention";"-";"26";"msrp";"assertProductRequiredAttentionFailMessage, assertMsrpNotice, assertCartIsEmpty" +"Nonexistent product";"-";"required_attention";"nonExistentSku";"1";"-";"assertProductRequiredAttentionFailMessage, assertCartIsEmpty" +"Product with not valid qty";"catalogProductSimple::default";"required_attention";"-";"abc";"-";"assertCartIsEmpty" diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromWidgetTest.php b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromWidgetTest.php index 1f2c069408eea..6202f510d8ab5 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromWidgetTest.php +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/AddProductsToCartBySkuFromWidgetTest.php @@ -33,6 +33,8 @@ * * @group Add_by_SKU_(CS) * @ZephyrId MAGETWO-29781 + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class AddProductsToCartBySkuFromWidgetTest extends AbstractAdvancedCheckoutEntityTest { @@ -41,21 +43,35 @@ class AddProductsToCartBySkuFromWidgetTest extends AbstractAdvancedCheckoutEntit * * @var WidgetInstanceIndex */ - protected static $widgetInstanceIndex; + protected $widgetInstanceIndex; /** * Widget instance edit page. * * @var WidgetInstanceEdit */ - protected static $widgetInstanceEdit; + protected $widgetInstanceEdit; /** * Order by SKU widget. * * @var Widget */ - protected static $widget; + protected $widget; + + /** + * Fixture Factory. + * + * @var FixtureFactory + */ + protected $fixtureFactory; + + /** + * Page AdminCache. + * + * @var AdminCache + */ + protected $adminCache; /** * Injection data. @@ -66,6 +82,8 @@ class AddProductsToCartBySkuFromWidgetTest extends AbstractAdvancedCheckoutEntit * @param CheckoutCart $checkoutCart * @param WidgetInstanceIndex $widgetInstanceIndex * @param WidgetInstanceEdit $widgetInstanceEdit + * @param FixtureFactory $fixtureFactory + * @param AdminCache $adminCache * @return void */ public function __inject( @@ -74,35 +92,29 @@ public function __inject( CustomerOrderSku $customerOrderSku, CheckoutCart $checkoutCart, WidgetInstanceIndex $widgetInstanceIndex, - WidgetInstanceEdit $widgetInstanceEdit + WidgetInstanceEdit $widgetInstanceEdit, + FixtureFactory $fixtureFactory, + AdminCache $adminCache ) { $this->cmsIndex = $cmsIndex; $this->customerAccountIndex = $customerAccountIndex; $this->customerOrderSku = $customerOrderSku; $this->checkoutCart = $checkoutCart; - self::$widgetInstanceIndex = $widgetInstanceIndex; - self::$widgetInstanceEdit = $widgetInstanceEdit; + $this->widgetInstanceIndex = $widgetInstanceIndex; + $this->widgetInstanceEdit = $widgetInstanceEdit; + $this->fixtureFactory = $fixtureFactory; + $this->adminCache = $adminCache; } /** * Create customer and widget. * * @param CustomerInjectable $customer - * @param FixtureFactory $fixtureFactory - * @param AdminCache $adminCache * @return array */ - public function __prepare(CustomerInjectable $customer, FixtureFactory $fixtureFactory, AdminCache $adminCache) + public function __prepare(CustomerInjectable $customer) { $customer->persist(); - self::$widget = $fixtureFactory->create( - '\Magento\AdvancedCheckout\Test\Fixture\Widget', - ['dataSet' => 'order_by_sku'] - ); - self::$widget->persist(); - $adminCache->open(); - $adminCache->getActionsBlock()->flushMagentoCache(); - $adminCache->getMessagesBlock()->waitSuccessMessage(); return ['customer' => $customer]; } @@ -121,10 +133,19 @@ public function test(CustomerInjectable $customer, $products, array $orderOption // Preconditions $products = $this->createProducts($products); $orderOptions = $this->prepareOrderOptions($products, $orderOptions); + $this->widget = $this->fixtureFactory->create( + '\Magento\AdvancedCheckout\Test\Fixture\Widget', + ['dataSet' => 'order_by_sku'] + ); + $this->widget->persist(); + $this->adminCache->open(); + $this->adminCache->getActionsBlock()->flushMagentoCache(); + $this->adminCache->getMessagesBlock()->waitSuccessMessage(); // Steps $this->cmsIndex->open(); $this->loginCustomer($customer); $this->cmsIndex->getLinksBlock()->openLink("My Account"); + $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem("Order by SKU"); $this->customerAccountIndex->getOrderBySkuBlock()->fillForm($orderOptions); $this->customerAccountIndex->getOrderBySkuBlock()->addToCart(); @@ -139,24 +160,15 @@ public function test(CustomerInjectable $customer, $products, array $orderOption } /** - * Clear shopping cart. + * Clear shopping cart and delete widget. * * @return void */ public function tearDown() { $this->checkoutCart->open()->getCartBlock()->clearShoppingCart(); - } - - /** - * Delete widget. - * - * @return void - */ - public static function tearDownAfterClass() - { - self::$widgetInstanceIndex->open(); - self::$widgetInstanceIndex->getWidgetGrid()->searchAndOpen(['title' => self::$widget->getTitle()]); - self::$widgetInstanceEdit->getPageActionsBlock()->delete(); + $this->widgetInstanceIndex->open(); + $this->widgetInstanceIndex->getWidgetGrid()->searchAndOpen(['title' => $this->widget->getTitle()]); + $this->widgetInstanceEdit->getPageActionsBlock()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/CreateWidgetOrderBySkuTest/test.csv b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/CreateWidgetOrderBySkuTest/test.csv index fac4ea5c8a76c..b1c992dcdb28e 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/CreateWidgetOrderBySkuTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/CreateWidgetOrderBySkuTest/test.csv @@ -1,2 +1,2 @@ -"widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint";"issue" -"orderBySku";"Order by SKU";"Magento Blank";"Title_%isolation%";"All Store Views";"order_by_sku_on_all_pages";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetOrderBySkuOnCategoryPage";"Bug: MAGETWO-29008" +"widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint"; +"orderBySku";"Order by SKU";"Magento Blank";"Title_%isolation%";"All Store Views";"order_by_sku_on_all_pages";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetOrderBySkuOnCategoryPage"; diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/DeleteProductsFromCartOfAdvancedCheckoutEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/DeleteProductsFromCartOfAdvancedCheckoutEntityTest/test.csv index 279d54938d2ae..11ffd49202e0c 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/DeleteProductsFromCartOfAdvancedCheckoutEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/TestCase/DeleteProductsFromCartOfAdvancedCheckoutEntityTest/test.csv @@ -1,6 +1,6 @@ -"products";"orderOptions/qty";"orderOptions/sku";"constraint";"issue" -"catalogProductSimple::offline, catalogProductSimple::simple_with_cart_limits";"1, 6";"-, -";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart";"" -"catalogProductSimple::out_of_stock";"1";"-";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart";"" -"configurableProductInjectable::default";"2";"-";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart";"" -"bundleProduct::bundle_dynamic_product";"1";"-";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart";"" -"-";"1";"nonExistentSku";"assertRequiringAttentionProductSuccessDeleteMessage, assertCartIsEmpty";"" \ No newline at end of file +"products";"orderOptions/qty";"orderOptions/sku";"constraint" +"catalogProductSimple::offline, catalogProductSimple::simple_with_cart_limits";"1, 6";"-, -";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart" +"catalogProductSimple::out_of_stock";"1";"-";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart" +"configurableProductInjectable::default";"2";"-";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart" +"bundleProduct::bundle_dynamic_product";"1";"-";"assertRequiringAttentionProductSuccessDeleteMessage, assertProductsAbsentInRequiringAttention, assertProductsAbsentInShoppingCart" +"-";"1";"nonExistentSku";"assertRequiringAttentionProductSuccessDeleteMessage, assertCartIsEmpty" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/etc/constraint.xml index 70802d78e2d91..8b886bfd9b096 100644 --- a/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/AdvancedCheckout/Test/etc/constraint.xml @@ -6,51 +6,51 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php new file mode 100644 index 0000000000000..69fbab87303b4 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/Page/Main.php @@ -0,0 +1,31 @@ +_rootElement->find($this->revenuePriceBlock)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/FormPageFooterActions.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/FormPageFooterActions.php deleted file mode 100644 index 7bebdcc662e96..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Block/System/Store/FormPageFooterActions.php +++ /dev/null @@ -1,32 +0,0 @@ -_rootElement->find($this->deleteButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php index 22d567e9e2829..4a0daeb8c3a2a 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchCustomerName.php @@ -15,12 +15,9 @@ */ class AssertGlobalSearchCustomerName extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer name is present in search results diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php index fd87317999993..412c3e680e70f 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchNoRecordsFound.php @@ -14,18 +14,15 @@ */ class AssertGlobalSearchNoRecordsFound extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected search result text */ const EXPECTED_RESULT = 'No records found.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that search result contains expected text * diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php index 9b5c2f328cb0a..e0d317250dc74 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchOrderId.php @@ -15,12 +15,9 @@ */ class AssertGlobalSearchOrderId extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order Id is present in search results diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php index b74d89ab739cf..f5cb9cd0e5730 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Constraint/AssertGlobalSearchProductName.php @@ -16,12 +16,9 @@ */ class AssertGlobalSearchProductName extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product name is present in search results diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml index b4ad0db67abb8..ac4a3670f2f0f 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/Dashboard.xml @@ -16,6 +16,11 @@ .page-title css selector + + Magento\Backend\Test\Block\Page\Main + .dashboard-main + css selector + Magento\Backend\Test\Block\Menu .navigation diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml index dd627c66fea4f..e4523af95b95a 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteGroup.xml @@ -11,10 +11,10 @@ #edit_form css selector - - Magento\Backend\Test\Block\System\Store\FormPageFooterActions - .content-footer + + Magento\Backend\Test\Block\System\Store\FormPageActions + .page-main-actions css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml index 574c0c90d4927..a8d71273b067d 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/DeleteWebsite.xml @@ -11,10 +11,10 @@ #edit_form css selector - - Magento\Backend\Test\Block\System\Store\FormPageFooterActions - .content-footer + + Magento\Backend\Test\Block\System\Store\FormPageActions + .page-main-actions css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml index 2cc738d80ea35..a1662ce9a9446 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Page/Adminhtml/StoreDelete.xml @@ -16,10 +16,10 @@ #edit_form css selector - - Magento\Backend\Test\Block\System\Store\FormPageFooterActions - .content-footer + + Magento\Backend\Test\Block\System\Store\FormPageActions + .page-main-actions css selector - + diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml index 792c6787056ef..e6f96b2219e9c 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/etc/constraint.xml @@ -6,15 +6,15 @@ --> - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php b/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php index 208e59d130eec..33e12ff62d1f5 100644 --- a/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Backup/Test/Constraint/AssertBackupInGrid.php @@ -14,12 +14,9 @@ */ class AssertBackupInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that one backup row is present in Backups grid diff --git a/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml index b912c9f142017..19c580a66f7a4 100644 --- a/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Backup/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - low + low diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Banners.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Banners.php index 9182244a227fc..89d719141d049 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Banners.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Banners.php @@ -9,8 +9,7 @@ use Mtf\Block\Block; /** - * Banners block - * Banner block in Banner widget on frontend + * Banner block in Banner widget on frontend. */ class Banners extends Block { @@ -22,7 +21,7 @@ class Banners extends Block protected $bannerText = '.banner-item'; /** - * Return Banner content + * Return Banner content. * * @return array */ diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Cart.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Cart.php index a4370c18433cc..64ffd25c7739f 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Cart.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Cart.php @@ -19,7 +19,7 @@ class Cart extends \Magento\Checkout\Test\Block\Cart * * @var string */ - protected $widgetBanner = '//div[contains(@class, "widget banners")]/ul/li[text()="%s"]'; + protected $widgetBanner = '//div[contains(@class, "block-banners")]/ul/li/div[contains(text(),"%s")]'; /** * Header welcome message selector. diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Category/View.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Category/View.php index bc68667687361..9e080b8b13de4 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Category/View.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Block/Category/View.php @@ -20,7 +20,7 @@ class View extends \Magento\Catalog\Test\Block\Category\View * * @var string */ - protected $widgetBanner = '//div[contains(@class, "widget banners")]/ul/li[text()="%s"]'; + protected $widgetBanner = '//div[contains(@class, "block-banners")]/ul/li/div[contains(text(),"%s")]'; /** * Header welcome message selector. diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerDeleteMessage.php index 310187d753915..fe224771ae6a9 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerDeleteMessage.php @@ -14,14 +14,11 @@ */ class AssertBannerDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The banner has been deleted.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'The banner has been deleted.'; /** * Assert that success delete message is appeared after banner has been deleted diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInGrid.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInGrid.php index 6f9e05ab0e706..eb2417b839207 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInGrid.php @@ -15,12 +15,9 @@ */ class AssertBannerInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created banner is found by name and has correct banner types, visibility, status diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInShoppingCart.php index 35b59c20266a2..ee9eb118d21c2 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerInShoppingCart.php @@ -20,12 +20,9 @@ */ class AssertBannerInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that banner presents on Shopping Cart page diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerMassDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerMassDeleteMessage.php index 08ac8e6462b84..b41c10c83b30a 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerMassDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerMassDeleteMessage.php @@ -15,18 +15,15 @@ */ class AssertBannerMassDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that appears after deletion via mass actions */ const SUCCESS_DELETE_MESSAGE = 'You deleted %d record(s).'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success delete message is appeared after banner has been deleted * diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCartRule.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCartRule.php index a410524f4bab8..47072ead8ef44 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCartRule.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCartRule.php @@ -16,12 +16,9 @@ */ class AssertBannerNotInCartRule extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted banner is absent on shopping cart rule creation page and can't be found by name diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCatalogRule.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCatalogRule.php index 3515bec8b0c57..29e3d9d3498f5 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCatalogRule.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInCatalogRule.php @@ -16,12 +16,9 @@ */ class AssertBannerNotInCatalogRule extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted banner is absent on catalog rule creation page and can't be found by name diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInGrid.php index b07d9f6058087..bbea7af6e6f2b 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertBannerNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted banner is absent in grid and can't be found by name diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInShoppingCart.php index 31751a454d373..d29e22c11c24a 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInShoppingCart.php @@ -20,12 +20,9 @@ */ class AssertBannerNotInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that banner is absent on Shopping Cart page diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInWidgetOptions.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInWidgetOptions.php index 65765a82f9784..9619ff03d860d 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInWidgetOptions.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotInWidgetOptions.php @@ -17,12 +17,9 @@ */ class AssertBannerNotInWidgetOptions extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted banner is absent in Widget options bunnerGrid and can't be found by name diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotOnCategoryPage.php index 3f76abdefc037..bd10240fca18d 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerNotOnCategoryPage.php @@ -18,12 +18,9 @@ */ class AssertBannerNotOnCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that banner is absent on specific category page diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerOnCategoryPage.php index 826339f037e35..5c493ef450534 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerOnCategoryPage.php @@ -18,12 +18,9 @@ */ class AssertBannerOnCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that banner presents on specific category page diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerSuccessSaveMessage.php index 23a36d3e44bf9..b4aa932b41bfb 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertBannerSuccessSaveMessage.php @@ -15,14 +15,11 @@ */ class AssertBannerSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'You saved the banner.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'You saved the banner.'; /** * Assert that after banner save "You saved the banner." successful message appears diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotator.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotator.php index 94e1895ad385e..6a80956fba8ed 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotator.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotator.php @@ -16,12 +16,9 @@ */ class AssertWidgetBannerRotator extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Banner Rotator widget displayed on frontent on Home page and on Advanced Search diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotatorOnProductPage.php b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotatorOnProductPage.php index 0838cc0f9fe0b..8bd019fc2c930 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotatorOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/Constraint/AssertWidgetBannerRotatorOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertWidgetBannerRotatorOnProductPage extends AssertWidgetOnProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Banner Rotator widget displayed on frontend on Product page diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/AssignRelatedPromotionsToBannerEntityTest.php b/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/AssignRelatedPromotionsToBannerEntityTest.php index 54835e86b4c02..fe78b05eeed9a 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/AssignRelatedPromotionsToBannerEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/AssignRelatedPromotionsToBannerEntityTest.php @@ -5,23 +5,23 @@ namespace Magento\Banner\Test\TestCase; -use Magento\Banner\Test\Fixture\BannerInjectable; +use Mtf\ObjectManager; +use Mtf\TestCase\Injectable; +use Mtf\Fixture\FixtureFactory; +use Magento\Cms\Test\Fixture\CmsPage; use Magento\Banner\Test\Fixture\Widget; -use Magento\Banner\Test\Page\Adminhtml\BannerIndex; -use Magento\Banner\Test\Page\Adminhtml\BannerNew; -use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Magento\Banner\Test\Fixture\BannerInjectable; use Magento\CatalogRule\Test\Fixture\CatalogRule; -use Magento\Cms\Test\Fixture\CmsPage; +use Magento\Banner\Test\Page\Adminhtml\BannerNew; +use Magento\Banner\Test\Page\Adminhtml\BannerIndex; use Magento\Customer\Test\Fixture\CustomerInjectable; -use Magento\CustomerSegment\Test\Fixture\CustomerSegment; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\SalesRule\Test\Fixture\SalesRuleInjectable; -use Mtf\Fixture\FixtureFactory; -use Mtf\TestCase\Injectable; +use Magento\CustomerSegment\Test\Fixture\CustomerSegment; /** - * Test Creation for assign Related Cart and Catalog Rules to BannerEntity - * * Test Flow: + * * Preconditions: * 1. Create customer * 2. Create CustomerSegment @@ -44,28 +44,28 @@ class AssignRelatedPromotionsToBannerEntityTest extends Injectable { /** - * BannerIndex page + * BannerIndex page. * * @var BannerIndex */ protected $bannerIndex; /** - * BannerNew page + * BannerNew page. * * @var BannerNew */ protected $bannerNew; /** - * Fixture Factory + * Fixture Factory. * * @var FixtureFactory */ protected $fixtureFactory; /** - * Inject pages + * Inject pages. * * @param BannerIndex $bannerIndex * @param BannerNew $bannerNew @@ -83,7 +83,7 @@ public function __inject( } /** - * Creation for assign Related Cart and Catalog Rules to BannerEntity test + * Creation for assign Related Cart and Catalog Rules to BannerEntity test. * * @param BannerInjectable $banner * @param CustomerInjectable|string $customer @@ -137,7 +137,7 @@ public function test( } /** - * Create Cart and Catalog Rules + * Create Cart and Catalog Rules. * * @param string $cartPriceRule * @param string $catalogPriceRule @@ -161,7 +161,7 @@ protected function createRules($catalogPriceRule, $cartPriceRule) } /** - * Create Customer + * Create Customer. * * @param string $customer * @return CustomerInjectable|null @@ -179,7 +179,7 @@ protected function createCustomer($customer) } /** - * Create Customer Segment + * Create Customer Segment. * * @param string $customerSegment * @return CustomerSegment|null @@ -197,7 +197,7 @@ protected function createCustomerSegment($customerSegment) } /** - * Create Product + * Create Product. * * @return CatalogProductSimple */ @@ -210,7 +210,7 @@ protected function createProduct() } /** - * Create banner + * Create banner. * * @param BannerInjectable $banner * @param CustomerSegment|string $customerSegment @@ -235,7 +235,7 @@ protected function createBanner($customerSegment, BannerInjectable $banner) } /** - * Create Widget + * Create Widget. * * @param string $widget * @param BannerInjectable $banner @@ -259,4 +259,15 @@ protected function createWidget($widget, BannerInjectable $banner) return $widget; } + + /** + * Deleted shopping cart price rules and catalog price rules. + * + * @return void + */ + public function tearDown() + { + ObjectManager::getInstance()->create('Magento\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); + ObjectManager::getInstance()->create('Magento\SalesRule\Test\TestStep\DeleteAllSalesRuleStep')->run(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/CreateWidgetBannerTest/test.csv b/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/CreateWidgetBannerTest/test.csv index 53be8b7afb771..06959205c1eeb 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/CreateWidgetBannerTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/TestCase/CreateWidgetBannerTest/test.csv @@ -1,3 +1,3 @@ -"widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint";"issue" -"bannerRotatorShoppingCartRules";"Banner Rotator";"Magento Blank";"Title_%isolation%";"All Store Views";"banner_on_all_pages";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetBannerRotator";"" -"bannerRotatorCatalogRules";"Banner Rotator";"Magento Blank";"Title_%isolation%";"All Store Views";"for_virtual_product";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetBannerRotatorOnProductPage";"Bug: MAGETWO-28836" \ No newline at end of file +"widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint" +"bannerRotatorShoppingCartRules";"Banner Rotator";"Magento Blank";"Title_%isolation%";"All Store Views";"banner_on_all_pages";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetBannerRotator" +"bannerRotatorCatalogRules";"Banner Rotator";"Magento Blank";"Title_%isolation%";"All Store Views";"for_virtual_product";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetBannerRotatorOnProductPage" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Banner/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Banner/Test/etc/constraint.xml index 506f37931ff22..8b9fe9a317154 100644 --- a/dev/tests/functional/tests/app/Magento/Banner/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Banner/Test/etc/constraint.xml @@ -6,45 +6,45 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php index 87f12ff64b2a1..2b39584bd185f 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleInCategory.php @@ -16,12 +16,9 @@ */ class AssertBundleInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check bundle product on the category page diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php index deb9c41f46142..2fd74a3e6e37e 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertBundleItemsOnProductPage extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed product bundle items data on product page equals passed from fixture preset diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php index ba01e34ddcf23..a0452c4bcf51e 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceType.php @@ -16,12 +16,9 @@ */ class AssertBundlePriceType extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Product price type diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php index 3128633d464b5..5dc36a9727af2 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundlePriceView.php @@ -15,12 +15,9 @@ */ class AssertBundlePriceView extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed price view for bundle product on product page equals passed from fixture. diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php index 7c9e55c95eb78..ac8080f613c13 100755 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductForm.php @@ -12,12 +12,9 @@ */ class AssertBundleProductForm extends AssertProductForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Formatting options for array values diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php index 2e29a70eccf80..459247667b2c8 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertTierPriceOnBundleProductPage.php @@ -15,12 +15,9 @@ */ class AssertTierPriceOnBundleProductPage extends AssertProductTierPriceOnProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Tier price block diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv index a5cb3ad71d77d..53d0c45423592 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest/test.csv @@ -1,15 +1,15 @@ -"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint";"issue" -"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku";"" -"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_options";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"Taxable Goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_fixed_and_custom_options";"all_types";"-";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType";"" -"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"Taxable Goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"with_not_required_options";"-";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView";"Bug: MAGETWO-26980" -"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_1";"drop_down_with_one_option_fixed_price";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage";"" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-159";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_2";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType";"" -"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage";"" -"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage";"" +"product/data/name";"product/data/sku_type";"product/data/sku";"product/data/status";"product/data/price_type";"product/data/price/value";"product/data/price/preset";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/is_in_stock";"product/data/weight_type";"product/data/weight";"product/data/category";"product/data/description";"product/data/group_price/preset";"product/data/special_price";"product/data/special_from_date/pattern";"product/data/special_to_date/pattern";"product/data/tier_price/preset";"product/data/price_view";"product/data/stock_data/use_config_manage_stock";"product/data/stock_data/manage_stock";"product/data/shipment_type";"product/data/bundle_selections/preset";"product/data/bundle_selections/products";"product/data/checkout_data/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/visibility";"product/data/use_config_gift_message_available";"product/data/gift_message_available";"constraint" +"BundleProduct %isolation%";"-";"bundle_sku_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Bundle Product Dynamic Required";"-";"-";"-";"-";"-";"-";"No";"No";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleItemsOnProductPage" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product offline";"Dynamic";"-";"-";"-";"Out of Stock";"Dynamic";"-";"category_%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Separately";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductNotSearchableBySku" +"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"Product online";"Dynamic";"-";"dynamic-200";"-";"In Stock";"Dynamic";"-";"category_%isolation%";"Bundle Product Dynamic";"-";"-";"-";"-";"-";"Price Range";"-";"-";"Together";"all_types_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_options";"-";"-";"Catalog, Search";"No";"Yes";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertProductInStock, assertBundleItemsOnProductPage, assertProductVisibleInCategory, assertBundlePriceView, assertBundlePriceType" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"-";"Fixed";"10";"fixed-15";"None";"-";"Fixed";"10";"-";"Bundle Product Fixed Required";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"100";"fixed-24";"Taxable Goods";"In Stock";"Fixed";"10";"category_%isolation%";"Bundle Product Fixed";"default";"-";"-";"-";"-";"As Low as";"-";"-";"Separately";"all_types_fixed";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"all_types_bundle_fixed_and_custom_options";"all_types";"-";"Catalog, Search";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductVisibleInCategory, assertBundleProductPage, assertProductInStock, assertGroupedPriceOnBundleProductPage, assertBundleItemsOnProductPage, assertBundlePriceView, assertBundlePriceType" +"BundleProduct %isolation%";"Fixed";"bundle_sku_%isolation%";"Product online";"Fixed";"10";"fixed-1";"Taxable Goods";"Out of Stock";"Fixed";"10";"category_%isolation%";"-";"-";"10";"m/d/Y";"m/d/Y +3 days";"-";"Price Range";"No";"Yes";"Together";"with_not_required_options";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product|catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"with_not_required_options";"-";"-";"Catalog";"No";"No";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertBundleProductPage, assertProductOutOfStock, assertBundlePriceView" +"BundleProduct %isolation%";"Dynamic";"bundle_sku_%isolation%";"-";"Dynamic";"-";"dynamic-50";"-";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"default";"As Low as";"No";"No";"Together";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductVirtual::50_dollar_product";"default";"-";"-";"Search";"-";"-";"assertProductSaveMessage, assertProductInGrid, assertBundleProductForm, assertProductSearchableBySku, assertBundleProductPage, assertBundleItemsOnProductPage, assertTierPriceOnBundleProductPage" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-8";"-";"-";"-";"-";"-";"-";"-";"20";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-32";"-";"-";"-";"-";"-";"-";"MAGETWO-23061";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"dynamic-40";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-115";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_1";"drop_down_with_one_option_fixed_price";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType, assertProductCustomOptionsOnBundleProductPage" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"110";"fixed-159";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"with_custom_options_2";"drop_down_with_one_option_percent_price";"-";"-";"-";"-";"assertProductSaveMessage, assertBundleInCategory, assertBundlePriceView, assertBundlePriceType" +"Bundle Dynamic %isolation%";"Dynamic";"sku_bundle_dynamic_%isolation%";"-";"Dynamic";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"default_dynamic";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage" +"Bundle Fixed %isolation%";"Fixed";"sku_bundle_fixed_%isolation%";"-";"Fixed";"10";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"second";"catalogProductSimple::100_dollar_product,catalogProductSimple::40_dollar_product";"default";"-";"-";"-";"-";"-";"assertProductSaveMessage" diff --git a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml index 60e36e2e0c762..7cc2fb2b69650 100644 --- a/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Bundle/Test/etc/constraint.xml @@ -6,7 +6,7 @@ --> - low + low @@ -15,30 +15,30 @@ - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php index 2a7baf8562675..1d70bd71d2f03 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php @@ -24,6 +24,13 @@ class AttributeForm extends FormTabs */ protected $closedToggle = '//*[contains(@class,"collapsable-wrapper") and not(contains(@class,"opened"))]//strong'; + /** + * Properties tab selector. + * + * @var string + */ + protected $propertiesTab = '#product_attribute_tabs_main'; + /** * Get data of the tabs. * @@ -37,22 +44,27 @@ class AttributeForm extends FormTabs */ public function getData(FixtureInterface $fixture = null, Element $element = null) { + $this->waitForElementVisible($this->propertiesTab); $data = []; if (null === $fixture) { foreach ($this->tabs as $tabName => $tab) { - $this->openTab($tabName); - $this->expandAllToggles(); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); - $data = array_merge($data, $tabData); + if ($this->isTabVisible($tabName)) { + $this->openTab($tabName); + $this->expandAllToggles(); + $tabData = $this->getTabElement($tabName)->getDataFormTab(); + $data = array_merge($data, $tabData); + } } } else { $isHasData = ($fixture instanceof InjectableFixture) ? $fixture->hasData() : true; $tabsFields = $isHasData ? $this->getFieldsByTabs($fixture) : []; foreach ($tabsFields as $tabName => $fields) { - $this->openTab($tabName); - $this->expandAllToggles(); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); - $data = array_merge($data, $tabData); + if ($this->isTabVisible($tabName)) { + $this->openTab($tabName); + $this->expandAllToggles(); + $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); + $data = array_merge($data, $tabData); + } } } @@ -85,10 +97,24 @@ public function openTab($tabName) ? $this->tabs[$tabName]['strategy'] : Locator::SELECTOR_CSS; $tab = $this->_rootElement->find($selector, $strategy); - $target = $this->browser->find('.logo');// Handle menu overlap problem + $target = $this->browser->find('.page-title .title');// Handle menu overlap problem $this->_rootElement->dragAndDrop($target); $tab->click(); - return $this; } + + /** + * Check if tab is visible. + * + * @param string $tabName + * @return bool + */ + protected function isTabVisible($tabName) + { + $selector = $this->tabs[$tabName]['selector']; + $strategy = isset($this->tabs[$tabName]['strategy']) + ? $this->tabs[$tabName]['strategy'] + : Locator::SELECTOR_CSS; + return $this->_rootElement->find($selector, $strategy)->isVisible(); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php index 5161864e1fab8..8d54abfe9a08a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -42,6 +42,13 @@ class Main extends Block */ protected $addGroupButton = '[data-ui-id="adminhtml-catalog-product-set-edit-add-group-button"]'; + /** + * Selector for note block element. + * + * @var string + */ + protected $noteBlock = '.attribute-set .title'; + /** * Move Attribute to Attribute Group * @@ -60,6 +67,9 @@ public function moveAttribute(array $attributeData, $attributeGroup = 'Product D $attributeGroupLocator = sprintf($this->groups, $attributeGroup); $target = $this->_rootElement->find($attributeGroupLocator, Locator::SELECTOR_XPATH); + $target->click(); // Handle small resolution screen issue + $this->browser->find($this->noteBlock)->click(); + $attributeLabelLocator = sprintf($this->attribute, $attribute); $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->dragAndDrop($target); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php index bc458acaea1b6..4abeb778750b4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php @@ -9,27 +9,26 @@ use Mtf\Client\Element; /** - * Class Attribute - * Product attribute massaction edit page + * Product attribute massaction edit page. */ class Attribute extends Form { /** - * CSS selector for 'save' button + * CSS selector for 'save' button. * * @var string */ - protected $saveButton = '[data-ui-id="attribute-save-button"]'; + protected $saveButton = '[data-ui-id="page-actions-toolbar-save-button"]'; /** - * XPath selector for checkbox that enables price editing + * XPath selector for checkbox that enables price editing. * * @var string */ protected $priceFieldEnablerSelector = '//*[@id="attribute-price-container"]/div[1]/div/label//*[@type="checkbox"]'; /** - * Enable price field editing + * Enable price field editing. * * @return void */ 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 98e6ef2e7c458..ef5d3093b922c 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 @@ -5,8 +5,10 @@ namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit; -use Magento\Backend\Test\Block\Widget\Tab; use Mtf\Client\Element\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. @@ -18,7 +20,7 @@ class ProductTab extends Tab * * @var string */ - protected $attributeSearch = "//div[contains(@data-role, '%s')]//*[@id='product-attribute-search-container']"; + protected $attributeSearch = "//div[contains(@data-role, 'product-details')]//*[@data-toggle='dropdown']/span"; /** * Selector for 'New Attribute' button. @@ -27,6 +29,13 @@ class ProductTab extends Tab */ protected $newAttributeButton = '[id^="create_attribute"]'; + /** + * Selector for search input field. + * + * @var string + */ + protected $searchAttribute = "//input[@data-role='product-attribute-search']"; + /** * Fixture mapping. * @@ -51,7 +60,18 @@ protected function dataMapping(array $fields = null, $parent = null) */ public function addNewAttribute($tabName) { - $this->_rootElement->find(sprintf($this->attributeSearch, $tabName), Locator::SELECTOR_XPATH)->click(); - $this->_rootElement->find($this->newAttributeButton)->click(); + $element = $this->_rootElement; + $selector = sprintf($this->attributeSearch, $tabName); + $element->waitUntil( + function () use ($element, $selector) { + return $element->find($selector, Locator::SELECTOR_XPATH)->isVisible() ? true : null; + } + ); + $addAttributeToggle = $element->find($selector, Locator::SELECTOR_XPATH); + $addAttributeToggle->click(); + if (!$addAttributeToggle->find($this->newAttributeButton)->isVisible()) { + $element->find($this->searchAttribute, Locator::SELECTOR_XPATH)->click(); + } + $element->find($this->newAttributeButton)->click(); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php index f6cb41f435de8..c7cb8cbc125aa 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Options/Type/DropDown.php @@ -9,20 +9,26 @@ use Mtf\Client\Element; /** - * Class DropDown - * Form "Option dropdown" on tab product "Custom options" + * Form "Option dropdown" on tab product "Custom options". */ class DropDown extends AbstractOptions { /** - * Add button css selector + * Add button css selector. * * @var string */ protected $buttonAddLocator = '[id$="_add_select_row"]'; /** - * Fill the form + * Name for title column. + * + * @var string + */ + protected $optionTitle = '.data-table th.col-name'; + + /** + * Fill the form. * * @param array $fields * @param Element $element @@ -30,6 +36,7 @@ class DropDown extends AbstractOptions */ public function fillOptions(array $fields, Element $element = null) { + $this->_rootElement->find($this->optionTitle)->click(); $this->_rootElement->find($this->buttonAddLocator)->click(); return parent::fillOptions($fields, $element); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php index 14ad4c5d53e6c..50939e39db4e5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/ProductDetails/CategoryIds.php @@ -9,20 +9,26 @@ use Mtf\Client\Element\Locator; /** - * Class CategoryIds - * Typified element class for category element + * Typified element class for category element. */ class CategoryIds extends MultisuggestElement { /** - * Selector suggest input + * Selector suggest input. * * @var string */ protected $suggest = '#category_ids-suggest'; /** - * Selector item of search result + * Selector for suggest element. + * + * @var string + */ + protected $suggestElement = '.mage-suggest.category-select'; + + /** + * Selector item of search result. * * @var string */ @@ -36,7 +42,7 @@ class CategoryIds extends MultisuggestElement protected $top = './ancestor::body//*[@class="page-main-actions"]'; /** - * Set value + * Set value. * * @param array|string $values * @return void @@ -44,6 +50,25 @@ class CategoryIds extends MultisuggestElement public function setValue($values) { $this->find($this->top, Locator::SELECTOR_XPATH)->click(); + $this->waitInitElement(); parent::setValue($values); } + + /** + * Wait init search suggest container. + * + * @return void + * @throws \Exception + */ + protected function waitInitElement() + { + $browser = clone $this; + $selector = $this->suggestElement; + + $browser->waitUntil( + function () use ($browser, $selector) { + return $browser->find($selector)->isVisible() ? true : null; + } + ); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php index 87076775194da..40e6a4d5d17b8 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php @@ -181,7 +181,7 @@ protected function createCustomAttribute(InjectableFixture $product, $tabName = if (!$this->checkAttributeLabel($attribute)) { /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab $tab */ $tab = $this->openTab($tabName); - $tab->addNewAttribute(); + $tab->addNewAttribute($tabName); $this->fillAttributeForm($attribute); $this->reinitRootElement(); } @@ -223,7 +223,6 @@ protected function showAdvancedSettings() public function openTab($tabName) { $this->showAdvancedSettings(); - return parent::openTab($tabName); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php index b4e9e628edb3a..8383790a3b026 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/ListCompare.php @@ -75,7 +75,7 @@ class ListCompare extends Block * * @var string */ - protected $isEmpty = 'p.empty'; + protected $isEmpty = 'div.empty:last-child'; /** * Selector for message block. @@ -145,6 +145,39 @@ function () use ($rootElement, $element) { return $data; } + /** + * Get item compare product attribute. + * + * @param string $key + * @return Element + */ + public function getCompareProductAttribute($key) + { + $rootElement = $this->_rootElement; + $element = $this->nameSelector; + $this->_rootElement->waitUntil( + function () use ($rootElement, $element) { + return $rootElement->find($element, Locator::SELECTOR_XPATH)->isVisible() ? true : null; + } + ); + return $this->_rootElement->find(sprintf($this->productAttribute, $key), Locator::SELECTOR_XPATH); + } + + /** + * Get item attribute. + * + * @param int $indexProduct + * @param string $attributeKey + * @return string + */ + public function getProductAttribute($indexProduct, $attributeKey) + { + return trim( + $this->getCompareProductAttribute($attributeKey) + ->find(sprintf($this->attributeSelector, $indexProduct), Locator::SELECTOR_XPATH)->getText() + ); + } + /** * Remove product from compare product list. * @@ -208,6 +241,7 @@ public function isProductVisibleInCompareBlock($productName = '') */ public function getEmptyMessage() { + $this->waitForElementVisible($this->isEmpty); $isEmpty = $this->_rootElement->find($this->isEmpty); if ($isEmpty->isVisible()) { return $isEmpty->getText(); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php index 161d8c30319fc..597ab1fa29613 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Product/Compare/Sidebar.php @@ -8,53 +8,65 @@ use Mtf\Client\Element; /** - * Class Sidebar - * Compare product block on cms page + * Compare product block on cms page. */ class Sidebar extends ListCompare { /** - * Selector for empty message + * Selector for empty message. * * @var string */ - protected $isEmpty = 'p.empty'; + protected $isEmpty = 'div.empty'; /** - * Product name selector + * Product name selector. * * @var string */ - protected $productName = 'li.item.odd.last strong.name a'; + protected $productName = 'li.product-item.odd.last strong.product-item-name a'; /** - * Selector for "Clear All" button + * Selector for "Clear All" button. * * @var string */ protected $clearAll = '#compare-clear-all'; /** - * Get compare products block content + * Get compare products block content. * + * @throws \Exception * @return array|string */ public function getProducts() { - $result = []; - $isEmpty = $this->_rootElement->find($this->isEmpty); - if ($isEmpty->isVisible()) { - return $isEmpty->getText(); + try { + $result = []; + $rootElement = $this->_rootElement; + $selector = $this->productName; + $this->_rootElement->waitUntil( + function () use ($rootElement, $selector) { + return $rootElement->find($selector)->isVisible() ? true : null; + } + ); + $elements = $this->_rootElement->find($this->productName)->getElements(); + foreach ($elements as $element) { + $result[] = $element->getText(); + } + return $result; + } catch (\Exception $e) { + $isEmpty = $this->_rootElement->find($this->isEmpty); + if ($isEmpty->isVisible()) { + return $isEmpty->getText(); + } else { + throw $e; + } } - $elements = $this->_rootElement->find($this->productName)->getElements(); - foreach ($elements as $element) { - $result[] = $element->getText(); - } - return $result; } /** - * Click "Clear All" on "My Account" page + * Click "Clear All" on "My Account" page. * * @return void */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php index 2aff555e77e8b..c9401602d952a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAbsenceDeleteAttributeButton.php @@ -14,12 +14,9 @@ */ class AssertAbsenceDeleteAttributeButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Delete Attribute button is absent for system attribute on attribute edit page. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php index fe2b8fd83a61e..ed76a2c27cb5e 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonAbsent.php @@ -17,12 +17,9 @@ */ class AssertAddToCartButtonAbsent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Category Page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php index 31e5cc832ce49..2869909c7b5a0 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php @@ -17,12 +17,9 @@ */ class AssertAddToCartButtonPresent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Category Page on Frontend 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 466997959fb2f..5b3438cec8d2e 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 @@ -5,23 +5,23 @@ namespace Magento\Catalog\Test\Constraint; +use Magento\Catalog\Test\Fixture\CatalogAttributeSet; +use Magento\Catalog\Test\Fixture\CatalogProductSimple; +use Mtf\Fixture\InjectableFixture; +use Mtf\Constraint\AbstractConstraint; use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; -use Mtf\Constraint\AbstractConstraint; -use Mtf\Fixture\InjectableFixture; +use Mtf\ObjectManager; /** * Check attribute on product form. */ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Add this attribute to Default attribute Template. Create product and Assert that created attribute @@ -31,6 +31,7 @@ class AssertAddedProductAttributeOnProductForm extends AbstractConstraint * @param CatalogProductIndex $productGrid * @param CatalogProductEdit $productEdit * @param CatalogProductAttribute $attribute + * @param CatalogAttributeSet $productTemplate * @param CatalogProductAttribute $productAttributeOriginal * @throws \Exception * @return void @@ -40,11 +41,13 @@ public function processAssert( CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductAttribute $attribute, + CatalogAttributeSet $productTemplate, CatalogProductAttribute $productAttributeOriginal = null ) { - $filterProduct = [ - 'sku' => $product->getSku(), - ]; + if (!$product->hasData('sku')) { + $product = $this->createProductWithAttributeSet($productAttributeOriginal, $productTemplate); + } + $filterProduct = ['sku' => $product->getSku()]; $productGrid->open(); $productGrid->getProductGrid()->searchAndOpen($filterProduct); @@ -67,4 +70,23 @@ public function toString() { return 'Product Attribute is present on Product form.'; } + + /** + * Create Product With AttributeSet. + * + * @param CatalogProductAttribute $attribute + * @param CatalogAttributeSet $productTemplate + * @return CatalogProductSimple + */ + protected function createProductWithAttributeSet( + CatalogProductAttribute $attribute, + CatalogAttributeSet $productTemplate + ) { + $product = ObjectManager::getInstance()->create( + 'Magento\Catalog\Test\TestStep\AddAttributeToProductTemplateStep', + ['attribute' => $attribute, 'productTemplate' => $productTemplate] + )->run(); + ObjectManager::getInstance()->create('Magento\Catalog\Test\TestStep\SaveProductTemplateStep')->run(); + return $product['product']; + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php index 6e99ad81cf7c9..1883451ea5d73 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeForm.php @@ -15,12 +15,9 @@ */ class AssertAttributeForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed attribute data on edit page equals passed from fixture. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php index 31274227acee0..ca705c2170a1a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php @@ -12,12 +12,9 @@ */ class AssertAttributeOptionsOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php index f2f021612864a..16e6f2cffc31e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertAttributeSearchableByLabel.php @@ -12,12 +12,9 @@ */ class AssertAttributeSearchableByLabel extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php index 80757b310f580..e04f76f19626d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php @@ -15,12 +15,9 @@ */ class AssertCategoryAbsenceOnBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that not displayed category in backend catalog category tree diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php index 645b5b39ca641..46326d1ee30d2 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php @@ -16,18 +16,15 @@ */ class AssertCategoryAbsenceOnFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message on the product page 404 */ const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that not displayed category in frontend main menu * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php index 2250cb7b7789b..166faa8e7213d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php @@ -16,12 +16,9 @@ */ class AssertCategoryForAssignedProducts extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed assigned products on category page equals passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php index d5901b78b4738..5465492dac08b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryForm.php @@ -12,12 +12,9 @@ */ class AssertCategoryForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php index c955feda2aa3b..ea0f357e3c878 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotActive.php @@ -16,14 +16,11 @@ */ class AssertCategoryIsNotActive extends AbstractConstraint { - const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; /** * Assert that the category cannot be accessed from the navigation bar in the frontend diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php index 65c0a77294927..1afb66d142fa7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryIsNotIncludeInMenu.php @@ -17,12 +17,9 @@ */ class AssertCategoryIsNotIncludeInMenu extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that the category is no longer available on the top menu bar diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php index e6215db21a9f1..92b3304b91c53 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryPage.php @@ -17,12 +17,9 @@ */ class AssertCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed category data on category page equals to passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php index ce8fc92a4867e..9d8f3987389ec 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCategoryRedirect.php @@ -15,12 +15,9 @@ */ class AssertCategoryRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that old Category URL lead to appropriate Category in frontend 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 39104943fabfe..c704b36101be5 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 @@ -14,18 +14,15 @@ */ class AssertCategorySaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success category save message */ const SUCCESS_MESSAGE = 'You saved the category.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after category save * 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 9f7b262b02ac9..beb3994bd58f4 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 @@ -14,18 +14,15 @@ */ class AssertCategorySuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that displayed after delete url rewrite */ const SUCCESS_DELETE_MESSAGE = 'You deleted the category.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after delete a category "You deleted the category." successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php index 67f2329e1aa6c..2ca88767f484e 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertCrossSellsProductsSection.php @@ -18,12 +18,9 @@ */ class AssertCrossSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is displayed in cross-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php index dcdde5bdb3082..765669ef91f72 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoCrossSellsProductsSection.php @@ -18,12 +18,9 @@ */ class AssertNoCrossSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is not displayed in cross-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php index 4c06db094cfc6..76defe97417d8 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoRelatedProductsSection.php @@ -17,12 +17,9 @@ */ class AssertNoRelatedProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is not displayed in related products section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php index ccfc9ff9ef510..e787890abee49 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertNoUpSellsProductsSection.php @@ -17,12 +17,9 @@ */ class AssertNoUpSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is not displayed in up-sell section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php index 4dec45b012b86..aa4b2dc670435 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeAbsenceInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductAttributeAbsenceInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after deleted product attribute cannot be found by attribute code. 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 6f1d7991b81bf..fc43dd93cf8dd 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 @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceInSearchOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control 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 a5b5935a9bc42..82f536496c12a 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 @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceInTemplateGroups extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted attribute isn't displayed in Product template'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 7c37c98529922..d70f3a761e09c 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 @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceInUnassignedAttributes extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted attribute isn't displayed in Product template's Unassigned Attributes section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php index cffe6fe28dc65..8213f53c9c161 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeDisplayingOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether the attribute is visible on the frontend. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php index 41467cfdc7cac..5cfe643e0b2ef 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php @@ -14,12 +14,9 @@ */ class AssertProductAttributeDisplayingOnSearchForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether attribute is displayed in the advanced search form on the frontend. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php index 1ff1558055243..0ea5de0229235 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductAttributeInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created product attribute is found in grid diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php index 6ffd0a154dba4..5cdbac2478c26 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php @@ -17,12 +17,9 @@ */ class AssertProductAttributeIsComparable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether there is an opportunity to compare products using given attribute. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php index b3d9296c3cabf..88c15e1a7ea3b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php @@ -5,23 +5,24 @@ namespace Magento\Catalog\Test\Constraint; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; -use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Mtf\Fixture\FixtureFactory; +use Mtf\Fixture\InjectableFixture; use Magento\Cms\Test\Page\CmsIndex; use Mtf\Constraint\AbstractConstraint; -use Mtf\Fixture\InjectableFixture; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Catalog\Test\Page\Category\CatalogCategoryView; +use Magento\Catalog\Test\Block\Adminhtml\Product\ProductForm; /** * Check whether the attribute filter is displayed on the frontend in Layered navigation. */ class AssertProductAttributeIsFilterable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether the attribute filter is displayed on the frontend in Layered navigation. @@ -30,14 +31,37 @@ class AssertProductAttributeIsFilterable extends AbstractConstraint * @param InjectableFixture $product * @param CatalogProductAttribute $attribute * @param CmsIndex $cmsIndex + * @param CatalogProductIndex $catalogProductIndex + * @param CatalogProductEdit $catalogProductEdit + * @param FixtureFactory $fixtureFactory * @return void */ public function processAssert( CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute, - CmsIndex $cmsIndex + CmsIndex $cmsIndex, + CatalogProductIndex $catalogProductIndex, + CatalogProductEdit $catalogProductEdit, + FixtureFactory $fixtureFactory ) { + $fixtureFactory->createByCode( + 'catalogProductSimple', + [ + 'dataSet' => 'product_with_category_with_anchor', + 'data' => [ + 'category_ids' => [ + 'presets' => null, + 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0] + ] + ], + ] + )->persist(); + + $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); + $productForm = $catalogProductEdit->getProductForm(); + $this->setDefaultAttributeValue($productForm, $attribute); + $catalogProductEdit->getFormPageActions()->save(); $cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]); $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() @@ -57,4 +81,27 @@ public function toString() { return 'Attribute is present in layered navigation on category page.'; } + + /** + * Set default attribute value. + * + * @param ProductForm $productForm + * @param CatalogProductAttribute $attribute + * @return void + */ + protected function setDefaultAttributeValue(ProductForm $productForm, CatalogProductAttribute $attribute) + { + $attributeData = $attribute->getData(); + if (isset($attributeData['options'])) { + foreach ($attributeData['options'] as $option) { + if ($option['is_default'] == 'Yes') { + $defaultValue = $option['admin']; + } + } + } else { + $field = preg_grep('@^default_value@', array_keys($attributeData)); + $defaultValue = $attributeData[array_shift($field)]; + } + $productForm->getAttributeElement($attribute)->setValue($defaultValue); + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php index 47c98a3b3a5f3..519235ceaeb99 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsFilterableInSearch extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check out if the attribute in the navigation bar on the search results page in Layered navigation. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php index 802ea88feac8e..804a7be2ff59e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php @@ -14,12 +14,9 @@ */ class AssertProductAttributeIsGlobal extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Look on the scope of product attribute in the grid. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php index 8af708ec9e836..b88bea3779a27 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsHtmlAllowed.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsHtmlAllowed extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check whether html tags are using in attribute value. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php index 6a7c58b1f0312..39ce6823aaf58 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php @@ -16,18 +16,15 @@ */ class AssertProductAttributeIsRequired extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected message. */ const REQUIRE_MESSAGE = 'This is a required field.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Check whether the attribute is mandatory. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php index 186ecc4249f0b..0eb936e80df26 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php @@ -10,53 +10,64 @@ use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; use Mtf\Constraint\AbstractConstraint; +use Mtf\Fixture\FixtureFactory; /** * Check whether the attribute is unique. */ class AssertProductAttributeIsUnique extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected message. */ const UNIQUE_MESSAGE = 'The value of attribute "%s" must be unique'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Check whether the attribute is unique. * * @param CatalogProductIndex $catalogProductIndex * @param CatalogProductEdit $catalogProductEdit - * @param CatalogProductSimple $product * @param CatalogProductAttribute $attribute + * @param CatalogProductSimple $product, + * @param FixtureFactory $fixtureFactory * @throws \Exception * @return void */ public function processAssert( CatalogProductIndex $catalogProductIndex, CatalogProductEdit $catalogProductEdit, + CatalogProductAttribute $attribute, CatalogProductSimple $product, - CatalogProductAttribute $attribute + FixtureFactory $fixtureFactory ) { + $simpleProduct = $fixtureFactory->createByCode( + 'catalogProductSimple', + [ + 'dataSet' => 'product_with_category_with_anchor', + 'data' => [ + 'attribute_set_id' => [ + 'attribute_set' => $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet() + ], + 'custom_attribute' => $attribute, + ], + ] + ); $catalogProductIndex->open()->getGridPageActionBlock()->addProduct('simple'); $productForm = $catalogProductEdit->getProductForm(); - $productForm->fill($product); + $productForm->fill($simpleProduct); $catalogProductEdit->getFormPageActions()->save(); - $failedAttributes = $productForm->getRequireNoticeAttributes($product); - $actualMessage = $failedAttributes['product-details'][$attribute->getFrontendLabel()]; - - $fixtureData = $attribute->getData(); - $defaultValue = preg_grep('/^default_value/', array_keys($fixtureData)); + $failedAttributes = $productForm->getRequireNoticeAttributes($simpleProduct); + $actualMessage = isset($failedAttributes['product-details'][$attribute->getFrontendLabel()]) + ? $failedAttributes['product-details'][$attribute->getFrontendLabel()] + : null; \PHPUnit_Framework_Assert::assertEquals( - self::UNIQUE_MESSAGE, - sprintf($actualMessage, $fixtureData[array_shift($defaultValue)]), + sprintf(self::UNIQUE_MESSAGE, $attribute->getFrontendLabel()), + $actualMessage, 'JS error notice on product edit page is not equal to expected.' ); } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php index 5c8f7b73d31a6..3862ee8da32e4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsUsedInSortOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that attribute present in sort dropdown on search results page on frontend. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php index a7c4dc2a3dc8f..3ff15f9eec04c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductAttributeIsUsedPromoRules.php @@ -12,12 +12,9 @@ */ class AssertProductAttributeIsUsedPromoRules extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void 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 921910d6d8737..5298a607d8837 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 @@ -13,14 +13,11 @@ */ class AssertProductAttributeSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the product attribute.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the product attribute.'; /** * Assert that message "You saved the product attribute." is present on Attribute page 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 339b3ea9944f2..4d1a956f733be 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 @@ -14,14 +14,11 @@ */ class AssertProductAttributeSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The product attribute has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'The product attribute has been deleted.'; /** * Assert that message "The product attribute has been deleted." is present on Attribute page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php index 1ac0dd859e687..0e05a29df614a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php @@ -15,12 +15,9 @@ */ class AssertProductCompareBlockOnCmsPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Compare Products block is presented on CMS pages. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php index 6c449ec83efd3..f276e22d6aaf7 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLink.php @@ -13,12 +13,9 @@ */ class AssertProductCompareItemsLink extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that link "Compare Products..." on top menu of page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php index 2975e07257efa..89e969297ec11 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php @@ -13,12 +13,9 @@ */ class AssertProductCompareItemsLinkIsAbsent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert compare products link is NOT visible at the top of page. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php index 3448b15939ff2..0fec1e7d33cca 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductComparePage.php @@ -15,12 +15,9 @@ */ class AssertProductComparePage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Product attribute on compare product page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php index 3d0b22887093e..2cfb20b85f2ba 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCompareRemoveLastProductMessage.php @@ -14,14 +14,11 @@ */ class AssertProductCompareRemoveLastProductMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have no items to compare.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have no items to compare.'; /** * After removing last product message is appeared on "Compare Products" page 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 a87663f7b09a8..17915bc28a3bc 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 @@ -14,14 +14,11 @@ */ class AssertProductCompareSuccessAddMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You added product %s to the comparison list.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You added product %s to the comparison list.'; /** * Assert success message is presented on page 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 9510c30840757..2ffa8de9f8a53 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 @@ -13,14 +13,11 @@ */ class AssertProductCompareSuccessRemoveAllProductsMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You cleared the comparison list.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You cleared the comparison list.'; /** * Assert message is appeared on "Compare Products" page. 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 cd9b0426ea817..a69502f3ac415 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 @@ -15,14 +15,11 @@ */ class AssertProductCompareSuccessRemoveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You removed product %s from the comparison list.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You removed product %s from the comparison list.'; /** * Assert message is appeared on "Compare Products" block on myAccount page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php index cba8f3087a17a..c619e0f81e969 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php @@ -15,12 +15,9 @@ */ class AssertProductCustomOptionsOnProductPage extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped field for custom options diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php index 4888cf2551631..24117c0290173 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateForm.php @@ -10,12 +10,16 @@ use Mtf\Fixture\FixtureInterface; /** - * Class AssertProductDuplicateForm + * Assert form data equals fixture data. */ class AssertProductDuplicateForm extends AssertProductForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** - * Formatting options for numeric values + * Formatting options for numeric values. * * @var array */ @@ -38,14 +42,7 @@ class AssertProductDuplicateForm extends AssertProductForm ]; /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - - /** - * Assert form data equals fixture data + * Assert form data equals fixture data. * * @param FixtureInterface $product * @param CatalogProductIndex $productGrid @@ -68,7 +65,7 @@ public function processAssert( } /** - * Prepares fixture data for comparison + * Prepares fixture data for comparison. * * @param array $data * @param array $sortFields [optional] @@ -97,18 +94,33 @@ function (&$item, $key, $formattingOptions) { $compareData['status'] = 'Product offline'; } if (isset($compareData['quantity_and_stock_status']['qty'])) { - $compareData['quantity_and_stock_status']['qty'] = 0; + $compareData['quantity_and_stock_status']['qty'] = ''; + $compareData['quantity_and_stock_status']['is_in_stock'] = 'Out of Stock'; } if (isset($compareData['special_price'])) { $compareData['special_price'] = ['special_price' => $compareData['special_price']]; } $compareData['sku'] .= '-1'; + $compareData['url_key'] = $this->prepareUrlKey($compareData['url_key']); return parent::prepareFixtureData($compareData, $sortFields); } /** - * Returns a string representation of the object + * Prepare url key. + * + * @param string $urlKey + * @return string + */ + protected function prepareUrlKey($urlKey) + { + preg_match("~\d+$~", $urlKey, $matches); + $key = intval($matches[0]) + 1; + return str_replace($matches[0], $key, $urlKey); + } + + /** + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php index 86a2abaaf6e42..d04c3b310107e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php @@ -12,12 +12,9 @@ */ class AssertProductDuplicateIsNotDisplayingOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that product duplicate is not displayed on front-end 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 732a11a8f1406..6657740a35247 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 @@ -13,18 +13,15 @@ */ class AssertProductDuplicateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const DUPLICATE_MESSAGE = 'You duplicated the product.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Checking the output message successful product duplication * 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 a9b80267f4bfe..d9db6bcf1e131 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 @@ -14,12 +14,9 @@ */ class AssertProductDuplicatedInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that duplicated product is found by sku and has correct product type, product template, diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php index 75c3a34e9ebef..9cf3ff6546f4d 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductForm.php @@ -15,6 +15,10 @@ */ class AssertProductForm extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * List skipped fixture fields in verify * @@ -44,13 +48,6 @@ class AssertProductForm extends AbstractAssertForm */ protected $specialArray = []; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert form data equals fixture data * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php index cfd87eea3fb2f..6733686de31a6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductGroupedPriceOnProductPage extends AbstractConstraint implements AssertPriceOnProductPageInterface { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php index 54e27e633ad4a..b51e91662ee94 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCart.php @@ -18,12 +18,9 @@ */ class AssertProductInCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assertion that the product is correctly displayed in cart diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php index c0e98f182574f..44a62cce8d398 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInCategory.php @@ -16,12 +16,9 @@ */ class AssertProductInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Checking the product in the page of its price diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php index c2b709593012d..f0ce173a43893 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Product fixture diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php index a23b98cff1d24..cf56a59038104 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductInStock.php @@ -15,12 +15,9 @@ */ class AssertProductInStock extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Text value for checking Stock Availability diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php index 07b8d331ea215..459715d46f984 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php @@ -19,18 +19,15 @@ */ class AssertProductIsNotDisplayingOnFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message on the product page 404 */ const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Product view page * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php index 72375b0ba7620..4d26b3c82837d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInCompareBlock.php @@ -16,14 +16,11 @@ */ class AssertProductIsNotVisibleInCompareBlock extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have no items to compare.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have no items to compare.'; /** * Assert the product is not displayed on Compare Products block on my account page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php index a576c9576da69..d9d07941436d5 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductIsNotVisibleInComparePage.php @@ -15,14 +15,11 @@ */ class AssertProductIsNotVisibleInComparePage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have no items to compare.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have no items to compare.'; /** * Assert the product is not displayed on Compare Products page diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php index accb97b15c456..0256378ca4ba0 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product cannot be found by name and sku diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php index 9d709832dc3fb..84f3841829713 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php @@ -16,12 +16,9 @@ */ class AssertProductNotSearchableBySku extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product cannot be found via Quick Search using searchable product attributes. diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php index 7dd7f2d131b1c..d5034b364c0e4 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductNotVisibleInCategory.php @@ -16,12 +16,9 @@ */ class AssertProductNotVisibleInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is not visible in the assigned category diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php index 8c80a1affb0bc..aa4b008f2eeb0 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductOutOfStock.php @@ -15,12 +15,9 @@ */ class AssertProductOutOfStock extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Text value for checking Stock Availability diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php index df10b9edceedf..e46c706950f9d 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductPage.php @@ -17,6 +17,10 @@ */ class AssertProductPage extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Product view block on frontend page * @@ -31,13 +35,6 @@ class AssertProductPage extends AbstractAssertForm */ protected $product; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Assert that displayed product data on product page(front-end) equals passed from fixture: * 1. Product Name 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 f65de789d0054..b6da8b6533765 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 @@ -13,18 +13,15 @@ */ class AssertProductSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the product.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after product save * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php index 03e4a73005a4a..59b7c9a76ee8d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSearchableBySku.php @@ -15,12 +15,9 @@ */ class AssertProductSearchableBySku extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Displays an error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php index 77c8624335a95..c1a2bdac797fd 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSimpleDuplicateForm.php @@ -11,10 +11,7 @@ */ class AssertProductSimpleDuplicateForm extends AssertProductDuplicateForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php index 0e43942ca300c..fed31f8a0068f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSkuAutoGenerated.php @@ -14,12 +14,9 @@ */ class AssertProductSkuAutoGenerated extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that SKU successfully generated diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php index 7de7dbdf053f9..35e6507222dff 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductSpecialPriceOnProductPage extends AbstractConstraint implements AssertPriceOnProductPageInterface { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message 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 4ad8c8c85248f..f0925517bb7ca 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 @@ -14,18 +14,15 @@ */ class AssertProductSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) have been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after deleting product success message. * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php index bbd8ceff87f6f..9411b80d97d4a 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateForm.php @@ -17,12 +17,9 @@ */ class AssertProductTemplateForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after save a product template on edit product set page displays: diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php index 3777c07060762..1d798a8be839d 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateGroupOnProductForm.php @@ -5,14 +5,15 @@ namespace Magento\Catalog\Test\Constraint; +use Mtf\ObjectManager; +use Mtf\Fixture\FixtureFactory; +use Mtf\Constraint\AbstractConstraint; use Magento\Catalog\Test\Fixture\CatalogAttributeSet; -use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Fixture\CatalogProductSimple; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; -use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Catalog\Test\Fixture\CatalogProductAttribute; use Magento\Catalog\Test\Page\Adminhtml\CatalogProductNew; -use Mtf\Constraint\AbstractConstraint; -use Mtf\Fixture\FixtureFactory; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductEdit; /** * Class AssertProductTemplateGroupOnProductForm @@ -21,12 +22,9 @@ */ class AssertProductTemplateGroupOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created product template: diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php index bb12891c2ffc9..5116d9a9ff11c 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductTemplateInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that new product template displays in Product Templates 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/AssertProductTemplateNotInGrid.php index a96082c06e304..7a6be9184a3a1 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductTemplateNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product template is not displayed in Product Templates 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/AssertProductTemplateOnProductForm.php index 821d50f24a4ec..4731c5dd97f73 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php @@ -20,12 +20,9 @@ */ class AssertProductTemplateOnProductForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created product template: diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php index 3aa72d40432dc..1b7a0e19d2c01 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertProductTemplateSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'The attribute set has been removed.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after deleting product template success delete message appears * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php index 6011b388422a6..e40c4e377f52f 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertProductTemplateSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the attribute set.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after save a product template "You saved the attribute set." successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php index 3213b146c037f..252b0a6454cf8 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductTierPriceOnProductPage extends AbstractConstraint implements AssertPriceOnProductPageInterface { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php index 5d880ff5b31e6..806c7be578f8b 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductView.php @@ -17,12 +17,9 @@ */ class AssertProductView extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @param CatalogProductView $catalogProductView diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php index 4c209e067cdee..6468e0b47f829 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductVisibleInCategory.php @@ -16,12 +16,9 @@ */ class AssertProductVisibleInCategory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Displays an error message diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php index 516100eb59b82..91f38bcd8c3e4 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertRelatedProductsSection.php @@ -17,12 +17,9 @@ */ class AssertRelatedProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is displayed in related products section diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php index 4a6bac3aaeaf5..a9bc575d105c2 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertUpSellsProductsSection.php @@ -17,12 +17,9 @@ */ class AssertUpSellsProductsSection extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product is displayed in up-sell section 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 3637c11d1e884..ac7bbc7a407b6 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 @@ -14,18 +14,15 @@ */ class AssertUsedSuperAttributeImpossibleDeleteMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Impossible to delete message */ const ERROR_DELETE_MESSAGE = 'This attribute is used in configurable products.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that it's impossible to delete configurable attribute that is used in created configurable product * diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php index 0539908aa7ce5..51e5b73d7c450 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.php @@ -493,6 +493,7 @@ public function __construct( protected $id = [ 'attribute_code' => 'id', 'backend_type' => 'virtual', + 'group' => null, ]; protected $type_id = [ @@ -593,6 +594,7 @@ public function __construct( protected $is_virtual = [ 'attribute_code' => 'is_virtual', 'backend_type' => 'virtual', + 'group' => 'product-details', ]; protected $attributes = [ diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index b19b3a3dcb062..85a48583b0da8 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -385,6 +385,7 @@ type_id virtual + attribute_set_id @@ -451,6 +452,7 @@ is_virtual virtual + product-details attributes diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php index 1e6ed9bfacbad..7736b6917964c 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple/CustomOptions.php @@ -208,13 +208,13 @@ protected function getPreset($name) 'type' => 'Drop-down', 'options' => [ [ - 'title' => 'Test1 %isolation%', + 'title' => 'Test3-1 %isolation%', 'price' => 110.01, 'price_type' => 'Percent', 'sku' => 'sku2_%isolation%', ], [ - 'title' => 'Test2 %isolation%', + 'title' => 'Test3-2 %isolation%', 'price' => 210.02, 'price_type' => 'Fixed', 'sku' => 'sku3_%isolation%' diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php index 5cda35666abff..e2f2dae1e8917 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Handler/CatalogProductSimple/Curl.php @@ -231,6 +231,9 @@ protected function prepareData(FixtureInterface $fixture, $prefix = null) $fields += $fields['attributes']; unset($fields['attributes']); } + if (isset($fields['custom_attribute'])) { + $fields[$fields['custom_attribute']['code']] = $fields['custom_attribute']['value']; + } $fields = $this->prepareStockData($fields); $fields = $prefix ? [$prefix => $fields] : $fields; diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php index eccfa2397e59c..e337834ed3c59 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php @@ -64,6 +64,7 @@ public function __inject(CatalogCategoryIndex $catalogCategoryIndex, CatalogCate */ public function test(CatalogCategory $category) { + $this->markTestIncomplete('MAGETWO-31723'); $category->persist(); $this->catalogCategoryIndex->open(); $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category); diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php index 38a1d175b922d..96916f5d25fa4 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AbstractCompareProductsTest.php @@ -17,69 +17,70 @@ use Mtf\TestCase\Injectable; /** - * Class AbstractCompareProductsTest - * Abstract class for compare products class + * Abstract class for compare products class. + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractCompareProductsTest extends Injectable { /** - * Array products + * Array products. * * @var array */ protected $products; /** - * Cms index page + * Cms index page. * * @var CmsIndex */ protected $cmsIndex; /** - * Browser + * Browser. * * @var Browser */ protected $browser; /** - * Catalog product compare page + * Catalog product compare page. * * @var CatalogProductCompare */ protected $catalogProductCompare; /** - * Catalog product page + * Catalog product page. * * @var CatalogProductView */ protected $catalogProductView; /** - * Customer login page + * Customer login page. * * @var CustomerAccountLogin */ protected $customerAccountLogin; /** - * Fixture factory + * Fixture factory. * * @var FixtureFactory */ protected $fixtureFactory; /** - * Fixture customer + * Fixture customer. * * @var CustomerInjectable */ protected $customer; /** - * Prepare data + * Prepare data. * * @param FixtureFactory $fixtureFactory * @param CustomerInjectable $customer @@ -93,7 +94,7 @@ public function __prepare(FixtureFactory $fixtureFactory, CustomerInjectable $cu } /** - * Injection data + * Injection data. * * @param CmsIndex $cmsIndex * @param CatalogProductView $catalogProductView @@ -114,7 +115,7 @@ public function __inject( } /** - * Login customer + * Login customer. * * @return void */ @@ -127,7 +128,7 @@ protected function loginCustomer() } /** - * Create products + * Create products. * * @param string $products * @return array @@ -145,7 +146,7 @@ protected function createProducts($products) } /** - * Add products to compare list + * Add products to compare list. * * @param array $products * @param AbstractConstraint $assert @@ -163,7 +164,7 @@ protected function addProducts(array $products, AbstractConstraint $assert = nul } /** - * Perform assert + * Perform assert. * * @param AbstractConstraint $assert * @param InjectableFixture $product @@ -171,10 +172,7 @@ protected function addProducts(array $products, AbstractConstraint $assert = nul */ protected function productCompareAssert(AbstractConstraint $assert, InjectableFixture $product) { - $assert->configure( - $this, - ['catalogProductView' => $this->catalogProductView, 'product' => $product] - ); + $assert->configure(['catalogProductView' => $this->catalogProductView, 'product' => $product]); \PHPUnit_Framework_Assert::assertThat($this->getName(), $assert); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest/test.csv index e10a6ff408f5d..b632986c64951 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/AddCompareProductsTest/test.csv @@ -1,5 +1,5 @@ -"products";"constraint";"isCustomerLoggedIn" -"catalogProductSimple::simple_for_composite_products";"assertProductCompareItemsLink, assertProductComparePage, assertProductCompareBlockOnCmsPage";"No" -"catalogProductSimple::simple_for_composite_products,bundleProduct::bundle_dynamic_product";"assertProductCompareItemsLink, assertProductComparePage";"No" -"configurableProductInjectable::default";"assertProductCompareItemsLink, assertProductComparePage, assertProductCompareBlockOnCmsPage";"Yes" -"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"assertProductCompareItemsLink, assertProductComparePage";"Yes" +"products";"constraint";"isCustomerLoggedIn";"issue" +"catalogProductSimple::simple_for_composite_products";"assertProductCompareItemsLink, assertProductComparePage, assertProductCompareBlockOnCmsPage";"No";"" +"catalogProductSimple::simple_for_composite_products,bundleProduct::bundle_dynamic_product";"assertProductCompareItemsLink, assertProductComparePage";"No";"" +"configurableProductInjectable::default";"assertProductCompareItemsLink, assertProductComparePage, assertProductCompareBlockOnCmsPage";"Yes";"" +"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"assertProductCompareItemsLink, assertProductComparePage";"Yes";"Bug: MAGETWO-8719" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest/test.csv index 1cc2b68ae5755..34053da035dcc 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest/test.csv @@ -1,2 +1,2 @@ -"config/dataSet";"products";"constraint" -"compare_products";"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"assertProductCompareSuccessRemoveAllProductsMessage, assertProductCompareItemsLinkIsAbsent, assertProductCompareRemoveLastProductMessage, assertProductIsNotVisibleInCompareBlock" +"config/dataSet";"products";"constraint";"issue" +"compare_products";"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"assertProductCompareSuccessRemoveAllProductsMessage, assertProductCompareItemsLinkIsAbsent, assertProductCompareRemoveLastProductMessage, assertProductIsNotVisibleInCompareBlock";"Bug: MAGETWO-8719" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest/test.csv index c9f78b2423272..42e759da8f799 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DeleteCompareProductsTest/test.csv @@ -1,4 +1,4 @@ -"products";"removeProductIndex";"isCustomerLoggedIn";"constraint" -"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"1";"No";"assertProductCompareSuccessRemoveMessage, assertProductIsNotVisibleInComparePage, assertProductIsNotVisibleInCompareBlock" -"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"6";"Yes";"assertProductCompareSuccessRemoveMessage, assertProductIsNotVisibleInComparePage, assertProductIsNotVisibleInCompareBlock" -"bundleProduct::bundle_dynamic_product";"1";"Yes";"assertProductCompareSuccessRemoveMessage, assertProductCompareRemoveLastProductMessage, assertProductIsNotVisibleInCompareBlock, assertProductCompareItemsLinkIsAbsent" +"products";"removeProductIndex";"isCustomerLoggedIn";"constraint";"issue" +"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"1";"No";"assertProductCompareSuccessRemoveMessage, assertProductIsNotVisibleInComparePage, assertProductIsNotVisibleInCompareBlock";"Bug: MAGETWO-8719" +"catalogProductSimple::simple_for_composite_products,catalogProductVirtual::default,giftCardProduct::giftcard_product_with_price,downloadableProductInjectable::default,groupedProductInjectable::grouped_product_with_price,configurableProductInjectable::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product";"6";"Yes";"assertProductCompareSuccessRemoveMessage, assertProductIsNotVisibleInComparePage, assertProductIsNotVisibleInCompareBlock";"Bug: MAGETWO-8719" +"bundleProduct::bundle_dynamic_product";"1";"Yes";"assertProductCompareSuccessRemoveMessage, assertProductCompareRemoveLastProductMessage, assertProductIsNotVisibleInCompareBlock, assertProductCompareItemsLinkIsAbsent";"" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php index 82504586baec6..08b197bfb73ec 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php @@ -12,8 +12,6 @@ use Mtf\TestCase\Injectable; /** - * Test Creation for DuplicateProductEntity - * * Test Flow: * * Precondition: @@ -32,35 +30,35 @@ class DuplicateProductEntityTest extends Injectable { /** - * Category fixture + * Category fixture. * * @var CatalogCategory */ protected $category; /** - * Product page with a grid + * Product page with a grid. * * @var CatalogProductIndex */ protected $productGrid; /** - * Page to update a product + * Page to update a product. * * @var CatalogProductEdit */ protected $editProductPage; /** - * Fixture factory + * Fixture factory. * * @var FixtureFactory */ protected $fixtureFactory; /** - * Prepare data + * Prepare data. * * @param CatalogCategory $category * @param CatalogProductIndex $productGrid @@ -82,27 +80,27 @@ public function __prepare( } /** - * Run test duplicate product entity + * Run test duplicate product entity. * * @param string $productType * @return array */ public function test($productType) { - $this->markTestIncomplete("MAGETWO-28138"); // Precondition $product = $this->createProduct($productType); // Steps $filter = ['sku' => $product->getSku()]; - $this->productGrid->open()->getProductGrid()->searchAndOpen($filter); + $this->productGrid->open(); + $this->productGrid->getProductGrid()->searchAndOpen($filter); $this->editProductPage->getFormPageActions()->saveAndDuplicate(); return ['product' => $product]; } /** - * Creating a product according to the type of + * Creating a product according to the type of. * * @param string $productType * @return array diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv index 3ec77ae260b27..afbcec37babe9 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/ProductTypeSwitchingOnUpdateTest/test.csv @@ -1,12 +1,12 @@ -"productOrigin";"product";"actionName";"constraint";"issue" -"catalogProductSimple::default";"configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately";"" -"catalogProductSimple::default";"catalogProductVirtual::default";"-";"assertProductSaveMessage, assertProductInGrid";"" -"configurableProductInjectable::default";"catalogProductSimple::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid";"" -"configurableProductInjectable::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid";"" -"catalogProductVirtual::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid";"" -"catalogProductVirtual::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately";"" -"catalogProductVirtual::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData";"" -"downloadableProductInjectable::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid";"" -"downloadableProductInjectable::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately";"" -"downloadableProductInjectable::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid";"Bug: MAGETWO-29903" -"catalogProductSimple::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData";"" +"productOrigin";"product";"actionName";"constraint" +"catalogProductSimple::default";"configurableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"catalogProductSimple::default";"catalogProductVirtual::default";"-";"assertProductSaveMessage, assertProductInGrid" +"configurableProductInjectable::default";"catalogProductSimple::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" +"configurableProductInjectable::default";"catalogProductVirtual::default";"deleteAttributes";"assertProductSaveMessage, assertProductInGrid" +"catalogProductVirtual::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" +"catalogProductVirtual::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"catalogProductVirtual::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" +"downloadableProductInjectable::default";"catalogProductSimple::default";"-";"assertProductSaveMessage, assertProductInGrid" +"downloadableProductInjectable::default";"configurableProductInjectable::not_virtual_for_type_switching";"-";"assertProductSaveMessage, assertProductInGrid, assertChildProductsInGrid, assertConfigurableProductForm, assertConfigurableProductPage, assertProductInStock, assertChildProductIsNotDisplayedSeparately" +"downloadableProductInjectable::default";"catalogProductVirtual::default";"clearDownloadableData";"assertProductSaveMessage, assertProductInGrid" +"catalogProductSimple::default";"downloadableProductInjectable::default";"-";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductInStock, assertDownloadableLinksData" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv index 8c4e634beabb1..c7ce0a25c7ea6 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateVirtualProductEntityTest/test.csv @@ -1,5 +1,5 @@ "product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/is_virtual";"product/data/category_ids/presets";"product/data/group_price/preset";"product/data/special_price";"product/data/tier_price/preset";"product/data/quantity_and_stock_status/is_in_stock";"product/data/custom_options/preset";"product/data/visibility";"constraint" -"VirtualProduct %isolation%";"virtual_sku_%isolation%";"99.99";"None";"999";"Yes";"default_subcategory";"-";"-";"MAGETWO-23002";"In Stock";"-";"Catalog";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductInCategory, assertProductTierPriceOnProductPage, assertProductSearchableBySku " +"VirtualProduct %isolation%";"virtual_sku_%isolation%";"99.99";"None";"999";"Yes";"default_subcategory";"-";"-";"MAGETWO-23002";"In Stock";"-";"Catalog";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductInCategory, assertProductTierPriceOnProductPage, assertProductSearchableBySku" "virtual_product_%isolation%";"virtual_sku_%isolation%";"120.00";"Taxable Goods";"999";"Yes";"-";"-";"45";"-";"In Stock";"-";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductInCategory, assertProductPage, assertProductSpecialPriceOnProductPage, assertProductSearchableBySku" "VirtualProduct %isolation%";"virtual_sku_%isolation%";"185.00";"None";"999";"Yes";"default_subcategory";"-";"-";"MAGETWO-23002";"Out of Stock";"-";"Catalog, Search";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductVisibleInCategory, assertProductPage, assertProductOutOfStock, assertProductTierPriceOnProductPage, assertProductSearchableBySku" "virtual_product_%isolation%";"virtual_sku_%isolation%";"99.99";"Taxable Goods";"-";"Yes";"-";"-";"-";"-";"Out of Stock";"-";"Search";"assertProductSaveMessage, assertProductInGrid, assertProductForm, assertProductPage, assertProductOutOfStock, assertProductSearchableBySku" diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv index fee0264704c24..85c887a70ea56 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityFromProductPageTest/test.csv @@ -1,5 +1,5 @@ -"attribute/data/frontend_label";"attribute/data/frontend_input";"attribute/data/options/preset";"attribute/data/is_required";"attribute/data/attribute_code";"attribute/data/is_global";"attribute/data/default_value_text";"attribute/data/default_value_textarea";"attribute/data/is_unique";"attribute/data/is_configurable";"attribute/data/manage_frontend_label";"attribute/data/is_searchable";"attribute/data/is_visible_in_advanced_search";"attribute/data/is_comparable";"attribute/data/is_filterable";"attribute/data/is_filterable_in_search";"attribute/data/is_used_for_promo_rules";"attribute/data/is_html_allowed_on_front";"attribute/data/is_visible_on_front";"attribute/data/used_in_product_listing";"attribute/data/used_for_sort_by";"constraint";"issue" -"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"Global";"default_value_text%isolation%";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"-";"-";"-";"Yes";"Yes";"-";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend";"" -"Dropdown_Admin_%isolation%";"Dropdown";"default";"No";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"Yes";"-";"-";"-";"-";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable";"" -"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsRequired";"" -"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique";"BUG: MAGETWO-30474" \ No newline at end of file +"attribute/data/frontend_label";"attribute/data/frontend_input";"attribute/data/options/preset";"attribute/data/is_required";"attribute/data/attribute_code";"attribute/data/is_global";"attribute/data/default_value_text";"attribute/data/default_value_textarea";"attribute/data/is_unique";"attribute/data/is_configurable";"attribute/data/manage_frontend_label";"attribute/data/is_searchable";"attribute/data/is_visible_in_advanced_search";"attribute/data/is_comparable";"attribute/data/is_filterable";"attribute/data/is_filterable_in_search";"attribute/data/is_used_for_promo_rules";"attribute/data/is_html_allowed_on_front";"attribute/data/is_visible_on_front";"attribute/data/used_in_product_listing";"attribute/data/used_for_sort_by";"constraint" +"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"Global";"default_value_text%isolation%";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"-";"-";"-";"Yes";"Yes";"-";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend" +"Dropdown_Admin_%isolation%";"Dropdown";"default";"No";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"Yes";"-";"-";"-";"-";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable" +"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsRequired" +"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv index 217e673ba44a8..c17decc4632f6 100755 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest/testCreateProductAttribute.csv @@ -1,10 +1,10 @@ "productTemplate/dataSet";"productAttribute/data/frontend_label";"productAttribute/data/frontend_input";"productAttribute/data/options/preset";"productAttribute/data/is_required";"productAttribute/data/attribute_code";"productAttribute/data/is_global";"productAttribute/data/default_value_text";"productAttribute/data/default_value_textarea";"productAttribute/data/default_value_date/pattern";"productAttribute/data/default_value_yesno";"productAttribute/data/is_unique";"productAttribute/data/is_configurable";"productAttribute/data/manage_frontend_label";"productAttribute/data/is_searchable";"productAttribute/data/is_visible_in_advanced_search";"productAttribute/data/is_comparable";"productAttribute/data/is_filterable";"productAttribute/data/is_filterable_in_search";"productAttribute/data/is_used_for_promo_rules";"productAttribute/data/is_html_allowed_on_front";"productAttribute/data/is_visible_on_front";"productAttribute/data/used_in_product_listing";"productAttribute/data/used_for_sort_by";"constraint";"issue" "custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_textfield_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" "custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Area";"-";"Yes";"attr_textarea_%isolation%";"Store View";"-";"default_value_textarea%isolation%";"-";"-";"No";"-";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable";"" -"custom_attribute_set";"Date_Admin_%isolation%";"Date";"-";"No";"attr_date_%isolation%";"-";"-";"-";"n/j/y";"-";"No";"-";"Date_Store_View";"No";"No";"No";"-";"-";"-";"-";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsUsedPromoRules";"" +"custom_attribute_set";"Date_Admin_%isolation%";"Date";"-";"No";"attr_date_%isolation%";"-";"-";"-";"n/j/y";"-";"No";"-";"Date_Store_View";"Yes";"Yes";"No";"-";"-";"-";"-";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsUsedPromoRules";"" "custom_attribute_set";"Yes/No_Admin_%isolation%";"Yes/No";"-";"Yes";"attr_yesno_%isolation%";"Global";"-";"-";"-";"No";"-";"-";"Yes/No_Global";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" "custom_attribute_set";"Multiple_Select_Admin_%isolation%";"Multiple Select";"default";"No";"attr_multiselect_%isolation%";"Website";"-";"-";"-";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertAttributeSearchableByLabel, assertAttributeOptionsOnProductForm";"" "custom_attribute_set";"Dropdown_Admin_%isolation%";"Dropdown";"default";"Yes";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"-";"No";"Yes";"-";"Yes";"Yes";"Yes";"Filterable (with results)";"Yes";"-";"Yes";"Yes";"Yes";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeIsRequired, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertAttributeSearchableByLabel, assertProductAttributeIsComparable, assertProductAttributeIsUsedInSortOnFrontend, assertProductAttributeIsFilterable, assertProductAttributeIsConfigurable, assertProductAttributeIsFilterableInSearch, assertAttributeOptionsOnProductForm";"" -"custom_attribute_set";"Price_Admin_%isolation%";"Price";"-";"No";"attr_price_%isolation%";"-";"1000";"-";"-";"-";"No";"-";"Price_StoreView";"Yes";"Yes";"No";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch";"" +"custom_attribute_set";"Price_Admin_%isolation%";"Price";"-";"No";"attr_price_%isolation%";"-";"1000";"-";"-";"-";"No";"-";"Price_StoreView";"Yes";"Yes";"No";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertAttributeSearchableByLabel, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch";"Bug:MAGETWO-31560" "custom_attribute_set";"Fixed_Product_Tax_Admin_%isolation%";"Fixed Product Tax";"-";"-";"attr_fpt_code_%isolation%";"-";"-";"-";"-";"-";"-";"-";"Fixed_Product_Tax_Storeview";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm";"" -"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_textfield_%isolation%";"Store View";"default_value_text%isolation%";"-";"-";"-";"Yes";"-";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique";"Bug: MAGETWO-30474" \ No newline at end of file +"custom_attribute_set";"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_textfield_%isolation%";"Store View";"default_value_text%isolation%";"-";"-";"-";"Yes";"-";"Area_Field%isolation%";"Yes";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique";"" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/MoveAttributeToProductTemplateStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php similarity index 95% rename from dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/MoveAttributeToProductTemplateStep.php rename to dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php index 1b4ff42e4458d..18702297fcd8e 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/MoveAttributeToProductTemplateStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddAttributeToProductTemplateStep.php @@ -15,7 +15,7 @@ /** * Move attribute To attribute set. */ -class MoveAttributeToProductTemplateStep implements TestStepInterface +class AddAttributeToProductTemplateStep implements TestStepInterface { /** * Catalog ProductSet Index page. @@ -77,6 +77,7 @@ public function run() $filterAttribute = ['set_name' => $this->productTemplate->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: $product = $this->fixtureFactory->createByCode( diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php index 82f01cc14645e..7eb35a2357b62 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/AddNewAttributeFromProductPageStep.php @@ -46,7 +46,6 @@ public function __construct(CatalogProductEdit $catalogProductEdit, $tabName) public function run() { $productForm = $this->catalogProductEdit->getProductForm(); - /** @var \Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab $productDetailsTab */ $productForm->addNewAttribute($this->tabName); } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml index b5d5da90aa905..1787c27b4c603 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/constraint.xml @@ -6,34 +6,34 @@ --> - high + high - low + low - low + low - low + low - low + low @@ -42,7 +42,7 @@ - low + low @@ -51,7 +51,7 @@ - low + low @@ -59,7 +59,7 @@ - low + low @@ -68,7 +68,7 @@ - low + low @@ -76,55 +76,55 @@ - middle + middle - low + low - low + low - low + low - low + low - low + low - low + low - low + low - high + high @@ -135,33 +135,33 @@ - low + low - low + low - high + high - low + low - low + low - low + low @@ -174,46 +174,46 @@ - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - middle + middle @@ -224,13 +224,13 @@ - high + high - middle + middle - middle + middle @@ -240,13 +240,13 @@ - high + high - middle + middle - middle + middle @@ -256,37 +256,37 @@ - high + high - middle + middle - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low @@ -294,20 +294,20 @@ - low + low - high + high - high + high @@ -316,14 +316,14 @@ - high + high - high + high @@ -334,109 +334,109 @@ - high + high - low + low - low + low - low + low - low + low - low + low - high + high - high + high - high + high - low + low - low + low - low + low - low + low - low + low - low + low - low + low - high + high - low + low - high + high - high + high - high + high - high + high - high + high - low + low - low + low - low + low - high + high - high + high - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml index 13e575ac29437..8a27acb812334 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/etc/scenario.xml @@ -51,12 +51,9 @@ saveAttribute - moveAttributeToProductTemplate + addAttributeToProductTemplate - - saveProductTemplate - - + diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockAbsent.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockAbsent.php index ea86541afaf1a..1bd052696c8fb 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockAbsent.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockAbsent.php @@ -17,12 +17,9 @@ */ class AssertCatalogEventBlockAbsent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Category Page on Frontend diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockVisible.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockVisible.php index 64b417ac637d0..19d2f84754677 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockVisible.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventBlockVisible.php @@ -18,12 +18,9 @@ */ class AssertCatalogEventBlockVisible extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Category Page on Frontend diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventInGrid.php index 6c4da6d6e7b37..09e1a7d1d1347 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventInGrid.php @@ -16,12 +16,9 @@ */ class AssertCatalogEventInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Catalog Event fixture @@ -83,9 +80,9 @@ public function processAssert( $sortOrder = ""; } - $dateStart = strftime("%b %#d, %Y", $dateStart); + $dateStart = strftime("%b %e, %Y", $dateStart); $filter['start_on'] = $dateStart; - $dateEnd = strftime("%b %#d, %Y", $dateEnd); + $dateEnd = strftime("%b %e, %Y", $dateEnd); $filter['end_on'] = $dateEnd; $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsClosed.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsClosed.php index d5822b7485baa..f847d9b2c3ca1 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsClosed.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsClosed.php @@ -11,12 +11,9 @@ */ class AssertCatalogEventIsClosed extends AssertCatalogEventStatus { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Event status 'Closed' on category/product pages diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsOpen.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsOpen.php index 698a11ac98e44..1a751e1391d4e 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsOpen.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsOpen.php @@ -11,12 +11,9 @@ */ class AssertCatalogEventIsOpen extends AssertCatalogEventStatus { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Event status 'Sale Ends In' on category/product pages diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsUpcoming.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsUpcoming.php index efd4a1ec10d26..8a50479bc84ad 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsUpcoming.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventIsUpcoming.php @@ -11,12 +11,9 @@ */ class AssertCatalogEventIsUpcoming extends AssertCatalogEventStatus { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Event status 'Coming Soon' on category/product pages diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventStatus.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventStatus.php index 44fc6fce5fbe0..bac83ea8f909e 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventStatus.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventStatus.php @@ -18,12 +18,9 @@ */ abstract class AssertCatalogEventStatus extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Catalog Event status diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessCreateMessage.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessCreateMessage.php index 3adb5876121d3..8abd1f0562bfd 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessCreateMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessCreateMessage.php @@ -14,14 +14,11 @@ */ class AssertCatalogEventSuccessCreateMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the event.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the event.'; /** * Assert that message "You saved the event." is present on Event page diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessDeleteMessage.php index d8a9e31d72326..e5ca5545268b6 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertCatalogEventSuccessDeleteMessage.php @@ -14,14 +14,11 @@ */ class AssertCatalogEventSuccessDeleteMessage extends AbstractConstraint { - const DELETE_MESSAGE = 'You deleted the event.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const DELETE_MESSAGE = 'You deleted the event.'; /** * Assert that message "You deleted the event." is present on Event page diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertWidgetCatalogEvent.php b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertWidgetCatalogEvent.php index b67e75fd5db7e..18e25e50f3e92 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertWidgetCatalogEvent.php +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/Constraint/AssertWidgetCatalogEvent.php @@ -18,12 +18,9 @@ */ class AssertWidgetCatalogEvent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that widget catalog event carousel is present on category page and link "Go To Sale" on widget redirects diff --git a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/etc/constraint.xml index fe98a0196ab89..43f9c80a693e7 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogEvent/Test/etc/constraint.xml @@ -8,20 +8,20 @@ - low + low - low + low - low + low @@ -31,7 +31,7 @@ - low + low @@ -41,7 +41,7 @@ - low + low @@ -51,7 +51,7 @@ - low + low @@ -61,19 +61,19 @@ - low + low - low + low - low + low @@ -82,6 +82,6 @@ - low + low diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php index 01ae06dc07d55..3390387e5853d 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog.php @@ -10,20 +10,26 @@ use Mtf\Client\Element\Locator; /** - * Class Catalog - * Backend catalog price rule grid + * Backend catalog price rule grid. */ class Catalog extends Grid { /** - * An element locator which allows to select first entity in grid + * An element locator which allows to select first entity in grid. * * @var string */ protected $editLink = '#promo_catalog_grid_table tbody tr:first-child td'; /** - * Filters array mapping + * First row selector. + * + * @var string + */ + protected $firstRowSelector = '//tr[@data-role="row"]/td[@data-column="rule_id"]'; + + /** + * Filters array mapping. * * @var array */ @@ -51,7 +57,7 @@ class Catalog extends Grid ]; /** - * Return row with given catalog price rule name + * Return row with given catalog price rule name. * * @param string $ruleName * @return Element @@ -62,7 +68,7 @@ public function getGridRow($ruleName) } /** - * Return id of catalog price rule with given name + * Return id of catalog price rule with given name. * * @param string $ruleName * @return string @@ -73,7 +79,7 @@ public function getCatalogPriceId($ruleName) } /** - * Check if specific row exists in grid + * Check if specific row exists in grid. * * @param array $filter * @param bool $isSearchable diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php index 9890b9cd69853..f88141e403788 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedCatalogPage.php @@ -15,12 +15,9 @@ */ class AssertCatalogPriceRuleAppliedCatalogPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Catalog Price Rule is applied for product(s) in Catalog diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php index 116fe146cced6..92fdf8f0d6feb 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedProductPage.php @@ -16,12 +16,9 @@ */ class AssertCatalogPriceRuleAppliedProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Catalog Price Rule is applied & it impacts on product's discount price on Product page diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php index c087d660dabcb..c9165158602b7 100755 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedShoppingCart.php @@ -17,12 +17,9 @@ */ class AssertCatalogPriceRuleAppliedShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Catalog Price Rule is applied for product(s) in Shopping Cart diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php index f2ac5427c71e8..c8a093983bdb8 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php @@ -15,12 +15,9 @@ */ class AssertCatalogPriceRuleForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed Catalog Price Rule data on edit page equals passed from fixture. diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php index beb9649650433..d44220288676e 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php @@ -14,12 +14,9 @@ */ class AssertCatalogPriceRuleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that data in grid on Catalog Price Rules page according to fixture diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php index 38bfdb243687f..794ebf12cf43f 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertCatalogPriceRuleNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Catalog Price Rule is not presented in grid and cannot be found using ID, Rule name 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 c1ac9598206d3..222ac7beaf197 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 @@ -13,16 +13,13 @@ */ class AssertCatalogPriceRuleNoticeMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + const NOTICE_MESSAGE_RULES = 'There are rules that have been changed but were not applied.'; const NOTICE_MESSAGE_APPLY = ' Please, click Apply Rules in order to see immediate effect in the catalog.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that message "There are rules that have been changed but were not applied..." * is present on page after Save (without applying Rule) 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 898095ecdd71f..338e6196fe135 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 @@ -13,14 +13,11 @@ */ class AssertCatalogPriceRuleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The rule has been deleted.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'The rule has been deleted.'; /** * Assert that message "The rule has been deleted." is appeared on Catalog Price Rules page. 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 2ea67d0961039..5a5b7fac30cf6 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 @@ -13,14 +13,11 @@ */ class AssertCatalogPriceRuleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The rule has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The rule has been saved.'; /** * Assert that success message is displayed after Catalog Price Rule saved diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml index e7c91a10c31b6..31c1075a6f574 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/etc/constraint.xml @@ -6,13 +6,13 @@ --> - low + low - low + low @@ -20,20 +20,20 @@ - low + low - low + low - high + high @@ -42,20 +42,20 @@ - low + low - low + low - high + high @@ -63,7 +63,7 @@ - high + high diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php index fb988a54c9e0c..e7ecea285adf6 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertAdvancedSearchProductsResult.php @@ -14,6 +14,10 @@ */ class AssertAdvancedSearchProductsResult extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text for notice messages */ @@ -24,13 +28,6 @@ class AssertAdvancedSearchProductsResult extends AbstractConstraint */ const ERROR_MESSAGE = 'No items were found using the following search criteria.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Search results page * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php index 22f7d602b5771..03035ce728f13 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertCatalogSearchResult.php @@ -13,12 +13,9 @@ */ class AssertCatalogSearchResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that result page contains all products, according to search request, from fixture diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php index 901a10844f7ae..1078c8628cc8a 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymMassActionNotOnFrontend.php @@ -15,12 +15,9 @@ */ class AssertSearchSynonymMassActionNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that you will be not redirected to url from dataset after mass delete search term diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php index 82e9e2fe2752e..66a345529c253 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchSynonymNotOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchSynonymNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that you will be not redirected to url from dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php index da7bdbfb93162..132885d14d23f 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermForm.php @@ -16,12 +16,9 @@ */ class AssertSearchTermForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after save a search term on edit term search page displays: diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php index 52d874cf09c50..0be98506864fb 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php @@ -15,12 +15,9 @@ */ class AssertSearchTermInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after save a term search on edit term search page displays: diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php index 33bc31bdc9b16..5571ccc2f8fee 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionNotOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchTermMassActionNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after mass delete a search term not redirect to url in dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php index 654ca3f08b48a..c266bd3e243f0 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermMassActionsNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertSearchTermMassActionsNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after mass delete search terms on grid page are not displayed diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php index 41dcdd8d7dc7e..b408d176d2d4c 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertSearchTermNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after delete a search term on grid page not displayed diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php index 0e7271aa1b46d..581cd1488e9f3 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermNotOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchTermNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that after delete a search term not redirect to url in dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php index 8b1e0bf5a1272..49f557382be90 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php @@ -17,12 +17,9 @@ */ class AssertSearchTermOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Search block on CMS index page 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 063d3ebfd7176..b452330b1448b 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 @@ -14,18 +14,15 @@ */ class AssertSearchTermSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'You deleted the search.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after search term deleted * 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 6ebbf7422aaba..56387dee5fd36 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 @@ -14,18 +14,15 @@ */ class AssertSearchTermSuccessMassDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'Total of %d record(s) were deleted'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after search terms were mass deleted * 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 b4ab1860ac90e..bec2ac3324ebd 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 @@ -14,18 +14,15 @@ */ class AssertSearchTermSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the search term.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after search term save * diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php index 8ebd22f29949f..d8684a2ec5855 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertSearchTermSynonymOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that you will be redirected to url from dataset diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php index 9e5e3c3f242b0..c0f89989b0be2 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php @@ -14,12 +14,9 @@ */ class AssertSuggestSearchingResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Check that after input some text(e.g. product name) into search field, drop-down window is appeared. diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv index 25bbad9bcc99f..687344b622bc9 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/AdvancedSearchEntityTest/test.csv @@ -1,13 +1,13 @@ -"products/simple_1";"products/simple_2";"productSearch/data/name";"productSearch/data/sku";"productSearch/data/description";"productSearch/data/short_description";"productSearch/data/price/value/price_from";"productSearch/data/price/value/price_to";"constraint";"issue" -"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;500;"assertAdvancedSearchProductsResult";"" -"Yes";"-";"abc";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"-";"Yes";"adc_123";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"abc";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"abc";"full";"-";"-";"-";"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"-";"Yes";"-";"-";"dfj_full";"-";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"-";"-";"short";"-";"-";"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"-";"-";"-";"-";"-";"dfj_short";"-";"-";"assertAdvancedSearchProductsResult";"" -"Yes";"-";"-";"-";"-";"-";50;50;"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"Yes";"Yes";"-";"-";"-";"-";"-";100;"assertAdvancedSearchProductsResult";"MAGETWO-30318" -"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;50;"assertAdvancedSearchProductsResult";"MAGETWO-30318" +"products/simple_1";"products/simple_2";"productSearch/data/name";"productSearch/data/sku";"productSearch/data/description";"productSearch/data/short_description";"productSearch/data/price/value/price_from";"productSearch/data/price/value/price_to";"constraint" +"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;500;"assertAdvancedSearchProductsResult" +"Yes";"-";"abc";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"-";"Yes";"adc_123";"-";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"abc";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"abc_dfj";"-";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"abc";"adc_full";"-";"-";"-";"assertAdvancedSearchProductsResult" +"-";"Yes";"-";"-";"dfj_full";"-";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"-";"-";"abc_short";"-";"-";"assertAdvancedSearchProductsResult" +"-";"-";"-";"-";"-";"dfj_short";"-";"-";"assertAdvancedSearchProductsResult" +"Yes";"-";"-";"-";"-";"-";50;50;"assertAdvancedSearchProductsResult" +"Yes";"Yes";"-";"-";"-";"-";"-";100;"assertAdvancedSearchProductsResult" +"Yes";"-";"abc_dfj";"abc_dfj";"adc_Full";"abc_short";49;50;"assertAdvancedSearchProductsResult" diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml index b5d5a966c43bf..5cb45afd90ea7 100644 --- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/etc/constraint.xml @@ -6,21 +6,21 @@ --> - high + high - high + high - high + high @@ -28,7 +28,7 @@ - high + high @@ -36,14 +36,14 @@ - high + high - high + high @@ -51,13 +51,13 @@ - high + high - high + high @@ -65,20 +65,20 @@ - high + high - high + high - high + high @@ -86,7 +86,7 @@ - high + high @@ -94,26 +94,26 @@ - high + high - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php index 326152515a195..c16fd46bb9660 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/CartItem.php @@ -39,7 +39,7 @@ class CartItem extends AbstractCartItem * * @var string */ - protected $wishlistButton = '.actions .towishlist'; + protected $wishlistButton = '.towishlist'; /** * Quantity input selector diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php index a08c1320d5687..a9db2d568234b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/Totals.php @@ -75,7 +75,7 @@ class Totals extends Block * * @var string */ - protected $discount = '//tr[normalize-space(td)="Discount"]//span'; + protected $discount = '//tr[normalize-space(th)="Discount"]//span'; /** * Get shipping price including tax selector diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php index f127a7525187c..be98db0bcc84d 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Billing.php @@ -69,6 +69,13 @@ public function fillBilling( public function clickContinue() { $this->_rootElement->find($this->continue)->click(); - $this->waitForElementNotVisible($this->waitElement); + $browser = $this->browser; + $selector = $this->waitElement; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() == false ? true : null; + } + ); } } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php index 598d38b084600..bbc8045a33a9c 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php @@ -110,6 +110,13 @@ public function loginCustomer(FixtureInterface $customer) public function clickContinue() { $this->_rootElement->find($this->continue)->click(); - $this->waitForElementNotVisible($this->loadingMask); + $browser = $this->browser; + $selector = $this->loadingMask; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() == false ? true : null; + } + ); } } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Methods.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Methods.php index 06a00f980a0da..6860ff962305c 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Methods.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Payment/Methods.php @@ -97,6 +97,13 @@ public function selectPaymentMethod(array $payment) public function clickContinue() { $this->_rootElement->find($this->continue)->click(); - $this->waitForElementNotVisible($this->waitElement); + $browser = $this->browser; + $selector = $this->waitElement; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() == false ? true : null; + } + ); } } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping/Method.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping/Method.php index 740e62309ff2a..8d78df6e28b03 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping/Method.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Shipping/Method.php @@ -57,6 +57,13 @@ public function selectShippingMethod(array $method) public function clickContinue() { $this->_rootElement->find($this->continue)->click(); - $this->waitForElementNotVisible($this->waitElement); + $browser = $this->browser; + $selector = $this->waitElement; + $browser->waitUntil( + function () use ($browser, $selector) { + $element = $browser->find($selector); + return $element->isVisible() == false ? true : null; + } + ); } } 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 37f9240b5ea13..7e3bf2a25091e 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 @@ -15,18 +15,15 @@ */ class AssertAddedProductToCartSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success add to cart message */ const SUCCESS_MESSAGE = 'You added %s to your shopping cart.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert success message is appeared on Shopping Cart page * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php index b8a2b0b6ded93..c3bf38ed68bc8 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartIsEmpty.php @@ -16,18 +16,15 @@ */ class AssertCartIsEmpty extends AbstractConstraint { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Text of empty cart. */ const TEXT_EMPTY_CART = 'You have no items in your shopping cart. Click here to continue shopping.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Check that Shopping Cart is empty, opened page contains text "You have no items in your shopping cart. * Click here to continue shopping." where 'here' is link that leads to index page diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php index 9d322ee6cccc6..012b8c93d959a 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertCartItemsOptions.php @@ -20,12 +20,9 @@ */ class AssertCartItemsOptions extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Error message for verify options diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php index 4f72a39ecc97a..2ebf1fdf8739d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php @@ -15,12 +15,9 @@ */ class AssertGrandTotalInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that grand total is equal to expected diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php index ec9d5fc410723..366a932b7d4f9 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderSuccessPlacedMessage.php @@ -14,18 +14,15 @@ */ class AssertOrderSuccessPlacedMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message of success checkout */ const SUCCESS_MESSAGE = 'Thank you for your purchase!'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is correct * diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php index 05b0a19ab813b..3a6519e8a0149 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertOrderTotalOnReviewPage.php @@ -14,12 +14,9 @@ */ class AssertOrderTotalOnReviewPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Order Grand Total is correct on checkoutOnePage diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php index e847d4a94941f..d78462b09b197 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertPriceInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertPriceInShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that price in the shopping cart equals to expected price from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php index 8f6e5bab5f11b..2330375ed3d61 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductAbsentInMiniShoppingCart.php @@ -15,12 +15,9 @@ */ class AssertProductAbsentInMiniShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product is absent on mini shopping cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php index 831e30d772b1b..b3d5a8e839135 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductIsNotEditable.php @@ -14,12 +14,9 @@ */ class AssertProductIsNotEditable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after adding products by sku to shopping cart products are not editable diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php index 666bd03faef90..3406dcd5a13e1 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInMiniShoppingCart.php @@ -14,12 +14,9 @@ */ class AssertProductPresentInMiniShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product is present on mini shopping cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php index 8972eb988c19f..e6462f1d6bd3e 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductPresentInShoppingCart.php @@ -14,12 +14,9 @@ */ class AssertProductPresentInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products are present in shopping cart diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php index 15afe1b503173..40965b58dba31 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertProductQtyInMiniShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product quantity in the mini shopping cart is equals to expected quantity from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php index eafcb8e8254c9..9eb776fbe0441 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertProductQtyInShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that quantity in the shopping cart is equals to expected quantity from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php index d6afd6ead57d4..afdc84c3e1175 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertProductsAbsentInShoppingCart.php @@ -13,12 +13,9 @@ */ class AssertProductsAbsentInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products are absent in shopping cart. diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php index b1737d081ff4e..714c892ebb992 100755 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertSubtotalInShoppingCart extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that subtotal total in the shopping cart is equals to expected total from data set diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php index 3c70d197a28bc..0a5e0983602ab 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.php @@ -96,17 +96,16 @@ public function test() */ public function tearDown() { - $setConfigStep = $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - ); - $setConfigStep->run(); - $this->customerAccountLogout->open(); // Deleting exchange rates $this->rewardRateIndexPage->open(); while ($this->rewardRateIndexPage->getRewardRateGrid()->isFirstRowVisible()) { $this->rewardRateIndexPage->getRewardRateGrid()->openFirstRow(); $this->rewardRateNewPage->getFormPageActions()->delete(); } + $this->customerAccountLogout->open(); + $this->objectManager->create( + 'Magento\Core\Test\TestStep\SetupConfigurationStep', + ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] + )->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml index d69ba6b2b4d3a..3fe824217264b 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/etc/constraint.xml @@ -6,51 +6,51 @@ --> - middle + middle - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php index 759cde768461a..934d76bb1a55a 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentInGrid.php @@ -15,12 +15,9 @@ */ class AssertTermAbsentInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that checkout agreement is absent in agreement grid. diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php index 448210dccd934..b7378c6ec925d 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermAbsentOnCheckout.php @@ -20,12 +20,9 @@ */ class AssertTermAbsentOnCheckout extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Place order and verify there is no checkbox Terms and Conditions. diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php index 7b2e8e2e0c784..7b68299d51cc6 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermInGrid.php @@ -15,12 +15,9 @@ */ class AssertTermInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that checkout agreement is present in agreement grid. diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php index cefceb9faef82..60b0a2cf7ed5a 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/Constraint/AssertTermOnCheckout.php @@ -21,18 +21,15 @@ */ class AssertTermOnCheckout extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Notification message */ const NOTIFICATION_MESSAGE = 'This is a required field.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Check that checkbox is present on the last checkout step - Order Review. * Check that after Place order without click on checkbox "Terms and Conditions" order was not successfully placed. 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 45609ba6cf6fe..108af365a812b 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 @@ -14,18 +14,15 @@ */ class AssertTermSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Success terms and conditions delete message */ const SUCCESS_DELETE_MESSAGE = 'The condition has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after deleting Term successful delete message appears. * 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 826e7074ed2c8..5b7abc860efc1 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 @@ -14,18 +14,15 @@ */ class AssertTermSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Success terms and conditions save message */ const SUCCESS_SAVE_MESSAGE = 'The condition has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after save block successful message appears. * diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv index 45ac149ca4243..2d45351830d47 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/CreateTermEntityTest/test.csv @@ -1,5 +1,5 @@ -"product";"agreement/data/name";"agreement/data/is_active";"agreement/data/is_html";"agreement/data/stores/dataSet/0";"agreement/data/checkbox_text";"agreement/data/content";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint" -"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"name%isolation%";"Disabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout" +"product";"agreement/data/name";"agreement/data/is_active";"agreement/data/is_html";"agreement/data/stores/dataSet/0";"agreement/data/checkbox_text";"agreement/data/content";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint";"issue" +"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout";"MAGETWO-31306" +"catalogProductSimple::default";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout";"MAGETWO-31306" +"catalogProductSimple::default";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout";"MAGETWO-31306" +"catalogProductSimple::default";"name%isolation%";"Disabled";"Text";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout";"" diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv index 5c9fa47f3d824..8b971e8284429 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/UpdateTermEntityTest/test.csv @@ -1,4 +1,4 @@ -"product";"agreementOrigin/dataSet";"agreement/data/name";"agreement/data/is_active";"agreement/data/is_html";"agreement/data/stores/dataSet/0";"agreement/data/checkbox_text";"agreement/data/content";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint" -"catalogProductSimple::default";"term_disabled_text";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"term_disabled_html";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout" -"catalogProductSimple::default";"term_enabled_text";"name%isolation%";"Disabled";"HTML";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout" +"product";"agreementOrigin/dataSet";"agreement/data/name";"agreement/data/is_active";"agreement/data/is_html";"agreement/data/stores/dataSet/0";"agreement/data/checkbox_text";"agreement/data/content";"shipping/shipping_service";"shipping/shipping_method";"payment/method";"constraint";"issue" +"catalogProductSimple::default";"term_disabled_text";"name%isolation%";"Enabled";"HTML";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout";"MAGETWO-31306" +"catalogProductSimple::default";"term_disabled_html";"name%isolation%";"Enabled";"Text";"default";"test_checkbox%isolation%";"";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermOnCheckout";"MAGETWO-31306" +"catalogProductSimple::default";"term_enabled_text";"name%isolation%";"Disabled";"HTML";"default";"test_checkbox%isolation%";"TestMessage%isolation%";"Flat Rate";"Fixed";"checkmo";"assertTermSuccessSaveMessage, assertTermInGrid, assertTermAbsentOnCheckout";"" diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml index 2ef9a4714aa9e..f8540733ad2da 100644 --- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/etc/constraint.xml @@ -6,21 +6,21 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low 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 a8d92c224cfc3..d73e31987db72 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 @@ -14,14 +14,11 @@ */ class AssertCmsBlockDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The block has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'The block has been deleted.'; /** * Assert that after delete CMS block successful message appears diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php index 622b81ad3320e..ce206694c966e 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockInGrid.php @@ -15,12 +15,9 @@ */ class AssertCmsBlockInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS block can be found in grid via: diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php index bbd3cf70fb279..f702e0437617c 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCmsBlockNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS block can't be found in grid via: diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php index 294fb449a96b3..f20eb8abc2844 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php @@ -17,12 +17,9 @@ */ class AssertCmsBlockNotOnCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created CMS block non visible on frontend category page diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php index 33fe24ee2cb00..8f8de2f6c360a 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php @@ -17,12 +17,9 @@ */ class AssertCmsBlockOnCategoryPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created CMS block displayed on frontend category page (in order to assign block to category: 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 16a525b9f3541..91c9d85d0ceb9 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 @@ -14,14 +14,11 @@ */ class AssertCmsBlockSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'The block has been saved.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_SAVE_MESSAGE = 'The block has been saved.'; /** * Assert that after save block successful message appears 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 5627dacb51a45..d6a5fedbd6024 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 @@ -13,14 +13,11 @@ */ class AssertCmsPageDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The page has been deleted.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'The page has been deleted.'; /** * Assert that success message is displayed after Cms page delete diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php index 02f8bddd50ff9..8a8184fd74377 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php @@ -17,14 +17,11 @@ */ class AssertCmsPageDisabledOnFrontend extends AbstractConstraint { - const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; /** * Assert that created CMS page with 'Status' - Disabled displays with '404 Not Found' message on Frontend. 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 681438f1607fb..f6edec0ab79d9 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 @@ -14,14 +14,11 @@ */ class AssertCmsPageDuplicateErrorMessage extends AbstractConstraint { - const ERROR_SAVE_MESSAGE = 'A page URL key for specified store already exists.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_SAVE_MESSAGE = 'A page URL key for specified store already exists.'; /** * Verify that page has not been created diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php index 85e432fcea463..50775af83727b 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageForm.php @@ -16,12 +16,9 @@ */ class AssertCmsPageForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php index e6a762f6cc791..3f7de355b0d0b 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageInGrid.php @@ -15,12 +15,9 @@ */ class AssertCmsPageInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that cms page is present in pages grid diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php index b23c7a4144bf5..3984f7e520a02 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPageNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertCmsPageNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Cms page is not present in pages grid diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php index ad286799d9c99..a3d30935640b9 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsPagePreview.php @@ -18,12 +18,9 @@ */ class AssertCmsPagePreview extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that content of created cms page displayed in section 'maincontent' and equals passed from fixture. 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 3ace5d831ef71..6c8f66a199cc4 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 @@ -14,14 +14,11 @@ */ class AssertCmsPageSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'The page has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'The page has been saved.'; /** * Assert that after save a CMS page "The page has been saved." successful message appears diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php index 2ce394b712fb8..81ba3fcb864a6 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertUrlRewriteCmsPageRedirect.php @@ -17,12 +17,9 @@ */ class AssertUrlRewriteCmsPageRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS Page URL Rewrite lead to appropriate page in frontend diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php index de72b500270d9..4a9f1876002df 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/AbstractCmsBlockEntityTest.php @@ -111,7 +111,7 @@ public function tearDown() $this->storeIndex->getStoreGrid()->searchAndOpen($filter); $this->storeNew->getFormPageActions()->delete(); $this->storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']); - $this->storeDelete->getFormPageFooterActions()->delete(); + $this->storeDelete->getFormPageActions()->delete(); } } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php index e67b95ee703f6..6e96872106de4 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php @@ -35,7 +35,6 @@ class CreateCmsBlockEntityTest extends AbstractCmsBlockEntityTest */ public function test(CmsBlock $cmsBlock) { - $this->markTestIncomplete('MAGETWO-28916, MAGETWO-30362'); // Prepare data for tearDown $this->storeName = $cmsBlock->getStores(); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php index 6bdea75561e6c..9bca655fbcdd1 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsPageEntityTest.php @@ -62,7 +62,6 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew) */ public function test(CmsPageFixture $cms) { - $this->markTestIncomplete('MAGETWO-30362'); // Steps $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreatePageTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreatePageTest.php index 2e57c2a33da9a..9596d8fca7bdd 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreatePageTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreatePageTest.php @@ -20,7 +20,7 @@ class CreatePageTest extends Functional */ protected function setUp() { - $this->markTestIncomplete('MAGETWO-29634, MAGETWO-30362'); + $this->markTestIncomplete('MAGETWO-29634'); Factory::getApp()->magentoBackendLoginUser(); } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php index afd31a625d651..a921942a35338 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsBlockEntityTest.php @@ -67,7 +67,6 @@ public function __inject( */ public function test(CmsBlock $cmsBlock) { - $this->markTestIncomplete('MAGETWO-28916, MAGETWO-30362'); // Precondition $cmsBlock->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php index 81e360b6e731d..47574ebb71a95 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/DeleteCmsPageEntityTest.php @@ -65,7 +65,6 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew) */ public function test(CmsPage $cmsPage) { - $this->markTestIncomplete('MAGETWO-30362'); // Preconditions $cmsPage->persist(); $filter = [ diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php index 2f2322985147f..791e8e6fd2e4d 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsBlockEntityTest.php @@ -37,7 +37,6 @@ class UpdateCmsBlockEntityTest extends AbstractCmsBlockEntityTest */ public function test(CmsBlock $initialCmsBlock, CmsBlock $cmsBlock) { - $this->markTestIncomplete('MAGETWO-28916, MAGETWO-30362'); // Precondition $initialCmsBlock->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php index 102abee0fc164..17e31a45a5e3d 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageEntityTest.php @@ -80,7 +80,7 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew, CmsPage $cmsOrigina */ public function test(CmsPage $cms, CmsPage $cmsOriginal) { - $this->markTestIncomplete('MAGETWO-29634, MAGETWO-30362'); + $this->markTestIncomplete('MAGETWO-29634'); // Steps $this->cmsIndex->open(); $filter = ['title' => $cmsOriginal->getTitle()]; diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php index 92708a55fc697..aae15f7fbeafe 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/UpdateCmsPageRewriteEntityTest.php @@ -149,6 +149,6 @@ public function tearDown() $this->storeIndex->getStoreGrid()->searchAndOpen($filter); $this->storeNew->getFormPageActions()->delete(); $this->storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']); - $this->storeDelete->getFormPageFooterActions()->delete(); + $this->storeDelete->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/constraint.xml index 51a80ff76997b..337f6cfdf80e9 100644 --- a/dev/tests/functional/tests/app/Magento/Cms/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Cms/Test/etc/constraint.xml @@ -6,32 +6,32 @@ --> - low + low - low + low - high + high - low + low - high + high @@ -40,7 +40,7 @@ - high + high @@ -49,7 +49,7 @@ - low + low @@ -58,7 +58,7 @@ - low + low @@ -66,7 +66,7 @@ - low + low @@ -76,26 +76,26 @@ - high + high - low + low - low + low - low + low - low + low @@ -103,6 +103,6 @@ - low + low diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php index e3b2228f619a8..51b56ffe5da6f 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductIsNotDisplayedSeparately.php @@ -16,12 +16,9 @@ */ class AssertChildProductIsNotDisplayedSeparately extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that products generated during configurable product creation - are not visible on frontend(by default). diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php index 8705104e198d4..7beb7d05683e4 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertChildProductsInGrid.php @@ -15,18 +15,15 @@ */ class AssertChildProductsInGrid extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Default status visibility on child products */ const NOT_VISIBLE_INDIVIDUALLY = 'Not Visible Individually'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that child products generated during configurable product are present in products grid * diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php index 4aee31a50d837..59a23c1e9e1f9 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesAbsentOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertConfigurableAttributesAbsentOnProductPage extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted configurable attributes are absent on product page on frontend. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php index 08c590daf1ec3..4c565a232550a 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableAttributesBlockIsAbsentOnProductPage.php @@ -15,12 +15,9 @@ */ class AssertConfigurableAttributesBlockIsAbsentOnProductPage extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that all configurable attributes is absent on product page on frontend. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php index cfeb9d1b8e4da..4c6ea9e268ee9 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductDuplicateForm.php @@ -10,20 +10,16 @@ use Mtf\Fixture\FixtureInterface; /** - * Class AssertConfigurableProductDuplicateForm - * Assert form data equals duplicate product configurable data + * Assert form data equals duplicate product configurable data. */ class AssertConfigurableProductDuplicateForm extends AssertConfigurableProductForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Assert form data equals duplicate product configurable data + * Assert form data equals duplicate product configurable data. * * @param FixtureInterface $product * @param CatalogProductIndex $productGrid @@ -50,7 +46,33 @@ public function processAssert( } /** - * Returns a string representation of the object + * Prepares fixture data for comparison. + * + * @param array $data + * @param array $sortFields [optional] + * @return array + */ + protected function prepareFixtureData(array $data, array $sortFields = []) + { + $data['url_key'] = $this->prepareUrlKey($data['url_key']); + return parent::prepareFixtureData($data, $sortFields); + } + + /** + * Prepare url key. + * + * @param string $urlKey + * @return string + */ + protected function prepareUrlKey($urlKey) + { + preg_match("~\d+$~", $urlKey, $matches); + $key = intval($matches[0]) + 1; + return str_replace($matches[0], $key, $urlKey); + } + + /** + * Returns a string representation of the object. * * @return string */ diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php index a7de0406e861e..840dd0a6f9f80 100755 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Constraint/AssertConfigurableProductForm.php @@ -13,6 +13,10 @@ */ class AssertConfigurableProductForm extends AssertProductForm { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * List skipped fixture fields in verify * @@ -56,13 +60,6 @@ class AssertConfigurableProductForm extends AssertProductForm 'configurable_attribute', ]; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Prepares fixture data for comparison * 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 6d7eb4257b510..dde6688d19a5d 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 @@ -18,18 +18,15 @@ */ class AssertProductAttributeAbsenceInVariationsSearch extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Label "Variations" tab */ const TAB_VARIATIONS = 'variations'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control * 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 d2beabb26f30c..8e75bb524c611 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 @@ -16,12 +16,9 @@ */ class AssertProductAttributeIsConfigurable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert check whether the attribute is used to create a configurable products. diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml index 57573eab9f0b9..afba8d58b2c35 100644 --- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/etc/constraint.xml @@ -6,39 +6,39 @@ --> - low + low - high + high - middle + middle - low + low - low + low - low + low - high + high - low + low - high + high - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php index e58d3903ec42d..5eb80ff77d1d9 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableForm.php @@ -17,12 +17,9 @@ */ class AssertCustomVariableForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php index d389eb798b6a8..56e36a60aeaa9 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInGrid.php @@ -16,12 +16,9 @@ */ class AssertCustomVariableInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert custom variable is displayed on backend in custom variable grid diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php index 5a3cab10ee50a..62b2df94d024b 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableInPage.php @@ -17,12 +17,9 @@ */ class AssertCustomVariableInPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Add created variable to page and assert that Custom Variable is displayed on frontend page and has diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php index 2597200cfe38e..0eb9acb770eca 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInCmsPageForm.php @@ -14,12 +14,9 @@ */ class AssertCustomVariableNotInCmsPageForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that custom system variable not in cms page form diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php index 9f07e5912f745..130d940682d2f 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertCustomVariableNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Custom System Variable not available in System Variable grid diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php index 79df2412d06f2..c33b618a4e0e0 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertCustomVariableSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the custom variable.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the custom variable.'; /** * Assert that success delete message is correct after Custom System Variable deleted diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php index 24480eb498402..2583597add05b 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Constraint/AssertCustomVariableSuccessSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertCustomVariableSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'You saved the custom variable.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'You saved the custom variable.'; /** * Assert that success delete message is correct after Custom System Variable deleted diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/Repository/ConfigData.php b/dev/tests/functional/tests/app/Magento/Core/Test/Repository/ConfigData.php index 3e1d69ac93f09..3520957a0d690 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/Repository/ConfigData.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/Repository/ConfigData.php @@ -24,6 +24,15 @@ class ConfigData extends AbstractRepository */ public function __construct(array $defaultConfig = [], array $defaultData = []) { + $this->_data['secure_url'] = [ + 'section' => [ + 'path' => 'web/secure/base_url', + 'scope' => 'default', + 'scope_id' => 1, + 'value' => str_replace('http:', 'https:', $_ENV['app_backend_url']), + ] + ]; + $this->_data['compare_products'] = [ 'section' => [ [ @@ -1254,6 +1263,28 @@ public function __construct(array $defaultConfig = [], array $defaultData = []) ], ]; + $this->_data['shipping_tax_class_taxable_goods'] = [ + 'section' => [ + [ + 'path' => 'tax/classes/shipping_tax_class', + 'scope' => 'tax', + 'scope_id' => '1', + 'value' => '2' + ] + ] + ]; + + $this->_data['shipping_tax_class_taxable_goods_rollback'] = [ + 'section' => [ + [ + 'path' => 'tax/classes/shipping_tax_class', + 'scope' => 'tax', + 'scope_id' => '1', + 'value' => '0' + ] + ] + ]; + $this->_data['row_cat_incl_ship_excl_after_disc_on_excl'] = array_replace_recursive( $taxCalculationConf, diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php index ef9ff97885bb2..565463e154879 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Core/Test/TestCase/UpdateCustomVariableEntityTest.php @@ -135,6 +135,6 @@ public static function tearDownAfterClass() $storeNew->getFormPageActions()->delete(); $storeDelete = ObjectManager::getInstance()->create('Magento\Backend\Test\Page\Adminhtml\StoreDelete'); $storeDelete->getStoreForm()->fillForm(['create_backup' => 'No']); - $storeDelete->getFormPageFooterActions()->delete(); + $storeDelete->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml index 1e66bbe7ac451..9d55de2150388 100644 --- a/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Core/Test/etc/constraint.xml @@ -6,27 +6,27 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php index ee06c41025320..b095afb9e1a75 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php @@ -17,12 +17,9 @@ */ class AssertCurrencySymbolOnCatalogPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after applying changes, currency symbol changed on Catalog page diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php index 8787f6d1fb88f..1342144a74b65 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php @@ -17,12 +17,9 @@ */ class AssertCurrencySymbolOnProductPage extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after applying changes, currency symbol changed on Product Details 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 af0f841a8670b..307413dad2ad5 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 @@ -14,14 +14,11 @@ */ class AssertCurrencySymbolSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'The custom currency symbols were applied.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'The custom currency symbols were applied.'; /** * Assert that after clicking on 'Save Currency Symbols' button success message appears. diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/constraint.xml index e517674ba85f3..0f1d7f25df7d2 100644 --- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/etc/constraint.xml @@ -6,13 +6,13 @@ --> - low + low - low + low @@ -22,7 +22,7 @@ - low + low diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml index 8e4af46e3ba2d..edd9de53702cb 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -27,7 +27,7 @@ \Magento\Customer\Test\Block\Adminhtml\Edit\Tab\Addresses - #customer_info_tabs_addresses + #tab_customer_address css selector diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php index 697cd9bd57ac5..5d185b181e8c4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/FormPageActions.php @@ -29,4 +29,15 @@ public function createOrder() { $this->_rootElement->find($this->createOrderButton)->click(); } + + /** + * Wait for User before click on any Button which calls JS validation on correspondent form. + * See details in MAGETWO-31121. + * + * @return void + */ + protected function waitBeforeClick() + { + sleep(0.2); + } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php index 7cf921551e869..3fa6c1f373f8e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.php @@ -22,14 +22,14 @@ class Addresses extends Tab * * @var string */ - protected $addNewAddress = '#add_address_button'; + protected $addNewAddress = '.address-list-actions .add'; /** * Open customer address * * @var string */ - protected $customerAddress = '//*[@id="address_list"]/li[%d]/a'; + protected $customerAddress = '//*[contains(@class, "address-list-item")][%d]'; /** * Magento loader diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml index 1b28870768415..877cdbedaab9c 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Adminhtml/Edit/Tab/Addresses.xml @@ -7,65 +7,65 @@ - #address_form_container [aria-hidden="false"] [name^="address"][name$="[prefix]"] + .address-item-edit:not([style="display: none;"]) [name$="[prefix]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[firstname]"] + .address-item-edit:not([style="display: none;"]) [name$="[firstname]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[middlename]"] + .address-item-edit:not([style="display: none;"]) [name$="[middlename]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[lastname]"] + .address-item-edit:not([style="display: none;"]) [name$="[lastname]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[suffix]"] + .address-item-edit:not([style="display: none;"]) [name$="[suffix]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[company]"] + .address-item-edit:not([style="display: none;"]) [name$="[company]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[street][0]"] + .address-item-edit:not([style="display: none;"]) [name$="[street][0]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[city]"] + .address-item-edit:not([style="display: none;"]) [name$="[city]"] css selector select - #address_form_container [aria-hidden="false"] [name^="address"][name$="[country_id]"] + .address-item-edit:not([style="display: none;"]) [name$="[country_id]"] css selector select - #address_form_container [aria-hidden="false"] [name^="address"][name$="[region_id]"] + .address-item-edit:not([style="display: none;"]) [name$="[region_id]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[region]"] + .address-item-edit:not([style="display: none;"]) [name$="[region]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[postcode]"] + .address-item-edit:not([style="display: none;"]) [name$="[postcode]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[telephone]"] + .address-item-edit:not([style="display: none;"]) [name$="[telephone]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[fax]"] + .address-item-edit:not([style="display: none;"]) [name$="[fax]"] css selector - #address_form_container [aria-hidden="false"] [name^="address"][name$="[vat_id]"] + .address-item-edit:not([style="display: none;"]) [name$="[vat_id]"] css selector diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php index 1f205adcf4bde..2239c93e3c384 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/CustomerForm.php @@ -6,29 +6,36 @@ namespace Magento\Customer\Test\Block\Form; use Mtf\Block\Form; +use Magento\Customer\Test\Fixture\CustomerInjectable; /** - * Class CustomerForm - * Customer account edit form + * Customer account edit form. */ class CustomerForm extends Form { /** - * Save button button css selector + * Save button button css selector. * * @var string */ protected $saveButton = '[type="submit"]'; /** - * Locator for customer attribute on Edit Account Information page + * Locator for customer attribute on Edit Account Information page. * * @var string */ protected $customerAttribute = "[name='%s[]']"; /** - * Click on save button + * Validation text message for a field. + * + * @var string + */ + protected $validationText = '.mage-error[for="%s"]'; + + /** + * Click on save button. * * @return void */ @@ -36,4 +43,23 @@ public function submit() { $this->_rootElement->find($this->saveButton)->click(); } + + /** + * Get all error validation messages for fields. + * + * @param CustomerInjectable $customer + * @return array + */ + public function getValidationMessages(CustomerInjectable $customer) + { + $messages = []; + foreach (array_keys($customer->getData()) as $field) { + $element = $this->_rootElement->find(sprintf($this->validationText, str_replace('_', '-', $field))); + if ($element->isVisible()) { + $messages[$field] = $element->getText(); + } + } + + return $messages; + } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php index e982b0679ec4b..1324e570887fd 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedBackend.php @@ -17,12 +17,9 @@ */ class AssertAddressDeletedBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted customers address is not displayed on backend during order creation diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php index 0cb8b92283136..715f486d2ea37 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertAddressDeletedFrontend.php @@ -14,18 +14,15 @@ */ class AssertAddressDeletedFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Expected message */ const EXPECTED_MESSAGE = 'You have no additional address entries in your address book.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Asserts that Asserts that 'Additional Address Entries' contains expected message * 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 303396983dd64..8aa04ec41ebae 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 @@ -14,18 +14,15 @@ */ class AssertChangePasswordFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Fail message */ const FAIL_MESSAGE = "Password doesn't match for this account."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that fail message is present * 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 f3f15e0e595e4..f67967415e805 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 @@ -13,14 +13,11 @@ */ class AssertCustomerAddressSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The address has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The address has been saved.'; /** * Asserts that success message equals to expected message diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php index 705fc4fe3b6ee..4c4e0444ef18e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerDefaultAddresses.php @@ -14,12 +14,9 @@ */ class AssertCustomerDefaultAddresses extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that Default Billing Address and Default Shipping Address equal to data from fixture 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 7011fc186ed04..fe58f72b4ea5c 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 @@ -13,12 +13,9 @@ */ class AssertCustomerFailRegisterMessage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that error message is displayed on "Create New Customer Account" page(frontend) diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php index ad6c854fc6e5d..8a5d7eccb108e 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerForm.php @@ -17,12 +17,9 @@ */ class AssertCustomerForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Skipped fields for verify data 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 a25028f2fca1f..2110b965f27a5 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 @@ -13,14 +13,11 @@ */ class AssertCustomerGroupAlreadyExists extends AbstractConstraint { - const ERROR_MESSAGE = 'Customer Group already exists.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'Customer Group already exists.'; /** * Assert that customer group already exist diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php index e3802aec8ef22..e351c823a5b17 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupForm.php @@ -15,12 +15,9 @@ */ class AssertCustomerGroupForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields while verifying diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php index 103079c891f93..01a077bc67cf8 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupInGrid.php @@ -14,12 +14,9 @@ */ class AssertCustomerGroupInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer group in grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php index 030fd19b007b1..0e15cae8dc4a8 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertCustomerGroupNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer group not in grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php index 43e5f337e7917..b9f65ebc6a135 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php @@ -17,12 +17,9 @@ */ class AssertCustomerGroupOnCustomerForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer group find on account information page 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 b405b2592df2a..0e41d813a855b 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 @@ -13,14 +13,11 @@ */ class AssertCustomerGroupSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = "The customer group has been deleted."; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE= "The customer group has been deleted."; /** * Assert that message "The customer group has been deleted." is displayed on Customer Group page. 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 63778b9060f2a..51c7bd74cede4 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 @@ -13,14 +13,11 @@ */ class AssertCustomerGroupSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The customer group has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The customer group has been saved.'; /** * Assert that success message is displayed after customer group save diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php index 88bcc70e9dc80..8b0e33b22ba80 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert customer availability in Customer Grid 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 0ebe3f78886fc..6f52c76daf006 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 @@ -13,14 +13,11 @@ */ class AssertCustomerInfoSuccessSavedMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The account information has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The account information has been saved.'; /** * Asserts that success message equals to expected message 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 c2c3b7384f313..4c2126fdebd3d 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 @@ -15,14 +15,11 @@ */ class AssertCustomerInvalidEmail extends AbstractConstraint { - const ERROR_EMAIL_MESSAGE = 'Please correct this email address: "%email%".'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + const ERROR_EMAIL_MESSAGE = 'Please correct this email address: "%email%".'; /** * Assert that error message "Please correct this email address: "%email%"." is displayed diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php index 1816ba92d482a..38d155bd06df4 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerMassDeleteInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customers which haven't been deleted are present in customer grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php index 9f07488b73bbf..2a591e1f32294 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerMassDeleteNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerMassDeleteNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that mass deleted customers are not in customer's grid 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 b30037df9b044..7c65b45050019 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 @@ -14,18 +14,15 @@ */ class AssertCustomerMassDeleteSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that appears after deletion via mass actions */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) were deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that message "A total of "x" record(s) were deleted." * diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php index b449817f0d1a5..7f9ea84155b5d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Asserts that customer is not in customer's grid diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php index 8782b7fc05c42..9e749fff3625d 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerPasswordChanged.php @@ -12,28 +12,18 @@ use Mtf\Fixture\FixtureFactory; /** - * Class AssertCustomerPasswordChanged - * Check that login again to frontend with new password was success + * Check that login again to frontend with new password was success. */ class AssertCustomerPasswordChanged extends AbstractConstraint { - /** - * Welcome message after login - */ - const SUCCESS_MESSAGE = 'Hello, %s!'; - - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Assert that login again to frontend with new password was success + * Assert that login again to frontend with new password was success. * * @param FixtureFactory $fixtureFactory - * @param CmsIndex $cmsIndex * @param CustomerAccountIndex $customerAccountIndex * @param CustomerInjectable $initialCustomer * @param CustomerInjectable $customer @@ -41,16 +31,10 @@ class AssertCustomerPasswordChanged extends AbstractConstraint */ public function processAssert( FixtureFactory $fixtureFactory, - CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex, CustomerInjectable $initialCustomer, CustomerInjectable $customer ) { - $cmsIndex->open(); - if ($cmsIndex->getLinksBlock()->isVisible()) { - $cmsIndex->getLinksBlock()->openLink('Log Out'); - } - $customer = $fixtureFactory->createByCode( 'customerInjectable', [ @@ -63,21 +47,19 @@ public function processAssert( ] ); - $loginCustomer = $this->objectManager->create( + $this->objectManager->create( 'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep', ['customer' => $customer] - ); - $loginCustomer->run(); + )->run(); - $customerName = $initialCustomer->getFirstname() . " " . $initialCustomer->getLastname(); - \PHPUnit_Framework_Assert::assertEquals( - sprintf(self::SUCCESS_MESSAGE, $customerName), - $customerAccountIndex->getInfoBlock()->getWelcomeText() + \PHPUnit_Framework_Assert::assertTrue( + $customerAccountIndex->getAccountMenuBlock()->isVisible(), + 'Customer Account Dashboard is not visible.' ); } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ 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 067452aad8d8a..88ab8881dac7b 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 @@ -13,14 +13,11 @@ */ class AssertCustomerSuccessDeleteMessage extends AbstractConstraint { - const DELETE_MESSAGE = 'You deleted the customer.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const DELETE_MESSAGE = 'You deleted the customer.'; /** * Asserts that actual delete message equals expected 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 76e729d7a36f8..460299ed2bb06 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 @@ -14,14 +14,11 @@ */ class AssertCustomerSuccessRegisterMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'Thank you for registering with Main Website Store.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'Thank you for registering with Main Website Store.'; /** * Assert that success message is displayed after customer registered on frontend 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 943c391734474..1cbfa225cbf62 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 @@ -14,14 +14,11 @@ */ class AssertCustomerSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the customer.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the customer.'; /** * Assert that success message is displayed after customer save 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 8c6c03f915e04..fb3385e37ea79 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 @@ -15,18 +15,15 @@ */ class AssertMassActionSuccessUpdateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const UPDATE_MESSAGE = 'A total of %d record(s) were updated.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert update message is appears on customer grid (Customers > All Customers) * diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php index 07419bbe8929b..1d5ac6eaa5d12 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php @@ -5,48 +5,52 @@ namespace Magento\Customer\Test\Constraint; +use Magento\Customer\Test\Fixture\CustomerInjectable; use Magento\Customer\Test\Page\CustomerAccountEdit; use Mtf\Constraint\AbstractConstraint; /** - * Class AssertWrongPassConfirmationMessage - * Check that conformation message is present + * Check that conformation message is present. */ class AssertWrongPassConfirmationMessage extends AbstractConstraint { - /** - * Conformation message - */ - const CONFIRMATION_MESSAGE = 'Confirm your new password'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Constraint severeness - * - * @var string + * Conformation message */ - protected $severeness = 'low'; + const CONFIRMATION_MESSAGE = 'Please enter the same value again.'; /** - * Assert that conformation message is present + * Assert that conformation message is present. * + * @param CustomerInjectable $customer * @param CustomerAccountEdit $customerAccountEdit * @return void */ - public function processAssert(CustomerAccountEdit $customerAccountEdit) + public function processAssert(CustomerInjectable $customer, CustomerAccountEdit $customerAccountEdit) { - \PHPUnit_Framework_Assert::assertEquals( - self::CONFIRMATION_MESSAGE, - $customerAccountEdit->getMessages()->getErrorMessages() - ); + $validationMessages = $customerAccountEdit->getAccountInfoForm()->getValidationMessages($customer); + if (isset($validationMessages['password_confirmation'])) { + \PHPUnit_Framework_Assert::assertEquals( + self::CONFIRMATION_MESSAGE, + $validationMessages['password_confirmation'], + 'Wrong password confirmation validation text message.' + ); + } else { + \PHPUnit_Framework_TestCase::fail('Password confirmation validation message is absent.'); + } } /** - * Returns a string representation of the object + * Returns a string representation of the object. * * @return string */ public function toString() { - return 'Conformation message is displayed.'; + return 'Password confirmation validation text message is displayed.'; } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php index e5fd1b32a46ac..737a31217f859 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Handler/CustomerInjectable/Curl.php @@ -22,7 +22,7 @@ class Curl extends AbstractCurl implements CustomerInjectableInterface /** * Default customer group */ - const GENERAL_GROUP = 'General'; + const GENERAL_GROUP = '1'; /** * Mapping values for data @@ -30,13 +30,8 @@ class Curl extends AbstractCurl implements CustomerInjectableInterface * @var array */ protected $mappingData = [ - 'group_id' => [ - self::GENERAL_GROUP => 1, - 'Wholesale' => 2, - 'Retailer' => 3, - ], 'country_id' => [ - 'United States' => 'US', + 'United States' => 'US' ], 'region_id' => [ 'California' => 12, @@ -58,8 +53,8 @@ class Curl extends AbstractCurl implements CustomerInjectableInterface 'email', 'dob', 'taxvat', - 'gender', - ], + 'gender' + ] ]; /** @@ -76,6 +71,7 @@ public function persist(FixtureInterface $customer = null) /** @var CustomerInjectable $customer */ $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; $data = $customer->getData(); + $data['group_id'] = $this->getCustomerGroup($customer); if ($customer->hasData('address')) { $address = $customer->getAddress(); @@ -120,6 +116,19 @@ protected function getCustomerId($email) return empty($match[1]) ? null : $match[1]; } + /** + * Prepare customer for curl + * + * @param FixtureInterface $customer + * @return string + */ + protected function getCustomerGroup(FixtureInterface $customer) + { + return $customer->hasData('group_id') + ? $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup()->getCustomerGroupId() + : self::GENERAL_GROUP; + } + /** * Add addresses in to customer account * @@ -130,7 +139,7 @@ protected function getCustomerId($email) protected function addAddress(array $data) { $curlData = []; - $url = $_ENV['app_backend_url'] . 'customer/index/save'; + $url = $_ENV['app_backend_url'] . 'customer/index/save/id/' . $data['customer_id']; foreach ($data as $key => $value) { foreach ($this->curlMapping as $prefix => $prefixValues) { if (in_array($key, $prefixValues)) { @@ -140,9 +149,6 @@ protected function addAddress(array $data) } } unset($data['password'], $data['password_confirmation']); - $curlData['account']['group_id'] = isset($curlData['account']['group_id']) - ? $curlData['account']['group_id'] - : self::GENERAL_GROUP; $curlData = $this->replaceMappingData(array_merge($curlData, $data)); $curlData = $this->prepareAddressData($curlData); @@ -173,18 +179,18 @@ protected function prepareAddressData(array $curlData) $curlData['address'][$key]['street'] = []; $curlData['address'][$key]['street'][] = $street; } - $newKey = '_item' . ($key + 1); - if ($curlData['address'][$key]['default_billing'] === 'Yes') { - unset($curlData['address'][$key]['default_billing']); - $curlData['account']['default_billing'] = $newKey; + $newKey = 'new_' . ($key); + if (isset($curlData['address'][$key]['default_billing'])) { + $value = $curlData['address'][$key]['default_billing'] === 'Yes' ? 'true' : 'false'; + $curlData['address'][$key]['default_billing'] = $value; } - if ($curlData['address'][$key]['default_shipping'] === 'Yes') { - unset($curlData['address'][$key]['default_shipping']); - $curlData['account']['default_shipping'] = $newKey; + if (isset($curlData['address'][$key]['default_shipping'])) { + $value = $curlData['address'][$key]['default_shipping'] === 'Yes' ? 'true' : 'false'; + $curlData['address'][$key]['default_shipping'] = $value; } - $curlData['address'][$newKey] = $curlData['address'][$key]; - unset($curlData['address'][$key]); + $curlData['account']['customer_address'][$newKey] = $curlData['address'][$key]; } + unset($curlData['address']); return $curlData; } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml index 3d4e165acba63..ef6ffe23e31a6 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Page/CustomerAccountIndex.xml @@ -33,7 +33,7 @@ Magento\Catalog\Test\Block\Product\Compare\Sidebar - .block.compare + .block-compare css selector diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php index 55d3af3d2ec2b..9a0b737ef2733 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Repository/CustomerInjectable.php @@ -64,6 +64,7 @@ public function __construct(array $defaultConfig = [], array $defaultData = []) ]; $this->_data['defaultBackend'] = [ + 'website_id' => 'Main Website', 'firstname' => 'John', 'lastname' => 'Doe', 'email' => 'JohnDoe_%isolation%@example.com', diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv index 726c0a3d22d1f..b002dd32e3b58 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest/test.csv @@ -1,4 +1,4 @@ -"initialCustomer/dataSet";"customer/data/current_password";"customer/data/password";"customer/data/password_confirmation";"constraint";"issue" -"default";"123123q";"123123a";"123123a";"assertCustomerInfoSuccessSavedMessage, assertCustomerPasswordChanged";"Bug: MAGETWO-29412" -"default";"123123";"123123a";"123123a";"assertChangePasswordFailMessage";"" -"default";"123123q";"123123a";"123123";"assertWrongPassConfirmationMessage";"" +"initialCustomer/dataSet";"customer/data/current_password";"customer/data/password";"customer/data/password_confirmation";"constraint"; +"default";"123123q";"123123a";"123123a";"assertCustomerInfoSuccessSavedMessage, assertCustomerPasswordChanged"; +"default";"123123";"123123a";"123123a";"assertChangePasswordFailMessage"; +"default";"123123q";"123123a";"123123";"assertWrongPassConfirmationMessage"; diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv index e6e356a43c234..47b35a7511a61 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerBackendEntityTest/testCreateCustomerBackendEntity.csv @@ -1,6 +1,6 @@ -"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint";"issue" -"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" -"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"3/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"" -"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-30226" -"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail";"Bug: MAGETWO-28875" -"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm";"Bug: MAGETWO-30226" +"customer/data/website_id";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/firstname";"address/data/lastname";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/postcode";"address/data/telephone";"constraint" +"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Admin";"Wholesale";"M";"John%isolation%";"Jack";"Doe%isolation%";"S";"JohnDoe%isolation%@example.com";"3/16/2004";"-";"Male";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Main Website";"General";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.com";"-";"-";"-";"Joe";"Doe";"1 Main Street";"Culver City";"United States";"California";"90230";"3109450345";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" +"Main Website";"Retailer";"-";"John%isolation%";"-";"Doe%isolation%";"-";"JohnDoe%isolation%@example.ccc";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerInvalidEmail" +"Main Website";"General";"-";"Thomas%isolation%";"-";"Oster%isolation%";"-";"Thomas%isolation%@example.com";"-";"5250008057";"-";"Thomas";"Oster";"Chmielna 113";"Bielsko-Biala";"Poland";"-";"43-310 ";"799885616";"assertCustomerSuccessSaveMessage, assertCustomerInGrid, assertCustomerForm" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateOrderFromCustomerPageTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateOrderFromCustomerPageTest.php index 3f020bb8a3dcf..d8858d535e314 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateOrderFromCustomerPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateOrderFromCustomerPageTest.php @@ -93,18 +93,16 @@ public function test() */ public function tearDown() { - $setConfigStep = $this->objectManager->create( - 'Magento\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - ); - $setConfigStep->run(); - $this->customerAccountLogout->open(); - // Deleting exchange rates $this->rewardRateIndexPage->open(); while ($this->rewardRateIndexPage->getRewardRateGrid()->isFirstRowVisible()) { $this->rewardRateIndexPage->getRewardRateGrid()->openFirstRow(); $this->rewardRateNewPage->getFormPageActions()->delete(); } + $this->customerAccountLogout->open(); + $this->objectManager->create( + 'Magento\Core\Test\TestStep\SetupConfigurationStep', + ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] + )->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv index aabdfc2d31fb4..649c9f7842c9f 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerBackendEntityTest/testUpdateCustomerBackendEntity.csv @@ -1,4 +1,4 @@ "initialCustomer/dataSet";"customer/data/group_id/dataSet";"customer/data/prefix";"customer/data/firstname";"customer/data/middlename";"customer/data/lastname";"customer/data/suffix";"customer/data/email";"customer/data/dob";"customer/data/taxvat";"customer/data/gender";"address/data/prefix";"address/data/firstname";"address/data/middlename";"address/data/lastname";"address/data/suffix";"address/data/company";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/region";"address/data/postcode";"address/data/telephone";"address/data/fax";"address/data/vat_id";"constraint";"issue" -"default";"Wholesale";"%isolation%Prefix_";"John_%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"JohnDoe%isolation%@example.com";1/8/1986;123456789001;"Male";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" -"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"3962 Horner Street";"Dothan";"United States";"Alabama";"-";36303;"334-200-4060";"555-666-777-8910";"U1234567890";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-30226" -"default";"Retailer";"%isolation%Prefix_";"Jane_%isolation%";"Jane Middle Name %isolation%";"Doe%isolation%";"_JaneSuffix%isolation%";"Jane%isolation%@example.com";1/12/2000;987654321;"Female";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"39 Northgate Street";"BICKTON";"United Kingdom";"-";"PINMINNOCH";"KA26 1PF ";"999-777-111-2345";"-";987654321;"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-30226" +"default";"Wholesale";"%isolation%Prefix_";"John_%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"JohnDoe%isolation%@example.com";1/8/1986;123456789001;"Male";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"Bug: MAGETWO-31689" +"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"3962 Horner Street";"Dothan";"United States";"Alabama";"-";36303;"334-200-4060";"555-666-777-8910";"U1234567890";"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" +"default";"Retailer";"%isolation%Prefix_";"Jane_%isolation%";"Jane Middle Name %isolation%";"Doe%isolation%";"_JaneSuffix%isolation%";"Jane%isolation%@example.com";1/12/2000;987654321;"Female";"Prefix%isolation%_";"Doe%isolation%";"Middle Name %isolation%";"Doe%isolation%";"_Suffix%isolation%";"Company%isolation%";"39 Northgate Street";"BICKTON";"United Kingdom";"-";"PINMINNOCH";"KA26 1PF ";"999-777-111-2345";"-";987654321;"assertCustomerSuccessSaveMessage, assertCustomerForm, assertCustomerInGrid";"" diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php index 1e38cf75dc121..ee0b3fbc58322 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php @@ -34,6 +34,8 @@ * * @group Customer_Account_(CS) * @ZephyrId MAGETWO-25925 + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class UpdateCustomerFrontendEntity extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/VatGroupAssignmentTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/VatGroupAssignmentTest.php index a052d02b70c65..0df559a2205ac 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/VatGroupAssignmentTest.php +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/VatGroupAssignmentTest.php @@ -27,7 +27,6 @@ class VatGroupAssignmentTest extends Functional */ protected function setUp() { - $this->markTestIncomplete('Bug: MAGETWO-30630'); Factory::getApp()->magentoBackendLoginUser(); $this->vatFixture = Factory::getFixtureFactory()->getMagentoCustomerVatGroup(); } diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml index fc4197089a59f..8d2d4b7694e95 100644 --- a/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Customer/Test/etc/constraint.xml @@ -6,39 +6,39 @@ --> - low + low - low + low - low + low - middle + middle - middle + middle - middle + middle @@ -46,7 +46,7 @@ - middle + middle @@ -54,79 +54,79 @@ - low + low - low + low - low + low - low + low - low + low - high + high - high + high - low + low - low + low - low + low - low + low
    - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Block/Adminhtml/Edit/CustomerForm.xml index b0c82c514588a..d58fb87e02bd7 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\CustomerBalance\Test\Block\Adminhtml\Customer\Edit\Tab\Tab - #customer_info_tabs_customerbalance + #tab_customerbalance css selector customerbalance diff --git a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceAmount.php b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceAmount.php index ff5f71754e43b..2be047eb0269a 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceAmount.php +++ b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceAmount.php @@ -17,12 +17,9 @@ */ class AssertCustomerBalanceAmount extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer balance amount is changed diff --git a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceHistory.php b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceHistory.php index 0b46aeac47c63..3f6a174a06f41 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceHistory.php +++ b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertCustomerBalanceHistory.php @@ -17,12 +17,9 @@ */ class AssertCustomerBalanceHistory extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer balance history is changed diff --git a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertRemoveStoreCreditSuccessMessage.php b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertRemoveStoreCreditSuccessMessage.php index 2799a9b88d22f..648b0cce3b6fb 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertRemoveStoreCreditSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/Constraint/AssertRemoveStoreCreditSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertRemoveStoreCreditSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after remove store credit */ const SUCCESS_REMOVE_MESSAGE = 'The store credit payment has been removed from shopping cart.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after remove store credit successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/TestCase/DeleteStoreCreditFromCurrentQuoteTest.php b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/TestCase/DeleteStoreCreditFromCurrentQuoteTest.php index 8103d3f7b3593..8eba08129801c 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/TestCase/DeleteStoreCreditFromCurrentQuoteTest.php +++ b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/TestCase/DeleteStoreCreditFromCurrentQuoteTest.php @@ -150,8 +150,6 @@ public function test( array $shipping, array $payment ) { - $this->markTestIncomplete("Bug: MAGETWO-30435"); - // Precondition $customer->persist(); $customerBalance = $this->fixtureFactory->createByCode( diff --git a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/etc/constraint.xml index b9ff95d52a446..f0f7be8978a98 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CustomerBalance/Test/etc/constraint.xml @@ -6,12 +6,12 @@ --> - low + low - low + low - high + high diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeErrorDuplicateMessage.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeErrorDuplicateMessage.php index fe20105a81f9f..d71d319dd7bd2 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeErrorDuplicateMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeErrorDuplicateMessage.php @@ -13,18 +13,15 @@ */ class AssertCustomerCustomAttributeErrorDuplicateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text of error duplicate message */ const ERROR_DUPLICATE_MESSAGE = 'An attribute with this code already exists.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after customer attribute error duplicate message appears * @@ -33,11 +30,9 @@ class AssertCustomerCustomAttributeErrorDuplicateMessage extends AbstractConstra */ public function processAssert(CustomerAttributeNew $customerAttributeNew) { - $customerAttributeNew->getCustomerCustomAttributesForm()->openTab('properties'); - $errors = $customerAttributeNew->getCustomerCustomAttributesForm()->getTabElement('properties')->getJsErrors(); \PHPUnit_Framework_Assert::assertEquals( self::ERROR_DUPLICATE_MESSAGE, - $errors['Attribute Code'] + $customerAttributeNew->getMessagesBlock()->getErrorMessages() ); } diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInCustomerSegment.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInCustomerSegment.php index a1bb1649419eb..4838be5fc887b 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInCustomerSegment.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInCustomerSegment.php @@ -17,12 +17,9 @@ */ class AssertCustomerCustomAttributeInCustomerSegment extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is available during creation of customer segments diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInGrid.php index bf3a9afcaafff..b043851f3358c 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerCustomAttributeInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Customer Attribute can be found in grid via: diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInCustomerSegment.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInCustomerSegment.php index b4f909f816e64..94f5c5116573e 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInCustomerSegment.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInCustomerSegment.php @@ -17,12 +17,9 @@ */ class AssertCustomerCustomAttributeNotInCustomerSegment extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted customer attribute is not available during creation of customer segments diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInGrid.php index 0ccebcf808ee1..feae3b53ad08e 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerCustomAttributeNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted customer attribute cannot be found in grid diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCheckoutRegister.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCheckoutRegister.php index 64ff73634fd78..4d8643bed4b81 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCheckoutRegister.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCheckoutRegister.php @@ -19,12 +19,9 @@ */ class AssertCustomerCustomAttributeNotOnCheckoutRegister extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted customer attribute is not available during register customer on checkout diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCreateOrderBackend.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCreateOrderBackend.php index c2f2310a3e259..9afc50636cb5a 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCreateOrderBackend.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCreateOrderBackend.php @@ -17,12 +17,9 @@ */ class AssertCustomerCustomAttributeNotOnCreateOrderBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is absent during creating order on backend diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerEditPage.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerEditPage.php index 34dc9a5a50b83..6f9270ef157a6 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerEditPage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerEditPage.php @@ -19,12 +19,9 @@ */ class AssertCustomerCustomAttributeNotOnCustomerEditPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is absent during edit customer account on frontend diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerRegister.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerRegister.php index e6d2e5abac88d..05785fc42f8ca 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerRegister.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeNotOnCustomerRegister.php @@ -16,12 +16,9 @@ */ class AssertCustomerCustomAttributeNotOnCustomerRegister extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is absent during register customer on frontend diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCheckoutRegister.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCheckoutRegister.php index d7e5b70cc48de..90351365fc97e 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCheckoutRegister.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCheckoutRegister.php @@ -20,12 +20,9 @@ */ class AssertCustomerCustomAttributeOnCheckoutRegister extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is available during register customer on checkout diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCreateOrderBackend.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCreateOrderBackend.php index ce61024ba7551..40969f1182b88 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCreateOrderBackend.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCreateOrderBackend.php @@ -17,12 +17,9 @@ */ class AssertCustomerCustomAttributeOnCreateOrderBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is available during creating order on backend diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerEditPage.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerEditPage.php index 230a67767b4ea..fb3fb9839378d 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerEditPage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerEditPage.php @@ -18,12 +18,9 @@ */ class AssertCustomerCustomAttributeOnCustomerEditPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is available during edit customer account on frontend diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerRegister.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerRegister.php index 02cb968a8f3b2..db3556c9ea03e 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerRegister.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeOnCustomerRegister.php @@ -16,12 +16,9 @@ */ class AssertCustomerCustomAttributeOnCustomerRegister extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer attribute is available during register customer on frontend diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessDeleteMessage.php index 5959dd099210f..a6605f3bad000 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCustomerCustomAttributeSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text of delete success message */ const SUCCESS_DELETE_MESSAGE = 'You deleted the customer attribute.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after delete customer attribute successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessSaveMessage.php index a234e8781059e..d0624fea9f46f 100755 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/Constraint/AssertCustomerCustomAttributeSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertCustomerCustomAttributeSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text of save success message */ const SUCCESS_SAVE_MESSAGE = 'You saved the customer attribute.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after customer attribute save successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/TestCase/ValidationAttributeCodeCustomerCustomAttributesEntityTest.php b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/TestCase/ValidationAttributeCodeCustomerCustomAttributesEntityTest.php index 999edd12aa355..386d26670baba 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/TestCase/ValidationAttributeCodeCustomerCustomAttributesEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/TestCase/ValidationAttributeCodeCustomerCustomAttributesEntityTest.php @@ -74,7 +74,6 @@ public function test( CustomerCustomAttribute $customerAttribute, CustomerCustomAttribute $initialCustomerAttribute ) { - $this->markTestIncomplete('MAGETWO-28194'); //Preconditions $initialCustomerAttribute->persist(); $customerAttribute = $fixtureFactory->createByCode( diff --git a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/etc/constraint.xml index 2ce5969d4cd36..73f40c8fa8a86 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CustomerCustomAttributes/Test/etc/constraint.xml @@ -6,33 +6,33 @@ --> - high + high - high + high - low + low - low + low - low + low @@ -43,7 +43,7 @@ - low + low @@ -54,7 +54,7 @@ - low + low @@ -63,7 +63,7 @@ - low + low @@ -74,7 +74,7 @@ - low + low @@ -83,7 +83,7 @@ - low + low @@ -92,7 +92,7 @@ - low + low @@ -101,7 +101,7 @@ - low + low @@ -109,7 +109,7 @@ - low + low @@ -118,7 +118,7 @@ - low + low @@ -128,6 +128,6 @@ - low + low diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentAvailableInBannerForm.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentAvailableInBannerForm.php index 3d0988dec0300..50c06362ae610 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentAvailableInBannerForm.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentAvailableInBannerForm.php @@ -15,12 +15,9 @@ */ class AssertCustomerSegmentAvailableInBannerForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer segment is available in Banner edit page diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentForm.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentForm.php index 4ad4c46949b12..e4586239ab7f2 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentForm.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentForm.php @@ -16,6 +16,10 @@ */ class AssertCustomerSegmentForm extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Skipped fields for verify data * @@ -23,13 +27,6 @@ class AssertCustomerSegmentForm extends AbstractAssertForm */ protected $skippedFields = ['conditions_serialized', 'segment_id']; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that displayed segment data on edit page is equals passed from fixture * diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsApplying.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsApplying.php index 28b7f5d658db3..6d3b23d3f1e35 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsApplying.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsApplying.php @@ -11,12 +11,9 @@ */ class AssertCustomerSegmentInCartPriceRuleIsApplying extends AbstractAssertCustomerSegmentPriceRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Catalog Price Rule is applied on product(s) in shopping cart according to rule condition has been diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsNotApplying.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsNotApplying.php index 9dde9b5d44f1b..5bb87ae995fc2 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsNotApplying.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInCartPriceRuleIsNotApplying.php @@ -11,12 +11,9 @@ */ class AssertCustomerSegmentInCartPriceRuleIsNotApplying extends AbstractAssertCustomerSegmentPriceRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that shopping cart subtotal equals with grand total diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInGrid.php index a8952e6577e01..9e61b2ae9c50d 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerSegmentInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer segment presents in grid and has correct 'Segment','Status','Website' diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomer.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomer.php index 122a9533c643e..371f2c35c59da 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomer.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomer.php @@ -18,12 +18,9 @@ */ class AssertCustomerSegmentMatchedCustomer extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that grid on 'Matched Customer' tab contains customer according to conditions diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomerWithCart.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomerWithCart.php index 896197703241a..ca98182b6e814 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomerWithCart.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomerWithCart.php @@ -11,12 +11,9 @@ */ class AssertCustomerSegmentMatchedCustomerWithCart extends AbstractAssertCustomerSegmentPriceRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that grid on 'Matched Customer' tab contains customer according to conditions(it need save condition diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomersInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomersInGrid.php index d475d744e4820..60195d462bd4b 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomersInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentMatchedCustomersInGrid.php @@ -18,12 +18,9 @@ */ class AssertCustomerSegmentMatchedCustomersInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that the customer according to search criteria presents in the grid and have correct values for diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotApplicableToBanner.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotApplicableToBanner.php index cf3cd29ed9895..8d59bf386bd8d 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotApplicableToBanner.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotApplicableToBanner.php @@ -15,12 +15,9 @@ */ class AssertCustomerSegmentNotApplicableToBanner extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer segment is not available in Banner edit page diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotInGrid.php index 85e524287c95b..8b6536cd79c90 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertCustomerSegmentNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created customer segment not presents in grid diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportInGrid.php index 97649afd4b3db..0dd92b0a66345 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportInGrid.php @@ -16,12 +16,9 @@ */ class AssertCustomerSegmentReportInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created customer segment report presents in the grid and customer from it has correct values diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportMessage.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportMessage.php index 00b5d772c81e6..5689a294090cd 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportMessage.php @@ -15,18 +15,15 @@ */ class AssertCustomerSegmentReportMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Customer segments report messages */ const REPORT_MESSAGES = 'Viewing combined "%s" report from segments: %s.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that message is displayed on the customer segment report detail page * diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportNotInGrid.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportNotInGrid.php index e008793bdb834..6e0bace5abdf2 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentReportNotInGrid.php @@ -16,12 +16,9 @@ */ class AssertCustomerSegmentReportNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that created customer is absent in a customer segment grid diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessDeleteMessage.php index a7ded8dd3434c..ec691f1f4a460 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCustomerSegmentSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success delete message */ const SUCCESS_DELETE_MESSAGE = 'You deleted the segment.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success delete message is displayed after Customer Segments has been deleted * diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessSaveMessage.php index 1e1da03f7030a..0e07991932078 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/Constraint/AssertCustomerSegmentSuccessSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertCustomerSegmentSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the segment.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the segment.'; /** * Assert that success message is displayed after Customer Segments saved diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/CreateCustomerSegmentEntityTest.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/CreateCustomerSegmentEntityTest.php index a203f1255af34..5c5e15bb9f693 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/CreateCustomerSegmentEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/CreateCustomerSegmentEntityTest.php @@ -173,7 +173,6 @@ public function test( array $salesRule, AssertCustomerSegmentSuccessSaveMessage $assertCustomerSegmentSuccessSaveMessage ) { - $this->markTestIncomplete('MAGETWO-30226'); //Preconditions $customer->persist(); $filter = ['email' => $customer->getEmail()]; diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/UpdateCustomerSegmentEntityTest.php b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/UpdateCustomerSegmentEntityTest.php index 73e9869be9d26..3125701d8c61f 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/UpdateCustomerSegmentEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/TestCase/UpdateCustomerSegmentEntityTest.php @@ -159,7 +159,6 @@ public function test( CustomerSegment $customerSegment, CustomerSegment $customerSegmentOriginal ) { - $this->markTestIncomplete('MAGETWO-30226'); //Preconditions $customer->persist(); $this->customerIndexPage->open(); diff --git a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/etc/constraint.xml index 82dfcb99f15bc..6245a1fc416a9 100644 --- a/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/CustomerSegment/Test/etc/constraint.xml @@ -6,48 +6,48 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php index 5101e25b5885e..7f970611ba238 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableDuplicateForm.php @@ -15,12 +15,9 @@ */ class AssertDownloadableDuplicateForm extends AssertProductDuplicateForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert form data equals duplicate product downloadable data diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php index 0bd66102e5358..e2fe6770bafa2 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableLinksData.php @@ -17,6 +17,10 @@ */ class AssertDownloadableLinksData extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * List downloadable link fields for verify * @@ -38,13 +42,6 @@ class AssertDownloadableLinksData extends AbstractAssertForm 'price', ]; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert Link block for downloadable product on front-end * diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php index be912e602950c..1c216b2325626 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Constraint/AssertDownloadableSamplesData.php @@ -17,6 +17,10 @@ */ class AssertDownloadableSamplesData extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * List downloadable sample links fields for verify * @@ -36,13 +40,6 @@ class AssertDownloadableSamplesData extends AbstractAssertForm 'title', ]; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert Sample block for downloadable product on front-end * diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv index 1b875f13b3663..486f051573ba4 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest/test.csv @@ -1,15 +1,15 @@ -"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/url_key";"constraint";"issue" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"Taxable Goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"Taxable Goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage";"" -"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"Taxable Goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage";"" +"product/data/name";"product/data/sku";"product/data/price/value";"product/data/tax_class_id/dataSet";"product/data/quantity_and_stock_status/qty";"product/data/quantity_and_stock_status/is_in_stock";"product/data/is_virtual";"product/data/category";"product/data/description";"product/data/short_description";"product/data/stock_data/manage_stock";"product/data/stock_data/qty";"product/data/stock_data/use_config_min_qty";"product/data/stock_data/min_qty";"product/data/downloadable_sample/preset";"product/data/downloadable_links/preset";"product/data/custom_options/preset";"product/data/custom_options/import_products";"product/data/special_price";"product/data/group_price/preset";"product/data/tier_price/preset";"product/data/url_key";"constraint" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"1";"In Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertProductInStock" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"1";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertDownloadableSamplesData, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"33";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"55";"Taxable Goods";"10";"In Stock";"Yes";"-";"-";"-";"-";"-";"-";"-";"with_three_samples";"with_three_links";"two_options";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductCustomOptionsOnProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage, assertDownloadableLinksData, assertProductInStock, assertProductSearchableBySku" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"50";"Out of Stock";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductOutOfStock, assertProductInGrid, assertDownloadableProductForm" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"9999";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"Yes";"123";"No";"123";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductOutOfStock" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"98";"None";"5";"In Stock";"Yes";"Default Category";"This is description for downloadable product";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"57";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"catalogProductSimple::with_two_custom_option,catalogProductSimple::with_all_custom_option";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"This is description for downloadable product";"This is short description for downloadable product";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductPage, assertProductInGrid, assertDownloadableProductForm, assertProductCustomOptionsOnProductPage, assertDownloadableSamplesData, assertDownloadableLinksData" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"65";"Taxable Goods";"11";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"default";"with_three_links";"default";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertDownloadableLinksData, assertProductCustomOptionsOnProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"100";"Taxable Goods";"-";"-";"Yes";"Default Category";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertDownloadableProductForm, assertProductVisibleInCategory, assertProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"10";"Taxable Goods";"10";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"5";"-";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductSpecialPriceOnProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"365";"Taxable Goods";"23";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"default";"-";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductGroupedPriceOnProductPage" +"DownloadableProduct_%isolation%";"DownloadableProduct_%isolation%";"250";"Taxable Goods";"65";"In Stock";"Yes";"category %isolation%";"-";"-";"-";"-";"-";"-";"-";"default";"-";"-";"-";"-";"default";"downloadableproduct-%isolation%";"assertProductSaveMessage, assertProductInGrid, assertDownloadableProductForm, assertProductPage, assertProductTierPriceOnProductPage" diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml index f121e08d53c56..b10f5bbe51463 100644 --- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/etc/constraint.xml @@ -6,16 +6,16 @@ --> - low + low - low + low - low + low - high + high @@ -23,6 +23,6 @@ - low + low diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicateForm.php b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicateForm.php index aa8be1019c762..21fe39f26c44a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicateForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicateForm.php @@ -11,19 +11,16 @@ use Mtf\Fixture\FixtureInterface; /** - * Class AssertGiftCardDuplicateForm + * Assert form data equals fixture data. */ class AssertGiftCardDuplicateForm extends AssertProductDuplicateForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** - * Assert form data equals duplicate gift card data + * Assert form data equals duplicate gift card data. * * @param FixtureInterface $product * @param CatalogProductIndex $productGrid @@ -36,7 +33,8 @@ public function processAssert( CatalogProductEdit $productPage ) { $filter = ['sku' => $product->getSku() . '-1']; - $productGrid->open()->getProductGrid()->searchAndOpen($filter); + $productGrid->open(); + $productGrid->getProductGrid()->searchAndOpen($filter); $formData = $productPage->getProductForm()->getData($product); $fixtureData = $this->prepareFixtureData($product->getData()); diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicatedInGrid.php b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicatedInGrid.php index 55e2046d2c849..67a3d2e768039 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicatedInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardDuplicatedInGrid.php @@ -14,12 +14,9 @@ */ class AssertGiftCardDuplicatedInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that duplicated product is found by sku and has correct product type, product template, diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductAddToCartForm.php b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductAddToCartForm.php index 4c13b93122d8f..0b4a77acac657 100755 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductAddToCartForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductAddToCartForm.php @@ -17,18 +17,15 @@ */ class AssertGiftCardProductAddToCartForm extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Value for choose custom option */ const CUSTOM_OPTION = 'custom'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that displayed amount, "Sender Name", "Sender Email", "Recipient Name", "Recipient Email", "Message" data * on product page(front-end) equals passed from fixture. diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductForm.php b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductForm.php index 1148abaa0aa43..6edf38c748341 100755 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Constraint/AssertGiftCardProductForm.php @@ -12,6 +12,10 @@ */ class AssertGiftCardProductForm extends AssertProductForm { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Sort fields for fixture and form data * @@ -20,11 +24,4 @@ class AssertGiftCardProductForm extends AssertProductForm protected $sortFields = [ 'giftcard_amounts::price', ]; - - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; } diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.php b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.php index f86a9283dd2d8..2d0287740d03d 100755 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.php +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.php @@ -338,6 +338,11 @@ class GiftCardProduct extends InjectableFixture 'group' => 'websites', ]; + protected $id = [ + 'attribute_code' => 'id', + 'backend_type' => 'virtual', + ]; + public function getWebsiteIds() { return $this->getData('website_ids'); @@ -497,4 +502,9 @@ public function getStatus() { return $this->getData('status'); } + + public function getId() + { + return $this->getData('id'); + } } diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.xml b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.xml index e12cecf5c847c..352f2401310ce 100755 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.xml +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Fixture/GiftCardProduct.xml @@ -257,6 +257,10 @@ Main Website websites + + id + virtual + diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Repository/GiftCardProduct.php b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Repository/GiftCardProduct.php index 85e8989f01329..6d9511042c34a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/Repository/GiftCardProduct.php +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/Repository/GiftCardProduct.php @@ -46,7 +46,7 @@ public function __construct(array $defaultConfig = [], array $defaultData = []) 'allow_message' => 'Yes', 'use_config_allow_message' => 'Yes', 'email_template' => 'Gift Card(s) Purchase (Default)', - 'use_config_email_template' => 'Yes', + 'use_config_email_template' => 'No', 'visibility' => 'Catalog, Search', 'url_key' => 'test-product-giftcard-%isolation%', 'use_config_gift_message_available' => 'Yes', diff --git a/dev/tests/functional/tests/app/Magento/GiftCard/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GiftCard/Test/etc/constraint.xml index 3a2dab5ce19df..55bc29f16d598 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCard/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GiftCard/Test/etc/constraint.xml @@ -6,16 +6,16 @@ --> - high + high - middle + middle - middle + middle - high + high @@ -23,16 +23,16 @@ - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountForm.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountForm.php index 58ecd197ed6c1..64d7ac55db874 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountForm.php @@ -16,6 +16,10 @@ */ class AssertGiftCardAccountForm extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Skipped fields for verify data * @@ -23,13 +27,6 @@ class AssertGiftCardAccountForm extends AbstractAssertForm */ protected $skippedFields = ['code']; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that gift card account equals to passed from fixture * diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountInGrid.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountInGrid.php index 302c967d443da..94c93857ebef8 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountInGrid.php @@ -14,12 +14,9 @@ */ class AssertGiftCardAccountInGrid extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that gift card account in grid. diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountIsNotUsableInCartOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountIsNotUsableInCartOnFrontend.php index 4a8ccee7328f0..9fff9ca558595 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountIsNotUsableInCartOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountIsNotUsableInCartOnFrontend.php @@ -17,12 +17,9 @@ */ class AssertGiftCardAccountIsNotUsableInCartOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that gift card is not usable in cart on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotInGrid.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotInGrid.php index 59e47aff20f46..553def22b0a9a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftCardAccountNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that gift card account not in grid diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotRedeemableOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotRedeemableOnFrontend.php index 29ced112d1c54..155e1d89919a6 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotRedeemableOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountNotRedeemableOnFrontend.php @@ -15,12 +15,9 @@ */ class AssertGiftCardAccountNotRedeemableOnFrontend extends AbstractAssertGiftCardAccountOnFrontend { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that gift card is not redeemable on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountOnPrintOrder.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountOnPrintOrder.php index 25c093ac10fc1..738819543c12f 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountOnPrintOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountOnPrintOrder.php @@ -14,12 +14,9 @@ */ class AssertGiftCardAccountOnPrintOrder extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that gift card amount printed correctly on sales guest print page. diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountRedeemableOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountRedeemableOnFrontend.php index d496c3caa1101..5b46175f0c29e 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountRedeemableOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountRedeemableOnFrontend.php @@ -16,18 +16,15 @@ */ class AssertGiftCardAccountRedeemableOnFrontend extends AbstractAssertGiftCardAccountOnFrontend { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'Gift Card "%s" was redeemed.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that gift card is redeemable on frontend * diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSaveMessage.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSaveMessage.php index def95ae2a0936..3590b9668339d 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftCardAccountSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You saved the gift card account.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after gift card account save * diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInCustomerAccount.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInCustomerAccount.php index eaeadf6c42581..8a13fe338d5d9 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInCustomerAccount.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInCustomerAccount.php @@ -16,12 +16,9 @@ */ class AssertGiftCardAccountStatusInCustomerAccount extends AbstractAssertGiftCardAccountOnFrontend { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created gift card account can be verified on the frontend on My Account page diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInShoppingCart.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInShoppingCart.php index 95bd6d37a36d8..c1701a81b9547 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountStatusInShoppingCart.php @@ -18,12 +18,9 @@ */ class AssertGiftCardAccountStatusInShoppingCart extends AbstractAssertGiftCardAccountOnFrontend { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created gift card account can be verified on the frontend in Shopping Cart diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSuccessDeleteMessage.php index 7b9f13fc55dac..6f7a95f6a1cae 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftCardAccountSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'This gift card account has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that gift card account delete success message is present * diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountUsableInCartOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountUsableInCartOnFrontend.php index 0afd0d8af68bc..d1d417fcac429 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountUsableInCartOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardAccountUsableInCartOnFrontend.php @@ -17,12 +17,9 @@ */ class AssertGiftCardAccountUsableInCartOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that gift card usable in frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardDiscount.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardDiscount.php index bb8ebbec2f8d4..153e7a153049d 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardDiscount.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardDiscount.php @@ -14,12 +14,9 @@ */ class AssertGiftCardDiscount extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sum of gift card discount is equal to passed from dataSet in shopping cart diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardSuccessAddMessage.php b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardSuccessAddMessage.php index ba80a414ca1bb..dcf7d2361676e 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardSuccessAddMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/Constraint/AssertGiftCardSuccessAddMessage.php @@ -15,18 +15,15 @@ */ class AssertGiftCardSuccessAddMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_APPLY_MESSAGE = 'Gift Card "%s" was added.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success apply message is displayed on "Shopping Cart" frontend page * diff --git a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/etc/constraint.xml index 84d0ed6172119..90212d9ddb28b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GiftCardAccount/Test/etc/constraint.xml @@ -6,45 +6,45 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php index af6b504bacc99..d8358b6df9d1c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInBackendOrder.php @@ -16,12 +16,9 @@ */ class AssertGiftMessageInBackendOrder extends AbstractAssertForm { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Skipped fields for verify data. diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php index a5739bcf1e3ce..e21c1a245cd09 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php @@ -18,12 +18,9 @@ */ class AssertGiftMessageInFrontendOrder extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that message from dataSet is displayed on order(s) view page on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php index 34ea83cdcce70..15d740f2412cf 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php @@ -18,12 +18,9 @@ */ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that message from dataSet is displayed for each items on order(s) view page on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php index 9280a88bf8ec5..48e9b9fb95a7a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php @@ -35,7 +35,6 @@ class CheckoutWithGiftMessagesTest extends Scenario */ public function test() { - $this->markTestIncomplete("Bug: MAGETWO-30593"); $this->executeScenario(); } } diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml index 571bc650957c6..9edbcc7193389 100644 --- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/constraint.xml @@ -6,12 +6,12 @@ --> - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Block/Adminhtml/Edit/CustomerForm.xml index a160f96194ff0..ad4d51fb47380 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\GiftRegistry\Test\Block\Adminhtml\Customer\Edit\Tab\GiftRegistry - #customer_info_tabs_giftregistry + #tab_giftregistry css selector diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInShoppingCart.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInShoppingCart.php index c3b041260888c..99cdba78d2314 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInShoppingCart.php @@ -19,12 +19,9 @@ */ class AssertGiftRegistryActiveInShoppingCart extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product can be added to active gift registry from Shopping Cart diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInWishlist.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInWishlist.php index 712201adf5b2b..d465ab7aacd7b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryActiveInWishlist.php @@ -20,18 +20,15 @@ */ class AssertGiftRegistryActiveInWishlist extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success message after gift registry has been added */ const SUCCESS_MESSAGE = 'The wish list item has been added to this gift registry.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that product can be added to active gift registry from Wishlist * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryForm.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryForm.php index 3db27169482da..34e7f4cc1f0c7 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryForm.php @@ -16,12 +16,9 @@ */ class AssertGiftRegistryForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInGrid.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInGrid.php index da0b9e44af4a6..6d21e672ff99d 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftRegistryInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Gift Registry can be found at Gift Registry grid by title diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInactiveNotInWishlist.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInactiveNotInWishlist.php index 5bbcfbf1e84ae..417ecb398ee44 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInactiveNotInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryInactiveNotInWishlist.php @@ -18,12 +18,9 @@ */ class AssertGiftRegistryInactiveNotInWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product can not be added to inactive gift registry from Wishlist diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryIsEmptyMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryIsEmptyMessage.php index 4afc136205545..f31e889ec5d7a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryIsEmptyMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryIsEmptyMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistryIsEmptyMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Gift registry info message */ const INFO_MESSAGE = 'This gift registry has no items.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that notice message appears if Gift Registry doesn't have any items after delete * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsForm.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsForm.php index 8356c582d29df..2b65067cd3e40 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsForm.php @@ -19,12 +19,9 @@ */ class AssertGiftRegistryItemsForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed Gift Registry items data on edit page equals passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedFrontendSuccessMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedFrontendSuccessMessage.php index c583a934722dd..7ed64a1dc8fca 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedFrontendSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedFrontendSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistryItemsUpdatedFrontendSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry items update message */ const SUCCESS_MESSAGE = 'You updated the gift registry items.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after gift registry items has been updated * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedSuccessMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedSuccessMessage.php index 9c4c9ed6ec7d8..ffdd1fee09ba8 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryItemsUpdatedSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistryItemsUpdatedSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry update message */ const SUCCESS_MESSAGE = 'You updated this gift registry.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success update message is displayed after gift registry items updating on backend * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryManageItemsTab.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryManageItemsTab.php index da319f179c2f3..14e394a657bc1 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryManageItemsTab.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryManageItemsTab.php @@ -18,12 +18,9 @@ */ class AssertGiftRegistryManageItemsTab extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Manage Items page on frontend contains correct product name and quantity diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryNotInGrid.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryNotInGrid.php index a002c75975735..4fa77d9dd1fd8 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftRegistryNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Gift Registry can not be found at Gift Registry grid by title diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessAddedItemsMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessAddedItemsMessage.php index 2e8bf3920fee0..e626b1ce2c111 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessAddedItemsMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessAddedItemsMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistrySuccessAddedItemsMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success added to gift registry message */ const SUCCESS_MESSAGE = 'Shopping cart items have been added to gift registry.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after adding products to gift registry on backend * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessDeleteMessageOnBackend.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessDeleteMessageOnBackend.php index b740fd8735667..ab09ae71fd2e2 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessDeleteMessageOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessDeleteMessageOnBackend.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistrySuccessDeleteMessageOnBackend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry delete message */ const SUCCESS_DELETE_MESSAGE = 'You deleted this gift registry entity.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert message appears after delete gift registry on backend * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessSaveMessage.php index 3a5ff34a85048..ff2c5f5bc8a57 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistrySuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry save message */ const SUCCESS_MESSAGE = 'You saved this gift registry.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after gift registry has been created * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnBackend.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnBackend.php index 6eed2ed0e7a60..506cfec0279dc 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnBackend.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistrySuccessShareMessageOnBackend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry share message on backend */ const SUCCESS_MESSAGE = '%d email(s) were sent.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after gift registry has been share on backend * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnFrontend.php index 97e68795d2e1d..5f5062e80f83b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistrySuccessShareMessageOnFrontend.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistrySuccessShareMessageOnFrontend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry share message on frontend */ const SUCCESS_MESSAGE = 'You shared the gift registry for %d emails.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after gift registry has been shared on frontend * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeForm.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeForm.php index 52d9f05b347e4..9bd52ad4fb653 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeForm.php @@ -16,12 +16,9 @@ */ class AssertGiftRegistryTypeForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that GiftRegistryType form filled correctly diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeInGrid.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeInGrid.php index f7bbe1e33e63c..a58893139cd49 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftRegistryTypeInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Gift Registry type can be found at Stores > Gift Registry grid in backend diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotInGrid.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotInGrid.php index 161dbce8993c5..491ab0f333a9e 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftRegistryTypeNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted Gift Registry type is absent in Stores > Gift Registry grid in backend diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotOnFrontend.php index 7ea2682b43be3..32aa616264712 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeNotOnFrontend.php @@ -20,12 +20,9 @@ */ class AssertGiftRegistryTypeNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted Gift Registry type is absent on creation new gift registry form on my account on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeOnFrontend.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeOnFrontend.php index 9fd9d9404f355..f78cb0c69ce52 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeOnFrontend.php @@ -18,12 +18,9 @@ */ class AssertGiftRegistryTypeOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Gift Registry type can be found at Customer Account > Gift Registry diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessDeleteMessage.php index ccff5891401cb..9d3567e419242 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistryTypeSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry delete message */ const DELETE_MESSAGE = 'You deleted the gift registry type.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success delete message is displayed after gift registry has been deleted * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessSaveMessage.php index 3483207cb7b4a..fe554c9aac368 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/Constraint/AssertGiftRegistryTypeSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftRegistryTypeSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success gift registry type save message */ const SUCCESS_MESSAGE = 'You saved the gift registry type.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after save a Gift Registry type success message appears * diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryFrontendEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryFrontendEntityTest.php index a20039d95bfd6..e804daae43246 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryFrontendEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryFrontendEntityTest.php @@ -36,7 +36,7 @@ * 8. Perform Asserts * * @group Gift_Registry_(CS) - * @ZephyrId MAGETWO-26176 + * @ZephyrId MAGETWO-26962 */ class CreateGiftRegistryFrontendEntityTest extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryTypeEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryTypeEntityTest.php index 4b69df1ac7e28..d49672496155a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryTypeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/CreateGiftRegistryTypeEntityTest.php @@ -88,6 +88,7 @@ public function __inject( */ public function test(GiftRegistryType $giftRegistryType) { + $this->markTestIncomplete('Bug: MAGETWO-31247'); // Steps $this->giftRegistryIndex->open(); $this->giftRegistryIndex->getPageActions()->addNew(); diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/UpdateGiftRegistryTypeEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/UpdateGiftRegistryTypeEntityTest.php index 5035e9bd306a2..363241067e19e 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/UpdateGiftRegistryTypeEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/TestCase/UpdateGiftRegistryTypeEntityTest.php @@ -99,6 +99,7 @@ public function __inject( */ public function test(GiftRegistryType $giftRegistryType, GiftRegistryType $giftRegistryTypeInitial) { + $this->markTestIncomplete('Bug: MAGETWO-31247'); // Steps $giftRegistryTypeInitial->persist(); $filter = ['label' => $giftRegistryTypeInitial->getLabel()]; diff --git a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/etc/constraint.xml index 38269f9145a7d..abf9a9e68085a 100644 --- a/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GiftRegistry/Test/etc/constraint.xml @@ -6,75 +6,75 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingForm.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingForm.php index 82e7088a25048..fac7efd6b5d33 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingForm.php @@ -15,12 +15,9 @@ */ class AssertGiftWrappingForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields while verifying diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingInGrid.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingInGrid.php index 7188bbcca4fe3..fd8f2ba49f1c0 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingInGrid.php @@ -14,12 +14,9 @@ */ class AssertGiftWrappingInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Gift Wrapping availability in Gift Wrapping grid diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionForm.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionForm.php index 2a22f6aae0c55..43f4d34628757 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionForm.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionForm.php @@ -16,12 +16,9 @@ */ class AssertGiftWrappingMassActionForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @param GiftWrappingIndex $giftWrappingIndexPage diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionInGrid.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionInGrid.php index 808d3caa34e89..e90eef577ffaa 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftWrappingMassActionInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Gift Wrapping availability in Gift Wrapping grid after mass action diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionNotInGrid.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionNotInGrid.php index 77daad677cc72..2b6f8bc283ef2 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertGiftWrappingMassActionNotInGrid extends AssertGiftWrappingNotInGrid { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted Gift Wrapping can not be found in grid via: id, design, website_id, status, price diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionSuccessDeleteMessage.php index 8ef33e5079b11..50e8d947dc12c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingMassActionSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftWrappingMassActionSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after delete gift wrapping */ const SUCCESS_DELETE_MESSAGE = 'You deleted a total of %d records.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after mass delete Gift Wrapping successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotInGrid.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotInGrid.php index a3f399027663c..cf26df3854146 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertGiftWrappingNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted Gift Wrapping can not be found in grid via: id, design, website_id, status, price diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnFrontendCheckout.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnFrontendCheckout.php index 2f9afb32713ff..947ed06a36a6c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnFrontendCheckout.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnFrontendCheckout.php @@ -22,12 +22,9 @@ */ class AssertGiftWrappingNotOnFrontendCheckout extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted Gift Wrapping can not be found during one page checkout on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnOrderCreationPage.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnOrderCreationPage.php index 81c71c75ac78e..52d865582ac8c 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnOrderCreationPage.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingNotOnOrderCreationPage.php @@ -16,12 +16,9 @@ */ class AssertGiftWrappingNotOnOrderCreationPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted Gift Wrapping can not be found on order creation page in backend diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingOnFrontendCheckout.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingOnFrontendCheckout.php index 40bc6807075a1..efb3b23c3f4ee 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingOnFrontendCheckout.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingOnFrontendCheckout.php @@ -22,12 +22,9 @@ */ class AssertGiftWrappingOnFrontendCheckout extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Gift Wrapping can be found during one page checkout on frontend diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessDeleteMessage.php index 0aa6790eb3f6c..c0f7975f99a39 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftWrappingSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after delete gift wrapping */ const SUCCESS_DELETE_MESSAGE = 'You deleted the gift wrapping.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after delete Gift Wrapping successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessSaveMessage.php index ba312cb79909b..f98df84aa5846 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertGiftWrappingSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'You saved the gift wrapping.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'You saved the gift wrapping.'; /** * Assert that success message is displayed after Gift Wrapping saved diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessUpdateMessage.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessUpdateMessage.php index 3b99526eab338..d96560fff2793 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessUpdateMessage.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/Constraint/AssertGiftWrappingSuccessUpdateMessage.php @@ -14,18 +14,15 @@ */ class AssertGiftWrappingSuccessUpdateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message displayed after update gift wrapping */ const SUCCESS_UPDATE_MESSAGE = 'You updated a total of %d records.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after update Gift Wrapping successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/CreateGiftWrappingEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/CreateGiftWrappingEntityTest.php index 63201bc3e8b8d..36595e4c9b84b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/CreateGiftWrappingEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/CreateGiftWrappingEntityTest.php @@ -62,7 +62,6 @@ public function __inject(GiftWrappingIndex $giftWrappingIndexPage, GiftWrappingN */ public function test(GiftWrapping $giftWrapping) { - $this->markTestIncomplete('Bug: MAGETWO-30995'); // Steps $this->giftWrappingIndexPage->open(); $this->giftWrappingIndexPage->getGridPageActions()->addNew(); diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/DeleteGiftWrappingEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/DeleteGiftWrappingEntityTest.php index 4f81c04993cc9..50532cdedcb31 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/DeleteGiftWrappingEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/DeleteGiftWrappingEntityTest.php @@ -64,7 +64,6 @@ public function __inject(GiftWrappingIndex $giftWrappingIndexPage, GiftWrappingN */ public function test(GiftWrapping $giftWrapping) { - $this->markTestIncomplete('Bug: MAGETWO-30995'); // Precondition $giftWrapping->persist(); diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/MassActionsGiftWrappingEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/MassActionsGiftWrappingEntityTest.php index 4b307a0f298b8..413f96bc78f71 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/MassActionsGiftWrappingEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/MassActionsGiftWrappingEntityTest.php @@ -82,7 +82,6 @@ public function __inject( */ public function test($giftWrappings, $giftWrappingsIndexToSelect, $action, $status, $giftWrappingsIndexToStay) { - $this->markTestIncomplete('Bug: MAGETWO-30995'); // Precondition $giftWrappingsInitial = explode(",", $giftWrappings); $giftWrappings = $this->createGiftWrappings($giftWrappingsInitial); diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/UpdateGiftWrappingEntityTest.php b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/UpdateGiftWrappingEntityTest.php index 7929d1b78987b..103af19e7241b 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/UpdateGiftWrappingEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/TestCase/UpdateGiftWrappingEntityTest.php @@ -66,7 +66,6 @@ public function __inject(GiftWrappingIndex $giftWrappingIndexPage, GiftWrappingN */ public function test(GiftWrapping $initialGiftWrapping, GiftWrapping $giftWrapping) { - $this->markTestIncomplete('Bug: MAGETWO-30995'); // Precondition $initialGiftWrapping->persist(); diff --git a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/etc/constraint.xml index 69f4ca8b85c0b..41bcb79ad811d 100644 --- a/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GiftWrapping/Test/etc/constraint.xml @@ -6,42 +6,42 @@ --> - low + low - low + low - low + low - high + high - low + low - low + low - low + low - high + high - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php index 2f6e5aa7df7f1..88a833c9bd469 100644 --- a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Block/Adminhtml/Types/Edit/GoogleShoppingForm.php @@ -23,11 +23,11 @@ class GoogleShoppingForm extends Form protected $attributeOptions = '//select[@id="gcontent_attribute_0_attribute"]//option'; /** - * Loading Mask locator + * Locator for root elements * * @var string */ - protected $loadingMask = '//ancestor::body/div[@id="loading-mask"]'; + protected $loaderRootLocator = 'body'; /** * Fill specified form data @@ -43,7 +43,10 @@ protected function _fill(array $fields, Element $element = null) $element = $this->getElement($context, $field); if ($this->mappingMode || ($element->isVisible() && !$element->isDisabled())) { $element->setValue($field['value']); - $this->waitForElementNotVisible($this->loadingMask, Locator::SELECTOR_XPATH); + $this->blockFactory->create( + 'Magento\Backend\Test\Block\Template', + ['element' => $this->browser->find($this->loaderRootLocator)] + )->waitLoader(); } } } diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php index 34073127adf82..5ea98e194dae5 100644 --- a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/Constraint/AssertProductAttributeAbsenceForAttributeMapping.php @@ -17,12 +17,9 @@ */ class AssertProductAttributeAbsenceForAttributeMapping extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that deleted attribute can't be mapped to Google Attribute (attribute doesn't appear in Attributes diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml index 0884f0c88fa2c..6850ea9c550f3 100644 --- a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - low + low diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php index 5222da7b40367..3b487c34e10bc 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php @@ -16,12 +16,9 @@ */ class AssertGroupedPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Format error message diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php index 6bca2665fbc84..b1e63455ab07e 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductForm.php @@ -15,12 +15,9 @@ */ class AssertGroupedProductForm extends AssertProductForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert form data equals fixture data diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php index 629deeb3489a1..7ac9a7d6c9ccc 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductInItemsOrderedGrid.php @@ -15,12 +15,9 @@ */ class AssertGroupedProductInItemsOrderedGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Fields for assert diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php index efd8aceafff82..a1002454955ec 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertGroupedProductsDefaultQty.php @@ -16,12 +16,9 @@ */ class AssertGroupedProductsDefaultQty extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that default qty for sub products in grouped product displays according to dataset on product page diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php index 2ed585d04503f..d0d23336d90da 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php @@ -15,12 +15,9 @@ */ class AssertSpecialPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Format error message diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php index 7ba05a579a764..754ddefe0621b 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Constraint/AssertTierPriceOnGroupedProductPage.php @@ -16,12 +16,9 @@ */ class AssertTierPriceOnGroupedProductPage extends AbstractAssertPriceOnGroupedProductPage { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Format error message diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml index d3a7eec9ae9e3..60649f87112c9 100644 --- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/etc/constraint.xml @@ -6,24 +6,24 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php index c8fda92ba3872..e3c735a261a93 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/Constraint/AssertProductAttributeAbsenceForExport.php @@ -16,12 +16,9 @@ */ class AssertProductAttributeAbsenceForExport extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that deleted attribute can't be used for Products' Export diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml index 5351e708af77c..bb39c61e343f3 100644 --- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - high + high diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php new file mode 100644 index 0000000000000..cd025b734f794 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.php @@ -0,0 +1,32 @@ +_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml new file mode 100644 index 0000000000000..87f9389c51434 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CreateAdmin.xml @@ -0,0 +1,22 @@ + + + + + + [name='adminUsername'] + + + [name='adminEmail'] + + + [name='adminPassword'] + + + [name='adminConfirm'] + + + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php new file mode 100644 index 0000000000000..af5707450b52e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.php @@ -0,0 +1,32 @@ +_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml new file mode 100644 index 0000000000000..afca361627a82 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/CustomizeStore.xml @@ -0,0 +1,18 @@ + + + + + + [ng-model*='currency'] + select + + + [ng-model*='language'] + select + + + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php new file mode 100644 index 0000000000000..efc112709e88d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.php @@ -0,0 +1,66 @@ +_rootElement->find($this->testConnection, Locator::SELECTOR_CSS)->click(); + } + + /** + * Get 'Test connection successful.' message. + * + * @return string + */ + public function getSuccessConnectionMessage() + { + return $this->_rootElement->find($this->successConnectionMessage, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.xml new file mode 100644 index 0000000000000..c09b95b5d282e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Database.xml @@ -0,0 +1,17 @@ + + + + + + + + + [name="dbname"] + + + + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php new file mode 100644 index 0000000000000..8df7ca8d6c0c2 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Install.php @@ -0,0 +1,100 @@ +_rootElement->find($this->installNow, Locator::SELECTOR_XPATH)->click(); + $this->waitForElementVisible($this->launchAdmin, Locator::SELECTOR_XPATH); + } + + /** + * Get admin info. + * + * @return string + */ + public function getAdminInfo() + { + $adminData = []; + $rows = $this->_rootElement->find('#admin-info .row')->getElements(); + foreach ($rows as $row) { + $dataRow = $row->find('div')->getElements(); + $key = strtolower(str_replace(' ', '_', str_replace(':', '', $dataRow[0]->getText()))); + $adminData[$key] = $dataRow[1]->getText(); + } + + return $adminData; + } + + /** + * Get database info. + * + * @return string + */ + public function getDbInfo() + { + $dbData = []; + $rows = $this->_rootElement->find('#db-info .row')->getElements(); + foreach ($rows as $row) { + $dataRow = $row->find('div')->getElements(); + $key = strtolower(str_replace(' ', '_', str_replace(':', '', $dataRow[0]->getText()))); + $dbData[$key] = $dataRow[1]->getText(); + } + + return $dbData; + } + + /** + * Click on 'Launch Magento Admin' button. + * + * @return void + */ + public function clickLaunchAdmin() + { + $this->_rootElement->find($this->launchAdmin, Locator::SELECTOR_XPATH)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Landing.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Landing.php new file mode 100644 index 0000000000000..75085d53c7507 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Landing.php @@ -0,0 +1,49 @@ +_rootElement->find($this->agreeAndSetup, Locator::SELECTOR_CSS)->click(); + } + + /** + * Click on 'Terms & Agreement' link. + * + * @return void + */ + public function clickTermsAndAgreement() + { + $this->_rootElement->find($this->termsAndAgreement, Locator::SELECTOR_CSS)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/License.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/License.php new file mode 100644 index 0000000000000..83f59f7159d4d --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/License.php @@ -0,0 +1,49 @@ +_rootElement->find($this->back, Locator::SELECTOR_CSS)->click(); + } + + /** + * Get license text. + * + * @return string + */ + public function getLicense() + { + return $this->_rootElement->find($this->license, Locator::SELECTOR_CSS)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/Readiness.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Readiness.php new file mode 100644 index 0000000000000..72fcfcb1aa26a --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/Readiness.php @@ -0,0 +1,108 @@ +_rootElement->find($this->readinessCheck, Locator::SELECTOR_CSS)->click(); + $this->waitForElementVisible($this->completedMessage, Locator::SELECTOR_CSS); + } + + /** + * Click on 'Next' button. + * + * @return void + */ + public function clickNext() + { + $this->_rootElement->find($this->next, Locator::SELECTOR_CSS)->click(); + } + + /** + * Get File Permissions check result. + * + * @return string + */ + public function getFilePermissionCheck() + { + return $this->_rootElement->find($this->filePermissionCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get PHP Version check result. + * + * @return string + */ + public function getPhpVersionCheck() + { + return $this->_rootElement->find($this->phpVersionCheck, Locator::SELECTOR_CSS)->getText(); + } + + /** + * Get PHP Extensions check result. + * + * @return string + */ + public function getPhpExtensionsCheck() + { + return $this->_rootElement->find($this->phpExtensionCheck, Locator::SELECTOR_CSS)->getText(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php new file mode 100644 index 0000000000000..08ca27d4d6f98 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.php @@ -0,0 +1,48 @@ +_rootElement->find($this->next)->click(); + } + + /** + * Click on 'Advanced Options' button. + * + * @return void + */ + public function clickAdvancedOptions() + { + $this->_rootElement->find($this->advancedOptions)->click(); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml new file mode 100644 index 0000000000000..b610ce62b6a1f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Block/WebConfiguration.xml @@ -0,0 +1,31 @@ + + + + + + + + [value="user"] + checkbox + + + [name="key"] + + + [ng-model*="rewrites"] + checkbox + + + [ng-model*="front"] + checkbox + + + [ng-model*="admin"] + checkbox + + + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php new file mode 100644 index 0000000000000..673956def75bf --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertAgreementTextPresent.php @@ -0,0 +1,49 @@ +getLicenseBlock()->getLicense(), + 'License agreement text is absent.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "License agreement text is present on Terms & Agreement page."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertCurrencySelected.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertCurrencySelected.php new file mode 100644 index 0000000000000..b2da3668ba26f --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertCurrencySelected.php @@ -0,0 +1,44 @@ +getMainBlock()->getRevenuePrice(), $currencySymbol) !== false, + 'Selected currency symbol not displays on dashboard.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Selected currency displays in admin.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertKeyCreated.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertKeyCreated.php new file mode 100644 index 0000000000000..13cd5642be416 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertKeyCreated.php @@ -0,0 +1,46 @@ +getKeyValue(), + $installPage->getInstallBlock()->getAdminInfo()['encryption_key'], + 'Selected encryption key on install page not equals to data from fixture.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Selected encryption key displays on success full install page.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertLanguageSelected.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertLanguageSelected.php new file mode 100644 index 0000000000000..177673c0adb93 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertLanguageSelected.php @@ -0,0 +1,45 @@ +open(); + \PHPUnit_Framework_Assert::assertTrue( + $indexPage->getLinksBlock()->isLinkVisible($languageTemplate), + 'Selected language not displays on frontend.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Selected language currently displays on frontend.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertRewritesEnabled.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertRewritesEnabled.php new file mode 100644 index 0000000000000..7c9672dfb3c3c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertRewritesEnabled.php @@ -0,0 +1,50 @@ +persist(); + $homePage->open(); + $homePage->getTopmenu()->selectCategoryByName($category->getName()); + + \PHPUnit_Framework_Assert::assertTrue( + strpos($browser->getUrl(), 'index.php') === false, + 'Apache redirect for category does not work.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Apache redirect works correct.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSecureUrlEnabled.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSecureUrlEnabled.php new file mode 100644 index 0000000000000..8f10986c665da --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSecureUrlEnabled.php @@ -0,0 +1,66 @@ +createByCode('configData', ['dataSet' => 'secure_url']); + $config->persist(); + $browser->getUrl(); + \PHPUnit_Framework_Assert::assertTrue( + strpos($browser->getUrl(), 'https://') !== false, + 'Secure Urls are not displayed on backend.' + ); + + $productSimple->persist(); + $stepFactory->create( + 'Magento\Catalog\Test\TestStep\AddProductsToTheCartStep', + ['products' => [$productSimple]] + )->run(); + $stepFactory->create('Magento\Catalog\Test\TestStep\ProceedToCheckoutStep')->run(); + \PHPUnit_Framework_Assert::assertTrue( + strpos($browser->getUrl(), 'https://') !== false, + 'Secure Urls are not displayed on frontend.' + ); + } + + /** + * Returns a string representation of the object. + * + * @return string + */ + public function toString() + { + return 'Secure Urls display successful.'; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessDbConnection.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessDbConnection.php new file mode 100644 index 0000000000000..96f01b94d167b --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessDbConnection.php @@ -0,0 +1,50 @@ +getDatabaseBlock()->clickTestConnection(); + \PHPUnit_Framework_Assert::assertContains( + self::SUCCESSFUL_CONNECTION, + $installPage->getDatabaseBlock()->getSuccessConnectionMessage(), + 'Unable to connect to database.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "System successfully connected to DB."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php new file mode 100644 index 0000000000000..47df11f0aacea --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessInstall.php @@ -0,0 +1,85 @@ + 'username', 'fixture' => 'username'], + ['pageData' => 'e-mail', 'fixture' => 'email'], + ['pageData' => 'your_store_address', 'fixture' => 'web'], + ['pageData' => 'magento_admin_address', 'fixture' => 'admin'] + ]; + + /** + * Database info fields mapping. + * + * @var array + */ + protected $dbFieldsList = [ + ['pageData' => 'database_name', 'fixture' => 'dbName'], + ['pageData' => 'username', 'fixture' => 'dbUser'] + ]; + + /** + * Assert that Magento successfully installed. + * + * @param InstallConfig $installConfig + * @param User $user + * @param Install $installPage + * @return void + */ + public function processAssert(Install $installPage, InstallConfig $installConfig, User $user) + { + $adminData = $installPage->getInstallBlock()->getAdminInfo(); + $dbData = $installPage->getInstallBlock()->getDbInfo(); + + $allData = array_merge($user->getData(), $installConfig->getData()); + $allData['admin'] = $allData['web'] . $allData['admin'] . '/'; + + foreach ($this->adminFieldsList as $field) { + \PHPUnit_Framework_Assert::assertEquals( + $allData[$field['fixture']], + $adminData[$field['pageData']], + 'Wrong admin information is displayed.' + ); + } + foreach ($this->dbFieldsList as $field) { + \PHPUnit_Framework_Assert::assertEquals( + $allData[$field['fixture']], + $dbData[$field['pageData']], + 'Wrong database information is displayed.' + ); + } + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "Install successfully finished."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessfulReadinessCheck.php b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessfulReadinessCheck.php new file mode 100644 index 0000000000000..22db21f2f57ab --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Constraint/AssertSuccessfulReadinessCheck.php @@ -0,0 +1,69 @@ +getReadinessBlock()->getPhpVersionCheck(), + 'PHP version is incorrect.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::PHP_EXTENSIONS_MESSAGE, + $installPage->getReadinessBlock()->getPhpExtensionsCheck(), + 'PHP extensions missed.' + ); + \PHPUnit_Framework_Assert::assertContains( + self::FILE_PERMISSION_MESSAGE, + $installPage->getReadinessBlock()->getFilePermissionCheck(), + 'File permissions does not meet requirements.' + ); + } + + /** + * Returns a string representation of successful assertion. + * + * @return string + */ + public function toString() + { + return "PHP Version, PHP Extensions and File Permission are ok."; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.php b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.php new file mode 100644 index 0000000000000..c8cdfe81c280e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.php @@ -0,0 +1,209 @@ + 'dbHost', + 'backend_type' => 'virtual', + ]; + + protected $dbUser = [ + 'attribute_code' => 'dbUser', + 'backend_type' => 'virtual', + ]; + + protected $dbPassword = [ + 'attribute_code' => 'dbPassword', + 'backend_type' => 'virtual', + ]; + + protected $dbName = [ + 'attribute_code' => 'dbName', + 'backend_type' => 'virtual', + ]; + + protected $web = [ + 'attribute_code' => 'web', + 'backend_type' => 'virtual', + ]; + + protected $admin = [ + 'attribute_code' => 'admin', + 'backend_type' => 'virtual', + ]; + + protected $adminUsername = [ + 'attribute_code' => 'adminUsername', + 'backend_type' => 'virtual', + ]; + + protected $adminEmail = [ + 'attribute_code' => 'adminEmail', + 'backend_type' => 'virtual', + ]; + + protected $adminPassword = [ + 'attribute_code' => 'adminPassword', + 'backend_type' => 'virtual', + ]; + + protected $adminConfirm = [ + 'attribute_code' => 'adminConfirm', + 'backend_type' => 'virtual', + ]; + + protected $apacheRewrites = [ + 'attribute_code' => 'apacheRewrites', + 'backend_type' => 'virtual', + ]; + + protected $dbTablePrefix = [ + 'attribute_code' => 'dbTablePrefix', + 'backend_type' => 'virtual', + ]; + + protected $keyOwn = [ + 'attribute_code' => 'keyOwn', + 'backend_type' => 'virtual', + ]; + + protected $httpsAdmin = [ + 'attribute_code' => 'httpsAdmin', + 'backend_type' => 'virtual', + ]; + + protected $httpsFront = [ + 'attribute_code' => 'httpsFront', + 'backend_type' => 'virtual', + ]; + + protected $keyValue = [ + 'attribute_code' => 'keyValue', + 'backend_type' => 'virtual', + ]; + + protected $language = [ + 'attribute_code' => 'language', + 'backend_type' => 'virtual', + ]; + + protected $currency = [ + 'attribute_code' => 'language', + 'backend_type' => 'virtual', + ]; + + public function getDbHost() + { + return $this->getData('dbHost'); + } + + public function getDbUser() + { + return $this->getData('dbUser'); + } + + public function getDbPassword() + { + return $this->getData('dbPassword'); + } + + public function getDbName() + { + return $this->getData('dbName'); + } + + public function getWeb() + { + return $this->getData('web'); + } + + public function getAdmin() + { + return $this->getData('admin'); + } + + public function getAdminUsername() + { + return $this->getData('adminUsername'); + } + + public function getAdminEmail() + { + return $this->getData('adminEmail'); + } + + public function getAdminPassword() + { + return $this->getData('adminPassword'); + } + + public function getAdminConfirm() + { + return $this->getData('adminConfirm'); + } + + public function getCurrency() + { + return $this->getData('currency'); + } + + public function getApacheRewrites() + { + return $this->getData('apacheRewrites'); + } + + public function getKeyOwn() + { + return $this->getData('keyOwn'); + } + + public function getKeyValue() + { + return $this->getData('keyValue'); + } + + public function getLanguage() + { + return $this->getData('language'); + } + + public function getHttpsAdmin() + { + return $this->getData('httpsAdmin'); + } + + public function getHttpsFront() + { + return $this->getData('httpsFront'); + } + + public function getDbTablePrefix() + { + return $this->getData('dbTablePrefix'); + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml new file mode 100644 index 0000000000000..aad8122cc39c7 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Fixture/Install.xml @@ -0,0 +1,75 @@ + + + + Magento_Install + virtual + install + + + dbHost + virtual + + + dbUser + virtual + + + dbTablePrefix + virtual + + + dbPassword + virtual + + + dbname + virtual + + + web + virtual + + + dbTablePrefix + virtual + + + admin + virtual + + + httpsFront + virtual + + + httpsAdmin + virtual + + + apacheRewrites + virtual + + + keyOwn + virtual + + + keyValue + virtual + + + language + virtual + + + currency + virtual + + + Magento\Install\Test\Repository\Install + Magento\Install\Test\Handler\Install\InstallInterface + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/Page/Install.xml b/dev/tests/functional/tests/app/Magento/Install/Test/Page/Install.xml new file mode 100644 index 0000000000000..06f3b3a33b408 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/Page/Install.xml @@ -0,0 +1,50 @@ + + + + + + Magento\Install\Test\Block\Landing + body + css selector + + + Magento\Install\Test\Block\License + body + css selector + + + Magento\Install\Test\Block\Readiness + body + css selector + + + Magento\Install\Test\Block\Database + body + css selector + + + Magento\Install\Test\Block\WebConfiguration + body + css selector + + + Magento\Install\Test\Block\CustomizeStore + body + css selector + + + Magento\Install\Test\Block\CreateAdmin + body + css selector + + + Magento\Install\Test\Block\Install + body + css selector + + + \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php new file mode 100644 index 0000000000000..726337a42a551 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.php @@ -0,0 +1,150 @@ +getConfigParam('install_data/db_credentials'); + $urlConfig = $systemConfig->getConfigParam('install_data/url'); + $configData['web'] = $urlConfig['base_url']; + $configData['admin'] = $urlConfig['backend_frontname']; + + return ['configData' => $configData]; + } + + /** + * Injection data. + * + * @param CmsIndex $homePage + * @param Install $installPage + * @return void + */ + public function __inject(Install $installPage, CmsIndex $homePage) + { + $magentoBaseDir = dirname(dirname(dirname(MTF_BP))); + // Uninstall Magento. + shell_exec("php -f $magentoBaseDir/setup/index.php uninstall"); + $this->installPage = $installPage; + $this->homePage = $homePage; + } + + /** + * Install Magento via web interface. + * + * @param User $user + * @param array $install + * @param array $configData + * @param FixtureFactory $fixtureFactory + * @param AssertAgreementTextPresent $assertLicense + * @param AssertSuccessfulReadinessCheck $assertReadiness + * @param AssertSuccessDbConnection $assertDbConnection + * @return array + */ + public function test( + User $user, + array $install, + array $configData, + FixtureFactory $fixtureFactory, + AssertAgreementTextPresent $assertLicense, + AssertSuccessfulReadinessCheck $assertReadiness, + AssertSuccessDbConnection $assertDbConnection + ) { + $this->markTestIncomplete('Bug: MAGETWO-31622'); + $dataConfig = array_merge($install, $configData); + /** @var InstallConfig $installConfig */ + $installConfig = $fixtureFactory->create('Magento\Install\Test\Fixture\Install', ['data' => $dataConfig]); + // Steps + $this->homePage->open(); + // Verify license agreement. + $this->installPage->getLandingBlock()->clickTermsAndAgreement(); + $assertLicense->processAssert($this->installPage); + $this->installPage->getLicenseBlock()->clickBack(); + $this->installPage->getLandingBlock()->clickAgreeAndSetup(); + // Step 1: Readiness Check. + $this->installPage->getReadinessBlock()->clickReadinessCheck(); + $assertReadiness->processAssert($this->installPage); + $this->installPage->getReadinessBlock()->clickNext(); + // Step 2: Add a Database. + $this->installPage->getDatabaseBlock()->fill($installConfig); + $assertDbConnection->processAssert($this->installPage); + $this->installPage->getDatabaseBlock()->clickNext(); + // Step 3: Web Configuration. + $this->installPage->getWebConfigBlock()->clickAdvancedOptions(); + $this->installPage->getWebConfigBlock()->fill($installConfig); + $this->installPage->getWebConfigBlock()->clickNext(); + // Step 4: Customize Your Store + $this->installPage->getCustomizeStoreBlock()->fill($installConfig); + $this->installPage->getCustomizeStoreBlock()->clickNext(); + // Step 5: Create Admin Account. + $this->installPage->getCreateAdminBlock()->fill($user); + $this->installPage->getCreateAdminBlock()->clickNext(); + // Step 6: Install. + $this->installPage->getInstallBlock()->clickInstallNow(); + + return ['installConfig' => $installConfig]; + } +} diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest/test.csv b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest/test.csv new file mode 100644 index 0000000000000..4a3b6dc96aef1 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest/test.csv @@ -0,0 +1,7 @@ +"user/dataSet";"install/dbTablePrefix";"install/admin";"install/httpsFront";"install/httpsAdmin";"install/apacheRewrites";"install/keyOwn";"install/keyValue";"install/language";"install/currency";"currencySymbol";"languageTemplate";"constraint";"description";"issue" +"default";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin";"install with default values";"" +"default";"-";"custom";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin";"install with custom admin path";"" +"default";"-";"-";"-";"-";"-";"Yes";"123123qa";"German (Germany)";"Euro (EUR)";"€";"Suchbegriffe";"assertSuccessInstall, assertKeyCreated, assertUserSuccessLogin, assertCurrencySelected, assertLanguageSelected";"install with custom encryption key and changed currency and locale";"" +"default";"prefix1_";"-";"-";"-";"-";"-";"-";"Chinese (China)";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin";"install with table prefix";"MAGETWO-31658" +"default";"-";"-";"-";"-";"Yes";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin, assertRewritesEnabled";"install with enabled url rewrites";"" +"default";"-";"-";"Yes";"Yes";"-";"-";"-";"-";"-";"-";"-";"assertSuccessInstall, assertUserSuccessLogin, assertSecureUrlEnabled";"install with enabled secure urls";"MAGETWO-31409" diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Install/Test/etc/constraint.xml new file mode 100644 index 0000000000000..921f167e82432 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/etc/constraint.xml @@ -0,0 +1,35 @@ + + + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + + low + + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Magento/Install/Test/etc/fixture.xml new file mode 100644 index 0000000000000..c5c091aad3d47 --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/etc/fixture.xml @@ -0,0 +1,35 @@ + + + + + + virtual + install + + + dbHost + virtual + + + dbUser + virtual + + + dbPassword + virtual + + + dbname + virtual + + + web + virtual + + + + diff --git a/dev/tests/functional/tests/app/Magento/Install/Test/etc/page.xml b/dev/tests/functional/tests/app/Magento/Install/Test/etc/page.xml new file mode 100644 index 0000000000000..523ecd7d0672c --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Install/Test/etc/page.xml @@ -0,0 +1,12 @@ + + + + + setup/ + Magento\Install\Test\Page\Install + + diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php index ade2be8551d58..a63736cd0586e 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationForm.php @@ -16,12 +16,9 @@ */ class AssertIntegrationForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Skipped fields while verifying diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php index 64e75ebc36f1f..9f951bf4cbbf0 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationInGrid.php @@ -15,12 +15,9 @@ */ class AssertIntegrationInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that data in grid on Integrations page according to fixture by name field diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php index 7d20f923a05ba..4ede24580af26 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertIntegrationNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Integration is not presented in grid and cannot be found using name diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php index 20f4131a889cf..0775f54fb5946 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationResourcesPopup.php @@ -15,12 +15,9 @@ */ class AssertIntegrationResourcesPopup extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that pop-up with resources, that were specified for integration are shown 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 4be66304d1da7..b01706c3357e6 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 @@ -15,14 +15,11 @@ */ class AssertIntegrationSuccessActivationMessage extends AbstractConstraint { - const SUCCESS_ACTIVATION_MESSAGE = "The integration '%s' has been activated."; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_ACTIVATION_MESSAGE = "The integration '%s' has been activated."; /** * Assert that success activation message is appeared on the Integrations page 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 be93e0fea3bbc..b4eebeb1be76e 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 @@ -15,14 +15,11 @@ */ class AssertIntegrationSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = "The integration '%s' has been deleted."; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = "The integration '%s' has been deleted."; /** * Assert that success delete message is appeared on the Integrations page 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 356d4332647f4..a9ebd1799a305 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 @@ -15,18 +15,15 @@ */ class AssertIntegrationSuccessReauthorizeMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Integration success reauthorize message. */ const SUCCESS_REAUTHORIZE_MESSAGE = "The integration '%s' has been re-authorized."; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success reauthorize message is appeared on the Integrations page. * 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 ad5e2dc64d9b2..2e0d060bad29b 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 @@ -15,14 +15,11 @@ */ class AssertIntegrationSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = "The integration '%s' has been saved."; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_SAVE_MESSAGE = "The integration '%s' has been saved."; /** * Assert that success save message is appeared on the Integrations page diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php index 9b388b9f5b09a..8d94bb2da09fd 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensAfterReauthorize.php @@ -16,12 +16,9 @@ */ class AssertIntegrationTokensAfterReauthorize extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Fields don't have to change. diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php index a4b1cde53f7de..65c56809d69f7 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/Constraint/AssertIntegrationTokensPopup.php @@ -14,12 +14,9 @@ */ class AssertIntegrationTokensPopup extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Fields to be checked diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php index d808721ac0c3c..c665073f124b7 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/ActivateIntegrationEntityTest.php @@ -53,7 +53,6 @@ public function __inject(IntegrationIndex $integrationIndex) */ public function test(Integration $integration) { - $this->markTestIncomplete('Bug: MAGETWO-30270'); // Preconditions $integration->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml index 9c2790b31eb6a..d07530258b25d 100644 --- a/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Integration/Test/etc/constraint.xml @@ -6,21 +6,21 @@ --> - high + high - high + high - high + high @@ -28,48 +28,48 @@ - low + low - high + high - high + high - high + high - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.php index eedaf1cc57499..d57ce65dce99c 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.php @@ -21,6 +21,13 @@ class Form extends \Mtf\Block\Form */ protected $sendInvitationsButton = '.action.submit'; + /** + * Add email button + * + * @var string + */ + protected $addEmail = '.add'; + /** * Click 'Send Invitations' button * @@ -42,6 +49,11 @@ public function fill(FixtureInterface $invitation, Element $element = null) { $data = $invitation->getData(); $mapping = $this->dataMapping($data); + $emailCount = count($data['email']); + while ($emailCount > 1) { + $this->_rootElement->find($this->addEmail)->click(); + $emailCount--; + } $this->_fill($mapping, $element); return $this; diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.xml b/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.xml index f64ffda5028c2..c71f31eecfa40 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.xml +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Block/Form.xml @@ -8,19 +8,19 @@ - [name="email[1]"] + [name="email[0]"] - [name="email[2]"] + [name="email[1]"] - [name="email[3]"] + [name="email[2]"] - [name="email[4]"] + [name="email[3]"] - [name="email[5]"] + [name="email[4]"] diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationErrorSentMessage.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationErrorSentMessage.php index a169572d955c8..cda661fee24df 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationErrorSentMessage.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationErrorSentMessage.php @@ -14,18 +14,15 @@ */ class AssertInvitationErrorSentMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Error send message. */ const ERROR_MESSAGE = "Something went wrong sending %d of %d invitations."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error message appears after sending invitation on backend. * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationForm.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationForm.php index 922e42bafe059..dfd4ee80250cb 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationForm.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationForm.php @@ -15,12 +15,9 @@ */ class AssertInvitationForm extends AbstractAssertForm { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Invitation form was filled correctly: email, message, status. diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendErrorSendDuplicateMessage.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendErrorSendDuplicateMessage.php index 58a8e5546c9bb..54bf9b513f1b7 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendErrorSendDuplicateMessage.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendErrorSendDuplicateMessage.php @@ -14,18 +14,15 @@ */ class AssertInvitationFrontendErrorSendDuplicateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Error duplicate message */ const ERROR_MESSAGE = "Invitation for same email address already exists."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error message appears after sent invitation to the same email address * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendSuccessSentMessage.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendSuccessSentMessage.php index a11cea3417989..5535f2d94be06 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendSuccessSentMessage.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationFrontendSuccessSentMessage.php @@ -15,18 +15,15 @@ */ class AssertInvitationFrontendSuccessSentMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success sent message */ const SUCCESS_MESSAGE = "You sent the invitation for %s."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears after sent invitation on frontend * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGrid.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGrid.php index e2568bdea5b13..eacaa94968c40 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGrid.php @@ -15,12 +15,9 @@ */ class AssertInvitationInGrid extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert created invitation appears in Invitation grid on backend: email, status, Invitee. diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGridOnFrontend.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGridOnFrontend.php index bd06f08efcb9c..ae6b85a7246b5 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGridOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationInGridOnFrontend.php @@ -17,12 +17,9 @@ */ class AssertInvitationInGridOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Invitation appears on frontend in My Invitations grid diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationNoticeMessage.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationNoticeMessage.php index c0129fecd36ee..4930d9d3e70af 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationNoticeMessage.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationNoticeMessage.php @@ -14,6 +14,10 @@ */ class AssertInvitationNoticeMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + // @codingStandardsIgnoreStart /** * Notice message. @@ -21,13 +25,6 @@ class AssertInvitationNoticeMessage extends AbstractConstraint const NOTICE_MESSAGE = "%d invitation(s) were not sent, because customer accounts already exist for specified email addresses."; // @codingStandardsIgnoreEnd - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that notice message appears after sending invitation on backend. * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationOneEntry.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationOneEntry.php index aa355c1e708d9..f70caf610979c 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationOneEntry.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationOneEntry.php @@ -17,12 +17,9 @@ */ class AssertInvitationOneEntry extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert only one invitation was sent to unique email on frontend diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessDiscardMessage.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessDiscardMessage.php index 738fe9ead880f..d95d58ce14179 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessDiscardMessage.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessDiscardMessage.php @@ -15,18 +15,15 @@ */ class AssertInvitationSuccessDiscardMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success discard message. */ const SUCCESS_MESSAGE = "We discarded %d of %d invitations."; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears after discard invitation on backend. * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessage.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessage.php index aba9bd2ad1957..8040040f9293b 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessage.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessage.php @@ -15,18 +15,15 @@ */ class AssertInvitationSuccessSentMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success sent message. */ const SUCCESS_MESSAGE = "We sent %d of %d invitations."; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears after sent invitation on frontend. * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessageOnBackend.php b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessageOnBackend.php index bbfc9e9a309ec..ddbd8bce48fb6 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessageOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/Constraint/AssertInvitationSuccessSentMessageOnBackend.php @@ -13,18 +13,15 @@ */ class AssertInvitationSuccessSentMessageOnBackend extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success sent message. */ const SUCCESS_MESSAGE = "We sent %d invitation(s)."; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears after sent invitation on frontend. * diff --git a/dev/tests/functional/tests/app/Magento/Invitation/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Invitation/Test/etc/constraint.xml index 1fbc2ba328fce..267287d80df7b 100644 --- a/dev/tests/functional/tests/app/Magento/Invitation/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Invitation/Test/etc/constraint.xml @@ -6,36 +6,36 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Logging/Test/Constraint/AssertAdminUserDataBlock.php b/dev/tests/functional/tests/app/Magento/Logging/Test/Constraint/AssertAdminUserDataBlock.php index 34fb16e723451..46139fb8058d7 100644 --- a/dev/tests/functional/tests/app/Magento/Logging/Test/Constraint/AssertAdminUserDataBlock.php +++ b/dev/tests/functional/tests/app/Magento/Logging/Test/Constraint/AssertAdminUserDataBlock.php @@ -14,12 +14,9 @@ */ class AssertAdminUserDataBlock extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Admin User Data block with data according action is presented on page diff --git a/dev/tests/functional/tests/app/Magento/Logging/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Logging/Test/etc/constraint.xml index 396008f4c737f..7055c26102d25 100644 --- a/dev/tests/functional/tests/app/Magento/Logging/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Logging/Test/etc/constraint.xml @@ -6,7 +6,7 @@ --> - low + low diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistState.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistState.php index 55fb14c06cab1..e9866c290ee5e 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistState.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistState.php @@ -25,12 +25,9 @@ */ abstract class AbstractAssertMultipleWishlistState extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'Medium'; + /* tags */ + const SEVERITY = 'Medium'; + /* end tags */ /** * Notice type diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistSuccessMessage.php index 6d56fc028452a..e61418ebcd0e4 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AbstractAssertMultipleWishlistSuccessMessage.php @@ -15,6 +15,10 @@ */ abstract class AbstractAssertMultipleWishlistSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success message * @@ -22,13 +26,6 @@ abstract class AbstractAssertMultipleWishlistSuccessMessage extends AbstractCons */ protected $message; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert success message is displayed * diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertBundleProductDetailsInMultipleWishlist.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertBundleProductDetailsInMultipleWishlist.php index b458577d3dab4..3ca075963bf15 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertBundleProductDetailsInMultipleWishlist.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertBundleProductDetailsInMultipleWishlist.php @@ -20,12 +20,9 @@ */ class AssertBundleProductDetailsInMultipleWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that the correct option details are displayed on the "View Details" tool tip. diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertDeleteMultipleWishlistButtonIsAbsent.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertDeleteMultipleWishlistButtonIsAbsent.php index cb41abbbccb40..4e3ce4bdfe6ed 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertDeleteMultipleWishlistButtonIsAbsent.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertDeleteMultipleWishlistButtonIsAbsent.php @@ -14,12 +14,9 @@ */ class AssertDeleteMultipleWishlistButtonIsAbsent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'Medium'; + /* tags */ + const SEVERITY = 'Medium'; + /* end tags */ /** * Assert that there is no "Delete Wishlist" button for Customer diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistAbsentInMyAccount.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistAbsentInMyAccount.php index 260c90beb59fd..290960a019ee7 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistAbsentInMyAccount.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistAbsentInMyAccount.php @@ -11,12 +11,9 @@ */ class AssertMultipleWishlistAbsentInMyAccount extends AbstractAssertMultipleWishlistExist { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert wish list is absent diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistPresentInMyAccount.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistPresentInMyAccount.php index d9a7e4f3a8516..69992de5ff060 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistPresentInMyAccount.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertMultipleWishlistPresentInMyAccount.php @@ -11,12 +11,9 @@ */ class AssertMultipleWishlistPresentInMyAccount extends AbstractAssertMultipleWishlistExist { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert wish list is present diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductAbsentInDefaultWishlist.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductAbsentInDefaultWishlist.php index 71cb4da71ad75..679fda94aead3 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductAbsentInDefaultWishlist.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductAbsentInDefaultWishlist.php @@ -17,12 +17,9 @@ */ class AssertProductAbsentInDefaultWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is absent in default wishlist diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInCustomWishlist.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInCustomWishlist.php index c0ba209a2b7d2..76807934961a2 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInCustomWishlist.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInCustomWishlist.php @@ -18,12 +18,9 @@ */ class AssertProductInCustomWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in custom wishlist diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInDefaultWishlist.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInDefaultWishlist.php index dd72f519b5859..cb3d0baf6f627 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInDefaultWishlist.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertProductInDefaultWishlist.php @@ -17,12 +17,9 @@ */ class AssertProductInDefaultWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product and quantity is present in default wishlist diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertWishlistReportGrid.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertWishlistReportGrid.php index 18aa1731f19de..22993c66d783f 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertWishlistReportGrid.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Constraint/AssertWishlistReportGrid.php @@ -16,12 +16,9 @@ */ class AssertWishlistReportGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that added to the customer wish list products present in the grid and products have correct values diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Page/Category/CatalogCategoryView.xml index 8829191c28d92..c88f8995f3bab 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Page/Category/CatalogCategoryView.xml +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/Page/Category/CatalogCategoryView.xml @@ -8,7 +8,7 @@ Magento\MultipleWishlist\Test\Block\Widget\Search - .widget.block.wishlist.find + .widget.block.block-wishlist-search css selector diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/AddProductToMultipleWishListTest.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/AddProductToMultipleWishListTest.php index de6c8bc9088af..1c20105b80c1c 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/AddProductToMultipleWishListTest.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/AddProductToMultipleWishListTest.php @@ -55,8 +55,6 @@ public function __prepare() */ public function test(MultipleWishlist $multipleWishlist, $products, $duplicate) { - $this->markTestIncomplete('Bug: MAGETWO-27949'); - // Preconditions $multipleWishlist->persist(); $customer = $multipleWishlist->getDataFieldConfig('customer_id')['source']->getCustomer(); diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest.php index 570a34316fbd9..76da23d0d6eb8 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest.php @@ -127,6 +127,7 @@ public function test(MultipleWishlist $multipleWishlist, $products, $duplicate, $this->customerIndex->open(); $this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); $this->customerIndexEdit->getPageActionsBlock()->createOrder(); + $this->orderCreateIndex->getStoreBlock()->selectStoreView(); $this->orderCreateIndex->getMultipleWishlistBlock()->selectWishlist($multipleWishlist->getName()); $wishlistItemsBlock = $this->orderCreateIndex->getMultipleWishlistBlock()->getWishlistItemsBlock(); $wishlistItemsBlock->selectItemToAddToOrder($product, $qtyToMove); diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest/test.csv b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest/test.csv index eb783008ccb72..e795b38d0d463 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductFromCustomerActivityToOrderTest/test.csv @@ -1,7 +1,7 @@ -"multipleWishlist/dataSet";"products";"duplicate";"qtyToMove";"constraint";"issue" -"wishlist_public";"catalogProductSimple::100_dollar_product";"yes";"2";"assertProductInItemsOrderedGrid";"" -"wishlist_public";"catalogProductVirtual::50_dollar_product";"no";"1";"assertProductInItemsOrderedGrid";"" -"wishlist_public";"configurableProductInjectable::default";"no";"3";"assertConfigurableProductInItemsOrderedGrid";"" -"wishlist_public";"groupedProductInjectable::three_simple_products";"no";"-";"assertGroupedProductInItemsOrderedGrid";"" -"wishlist_public";"downloadableProductInjectable::with_two_separately_links";"no";"1";"assertProductInItemsOrderedGrid";"Bug: MAGETWO-29173" -"wishlist_public";"bundleProduct::bundle_dynamic_product";"no";"2";"assertProductInItemsOrderedGrid";"" \ No newline at end of file +"multipleWishlist/dataSet";"products";"duplicate";"qtyToMove";"constraint" +"wishlist_public";"catalogProductSimple::100_dollar_product";"yes";"2";"assertProductInItemsOrderedGrid" +"wishlist_public";"catalogProductVirtual::50_dollar_product";"no";"1";"assertProductInItemsOrderedGrid" +"wishlist_public";"configurableProductInjectable::default";"no";"3";"assertConfigurableProductInItemsOrderedGrid" +"wishlist_public";"groupedProductInjectable::three_simple_products";"no";"-";"assertGroupedProductInItemsOrderedGrid" +"wishlist_public";"downloadableProductInjectable::with_two_separately_links";"no";"1";"assertProductInItemsOrderedGrid" +"wishlist_public";"bundleProduct::bundle_dynamic_product";"no";"2";"assertProductInItemsOrderedGrid" \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductToAnotherWishlistEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductToAnotherWishlistEntityTest/test.csv index 5e744edce0613..aee4edda5fbe3 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductToAnotherWishlistEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/MoveProductToAnotherWishlistEntityTest/test.csv @@ -1,6 +1,6 @@ -"description";"product";"qty";"qtyToAction";"constraint";"issue" -"Move one product from two existed";"catalogProductSimple::default";"2";"1";"assertProductInDefaultWishlist, assertProductInCustomWishlist";"Bug: MAGETWO-28741" -"Move one product - zero left";"downloadableProductInjectable::default";"-";"-";"assertProductAbsentInDefaultWishlist, assertProductInCustomWishlist";"" -"Move one product - zero left";"groupedProductInjectable::default";"-";"-";"assertProductAbsentInDefaultWishlist, assertProductInCustomWishlist";"" -"Move one product - zero left";"configurableProductInjectable::default";"1";"1";"assertProductAbsentInDefaultWishlist, assertProductInCustomWishlist";"" -"Move one product from two existed";"bundleProduct::bundle_fixed_product";"2";"1";"assertProductInDefaultWishlist, assertProductInCustomWishlist";"Bug: MAGETWO-28741" \ No newline at end of file +"description";"product";"qty";"qtyToAction";"constraint"; +"Move one product from two existed";"catalogProductSimple::default";"2";"1";"assertProductInDefaultWishlist, assertProductInCustomWishlist"; +"Move one product - zero left";"downloadableProductInjectable::default";"-";"-";"assertProductAbsentInDefaultWishlist, assertProductInCustomWishlist"; +"Move one product - zero left";"groupedProductInjectable::default";"-";"-";"assertProductAbsentInDefaultWishlist, assertProductInCustomWishlist"; +"Move one product - zero left";"configurableProductInjectable::default";"1";"1";"assertProductAbsentInDefaultWishlist, assertProductInCustomWishlist"; +"Move one product from two existed";"bundleProduct::bundle_fixed_product";"2";"1";"assertProductInDefaultWishlist, assertProductInCustomWishlist"; \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/ShareMultipleWishlistTest.php b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/ShareMultipleWishlistTest.php index 8179d1d35b3df..ecae279578a91 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/ShareMultipleWishlistTest.php +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/TestCase/ShareMultipleWishlistTest.php @@ -134,7 +134,6 @@ public function test( MultipleWishlist $multipleWishlist, array $sharingInfo ) { - $this->markTestIncomplete("Bug: MAGETWO-30155"); // Preconditions $multipleWishlist->persist(); $product->persist(); @@ -145,7 +144,7 @@ public function test( $this->cmsIndex->getLinksBlock()->openLink("Log In"); $this->customerAccountLogin->getLoginBlock()->login($customer); $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->catalogProductView->getMultipleWishlistViewBlock()->addToMultipleWishlist($multipleWishlist->getName()); + $this->catalogProductView->getMultipleWishlistViewBlock()->addToMultipleWishlist($multipleWishlist); $this->wishlistIndex->getWishlistBlock()->clickShareWishList(); $this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo); $this->wishlistShare->getSharingInfoForm()->shareWishlist(); diff --git a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/etc/constraint.xml index 5efe09b772c59..625c4623bf061 100644 --- a/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/MultipleWishlist/Test/etc/constraint.xml @@ -6,39 +6,39 @@ --> - low + low - high + high - low + low - medium + medium - medium + medium - medium + medium - medium + medium - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestCase/MultishippingTest.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestCase/MultishippingTest.php index a0e09e41526b7..7021984fb41da 100644 --- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestCase/MultishippingTest.php +++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestCase/MultishippingTest.php @@ -24,7 +24,6 @@ class MultishippingTest extends Functional */ public function testMultishippingCheckout(GuestPaypalDirect $fixture) { - $this->markTestIncomplete('MAGETWO-31038'); $fixture->persist(); //Ensure shopping cart is empty diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php index d4df4c5f18ba4..e495cc5c26b6f 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php @@ -15,12 +15,9 @@ */ class AssertCustomerIsSubscribedToNewsletter extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert customer is subscribed to newsletter diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php index f07cb841b2d8f..87ecaab62d783 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterForm.php @@ -16,12 +16,9 @@ */ class AssertNewsletterForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that newsletter template form data equals to data passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php index 3a8978e4e2241..6413cb74527e3 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterInGrid.php @@ -16,12 +16,9 @@ */ class AssertNewsletterInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that newsletter template is present in grid diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php index 631e908de3c39..358d9577e582c 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterPreview.php @@ -16,12 +16,9 @@ */ class AssertNewsletterPreview extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that newsletter preview opened in new window and template content correct diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php index 912fe3596534b..2ce269d38a27f 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Constraint/AssertNewsletterQueue.php @@ -15,6 +15,10 @@ */ class AssertNewsletterQueue extends AbstractAssertForm { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Skipped fields for verify data * @@ -22,13 +26,6 @@ class AssertNewsletterQueue extends AbstractAssertForm */ protected $skippedFields = ['code']; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that "Edit Queue" page opened and subject, sender name, sender email and template content correct * 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 0301b63722ab6..f6fd7b3160427 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 @@ -15,14 +15,11 @@ */ class AssertNewsletterSuccessCreateMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The newsletter template has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The newsletter template has been saved.'; /** * Assert that success message is displayed after newsletter template save diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml index a0e9aa600a287..c8f0a34ba60ed 100644 --- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/etc/constraint.xml @@ -6,21 +6,21 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderForm.php b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderForm.php index d031a3fb83a68..c276b006ddc33 100644 --- a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderForm.php +++ b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderForm.php @@ -15,12 +15,9 @@ */ class AssertReminderForm extends AbstractAssertForm { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'medium'; + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ /** * Skipped fields for verify data. diff --git a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderInGrid.php b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderInGrid.php index de883f126d78d..0b025aa6f4f44 100644 --- a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderInGrid.php @@ -14,12 +14,9 @@ */ class AssertReminderInGrid extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert reminder with following fields is present in grid: diff --git a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderMatchedCustomers.php b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderMatchedCustomers.php index 48c388acc0b36..8f850a4fe53b1 100644 --- a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderMatchedCustomers.php +++ b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderMatchedCustomers.php @@ -23,12 +23,9 @@ */ class AssertReminderMatchedCustomers extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Browser. diff --git a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderSuccessSaveMessage.php index 2468a69fd33ef..07e9ba4a3c76b 100644 --- a/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Reminder/Test/Constraint/AssertReminderSuccessSaveMessage.php @@ -13,18 +13,15 @@ */ class AssertReminderSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text success save reminder message. */ const SUCCESS_SAVE_MESSAGE = 'You saved the reminder rule.'; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is present. * diff --git a/dev/tests/functional/tests/app/Magento/Reminder/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Reminder/Test/etc/constraint.xml index edee2310123c3..a3d29adf23bba 100644 --- a/dev/tests/functional/tests/app/Magento/Reminder/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Reminder/Test/etc/constraint.xml @@ -6,15 +6,15 @@ --> - low + low - low + low - medium + medium - low + low diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php index 2197bb7258ed6..c4ba864da99ce 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AbstractAssertCustomerOrderReportResult.php @@ -14,12 +14,9 @@ */ abstract class AbstractAssertCustomerOrderReportResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Prepare filter diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php index 72ef4692cb1b8..58c6d072f8808 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertAbandonedCartCustomerInfoResult.php @@ -15,12 +15,9 @@ */ class AssertAbandonedCartCustomerInfoResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert customer info in Abandoned Carts report (Reports > Abandoned carts): diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php index 99703e7f14997..2d69337a2909f 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertBestsellerReportResult.php @@ -15,12 +15,9 @@ */ class AssertBestsellerReportResult extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert bestseller info in report: date, product name and qty. diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php index 85139327f6569..41c8dc7474129 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCouponReportResult.php @@ -15,12 +15,9 @@ */ class AssertCouponReportResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert coupon info in report: code, rule name, subtotal, discount on coupons report page diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php index 66921b008c9c0..619f3061d7b24 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderCountReportResult.php @@ -14,12 +14,9 @@ */ class AssertCustomerOrderCountReportResult extends AbstractAssertCustomerOrderReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert OrderCountReport grid for all params diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php index 61e58c60849ab..de236974bff77 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertCustomerOrderTotalReportResult.php @@ -14,12 +14,9 @@ */ class AssertCustomerOrderTotalReportResult extends AbstractAssertCustomerOrderReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert OrderTotalReport grid for all params diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php index 7d66a5cefe730..5705a052403c0 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertDownloadsReportResult.php @@ -15,12 +15,9 @@ */ class AssertDownloadsReportResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product info in report: product name, link title, sku, downloads number (Reports > Products > Downloads) diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php index 5ed497d6efce8..7562f5be5f154 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportIntervalResult.php @@ -13,12 +13,9 @@ */ class AssertInvoiceReportIntervalResult extends AbstractAssertInvoiceReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sales info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php index 61735bb586722..f09e7a50affa3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertInvoiceReportTotalResult.php @@ -13,12 +13,9 @@ */ class AssertInvoiceReportTotalResult extends AbstractAssertInvoiceReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that total invoice info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php index 199810bc32f93..ced870e865592 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertLowStockProductInGrid.php @@ -15,12 +15,9 @@ */ class AssertLowStockProductInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product with Low Stock is present in Low Stock grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php index bd6f24bfd7453..6631a8ece4db7 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertNewAccountsReportTotalResult.php @@ -14,12 +14,9 @@ */ class AssertNewAccountsReportTotalResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that new account total result is equals to data from dataSet diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php index 8e0b5576be2fa..83687af93e8f4 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertOrderedProductResult.php @@ -18,12 +18,9 @@ */ class AssertOrderedProductResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product name and qty in Ordered Products report diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php index 1f83b9c77a1fc..d5a216645c46e 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductInCartResult.php @@ -15,12 +15,9 @@ */ class AssertProductInCartResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in Products in Carts report grid by name, price, carts diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php index 7ccd652e8f8d4..a2f4ca35015a3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerInGrid.php @@ -19,12 +19,9 @@ */ class AssertProductReportByCustomerInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Customer review is displayed in grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php index f0b7973314819..14378862d84bb 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReportByCustomerNotInGrid.php @@ -19,12 +19,9 @@ */ class AssertProductReportByCustomerNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts Customer Product Review not available in grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php index 36d7e3836301f..5495e693b1969 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewIsAvailableForProduct.php @@ -17,12 +17,9 @@ */ class AssertProductReviewIsAvailableForProduct extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that review is visible in review grid for select product diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php index 8a3871a33d2f7..594ecd50ad655 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewReportIsVisibleInGrid.php @@ -15,12 +15,9 @@ */ class AssertProductReviewReportIsVisibleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Product Review Report is visible in reports grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php index d1db5751fb722..f83785a49b3fe 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductReviewsQtyByCustomer.php @@ -15,12 +15,9 @@ */ class AssertProductReviewsQtyByCustomer extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product reviews qty column in Review Report by Customer grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php index cd2d4364ee8b1..91f1b347c51d8 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertProductViewsReportTotalResult.php @@ -14,12 +14,9 @@ */ class AssertProductViewsReportTotalResult extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert product info in report: product name, price and views diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php index cc889537e6795..7594a817f428f 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertRefundReportIntervalResult.php @@ -14,12 +14,9 @@ */ class AssertRefundReportIntervalResult extends AbstractAssertSalesReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Credit Memo info in report: Refunds Orders, Total Refunded diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php index 670107a0b517b..50e3af977febb 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportIntervalResult.php @@ -14,12 +14,9 @@ */ class AssertSalesReportIntervalResult extends AbstractAssertSalesReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sales info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php index 8da6fd7c516f8..182e5b37b14a2 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSalesReportTotalResult.php @@ -14,12 +14,9 @@ */ class AssertSalesReportTotalResult extends AbstractAssertSalesReportResult { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that total sales info in report grid is actual diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php index b30f247001cb3..489cdee9895a4 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermReportForm.php @@ -15,12 +15,9 @@ */ class AssertSearchTermReportForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Search Term Report form data equals to passed from dataSet diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php index 3e0117c6cbe91..a0d6cf11102d3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertSearchTermsInGrid.php @@ -14,12 +14,9 @@ */ class AssertSearchTermsInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Search Terms report in grid diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php index d1217c71a596e..b52a73595d614 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportInGrid.php @@ -16,12 +16,9 @@ */ class AssertTaxReportInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert sales info in report: Tax, Rate, Orders, Tax Amount on tax report page diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php index 8247473c9df3b..c40d46f8dca27 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Constraint/AssertTaxReportNotInGrid.php @@ -16,12 +16,9 @@ */ class AssertTaxReportNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert Tax report is absent on tax report page diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml index 1766c3dfd88fa..a7f9b858f4cd3 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/Page/Adminhtml/ProductReportView.xml @@ -12,12 +12,12 @@ css selector - Magento\Reports\Test\Block\Adminhtml\Viewed\FilterGrid + Magento\Reports\Test\Block\Adminhtml\Review\Products\Viewed\ProductGrid .grid css selector - Magento\Reports\Test\Block\Adminhtml\Viewed\Filter + Magento\Sales\Test\Block\Adminhtml\Report\Filter\Form #filter_form css selector diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php index e808d05dc5b53..a7acfcfb81df5 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/AbandonedCartsReportEntityTest.php @@ -80,6 +80,7 @@ public function __inject( */ public function test($products, CustomerInjectable $customer) { + $this->markTestIncomplete('Bug: MAGETWO-31737'); // Precondition $products = $this->createProducts($products); $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php index ad5e499938fe6..3eb9432a53175 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/DownloadProductsReportEntityTest.php @@ -79,7 +79,6 @@ public function __inject( */ public function test(OrderInjectable $order, $downloads) { - $this->markTestIncomplete('MAGETWO-30346'); // Preconditions $order->persist(); $invoice = $this->objectManager->create('Magento\Sales\Test\TestStep\CreateInvoiceStep', ['order' => $order]); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv index d3b91c6d306ef..b99734c752820 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesCouponReportEntityTest/test.csv @@ -1,5 +1,5 @@ -"order/dataSet";"viewsReport/report_type";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_order_statuses";"viewsReport/order_statuses";"viewsReport/show_empty_rows";"viewsReport/price_rule_type";"viewsReport/rules_list";"constraint";"issue" -"with_coupon";"Order Created Date";"Year";"m/d/Y";"m/d/Y";"Any";"-";"No";"Any";"-";"assertCouponReportResult";"" -"with_coupon";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"Any";"-";"assertCouponReportResult";"" -"with_coupon";"Order Updated Date";"Day";"m/d/Y";"m/d/Y";"Any";"-";"No";"Specified";"%rule_name%";"assertCouponReportResult";"Bug: MAGETWO-28201" -"with_coupon";"Order Updated Date";"Day";"m/d/Y 12:00 a-1 day";"m/d/Y 12:00 a+1 day";"Specified";"Processing";"Yes";"Specified";"%rule_name%";"assertCouponReportResult";"Bug: MAGETWO-28201" +"order/dataSet";"viewsReport/report_type";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_order_statuses";"viewsReport/order_statuses";"viewsReport/show_empty_rows";"viewsReport/price_rule_type";"viewsReport/rules_list";"constraint" +"with_coupon";"Order Created Date";"Year";"m/d/Y";"m/d/Y";"Any";"-";"No";"Any";"-";"assertCouponReportResult" +"with_coupon";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"Any";"-";"assertCouponReportResult" +"with_coupon";"Order Updated Date";"Day";"m/d/Y";"m/d/Y";"Any";"-";"No";"Specified";"%rule_name%";"assertCouponReportResult" +"with_coupon";"Order Updated Date";"Day";"m/d/Y 12:00 a-1 day";"m/d/Y 12:00 a+1 day";"Specified";"Processing";"Yes";"Specified";"%rule_name%";"assertCouponReportResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv index 4f7347373f358..9870a0c150707 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesInvoiceReportEntityTest/test.csv @@ -1,4 +1,4 @@ -"order/dataSet";"order/data/price/preset";"invoiceReport/report_type";"invoiceReport/period_type";"invoiceReport/from";"invoiceReport/to";"invoiceReport/show_order_statuses";"invoiceReport/data/order_statuses";"invoiceReport/show_empty_rows";"constraint";"issue" -"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"-";"Yes";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult";"Bug: MAGETWO-29383" -"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"-";"No";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult";"" -"default";"full_invoice";"Last Invoice Created Date";"Day";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult";"" +"order/dataSet";"order/data/price/preset";"invoiceReport/report_type";"invoiceReport/period_type";"invoiceReport/from";"invoiceReport/to";"invoiceReport/show_order_statuses";"invoiceReport/data/order_statuses";"invoiceReport/show_empty_rows";"constraint" +"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"-";"Yes";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult" +"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"-";"No";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult" +"default";"full_invoice";"Last Invoice Created Date";"Day";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"assertInvoiceReportIntervalResult, assertInvoiceReportTotalResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv index e5dab82b29e18..8503c9d896de0 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesOrderReportEntityTest/test.csv @@ -1,4 +1,4 @@ -"order/dataSet";"order/data/price/preset";"salesReport/report_type";"salesReport/period_type";"salesReport/from";"salesReport/to";"salesReport/show_order_statuses";"salesReport/order_statuses";"salesReport/show_empty_rows";"salesReport/show_actual_columns";"constraint";"issue" -"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"-";"Yes";"Yes";"assertSalesReportIntervalResult, assertSalesReportTotalResult";";"Bug: MAGETWO-29383" -"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"-";"No";"No";"assertSalesReportIntervalResult, assertSalesReportTotalResult";"" -"default";"full_invoice";"Order Updated Date";"Day";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"No";"assertSalesReportIntervalResult, assertSalesReportTotalResult";"" +"order/dataSet";"order/data/price/preset";"salesReport/report_type";"salesReport/period_type";"salesReport/from";"salesReport/to";"salesReport/show_order_statuses";"salesReport/order_statuses";"salesReport/show_empty_rows";"salesReport/show_actual_columns";"constraint" +"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"-";"Yes";"Yes";"assertSalesReportIntervalResult, assertSalesReportTotalResult" +"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"-";"No";"No";"assertSalesReportIntervalResult, assertSalesReportTotalResult" +"default";"full_invoice";"Order Updated Date";"Day";"m/d/Y";"m/d/Y";"Specified";"Processing";"No";"No";"assertSalesReportIntervalResult, assertSalesReportTotalResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv index f25229d78431f..74fb07c3a15fd 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesRefundsReportEntityTest/test.csv @@ -1,4 +1,4 @@ -"description";"order/dataSet";"order/data/price/preset";"refundsReport/report_type";"refundsReport/period_type";"refundsReport/from";"refundsReport/to";"refundsReport/show_order_statuses";"refundsReport/show_empty_rows";"constraint";"issue" -"assert refunds year report";"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"Yes";"assertRefundReportIntervalResult";"MAGETWO-29383" -"assert refunds month report";"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"No";"assertRefundReportIntervalResult";"" -"assert refund Daily report";"default";"full_invoice";"Last Credit Memo Created Date";"Day";"m/d/Y";"m/d/Y";"Specified";"No";"assertRefundReportIntervalResult";"" +"description";"order/dataSet";"order/data/price/preset";"refundsReport/report_type";"refundsReport/period_type";"refundsReport/from";"refundsReport/to";"refundsReport/show_order_statuses";"refundsReport/show_empty_rows";"constraint" +"assert refunds year report";"default";"full_invoice";"Order Created Date";"Year";"m/d/Y 12:00 a-2 days";"m/d/Y 12:00 a+2 days";"Any";"Yes";"assertRefundReportIntervalResult" +"assert refunds month report";"default";"full_invoice";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Any";"No";"assertRefundReportIntervalResult" +"assert refund Daily report";"default";"full_invoice";"Last Credit Memo Created Date";"Day";"m/d/Y";"m/d/Y";"Specified";"No";"assertRefundReportIntervalResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php index f022023a386ed..21bd43ea2c6d5 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest.php @@ -143,16 +143,14 @@ public function __inject( * @param OrderInjectable $order * @param TaxRule $taxRule * @param array $report - * @param string $orderStatus - * @param string $invoice + * @param string $orderSteps * @return void */ public function test( OrderInjectable $order, TaxRule $taxRule, array $report, - $orderStatus, - $invoice + $orderSteps ) { // Precondition $taxRule->persist(); @@ -160,13 +158,7 @@ public function test( $order->persist(); $this->orderIndex->open(); $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - if ($orderStatus !== 'Pending') { - $createInvoice = $this->objectManager->create( - 'Magento\Sales\Test\TestStep\CreateInvoiceStep', - ['order' => $order, 'data' => $invoice] - ); - $createInvoice->run(); - } + $this->processOrder($orderSteps, $order); $this->reportStatistic->open(); $this->reportStatistic->getGridBlock()->massaction( [['report' => 'Tax']], @@ -180,6 +172,27 @@ public function test( $this->salesTaxReport->getActionBlock()->showReport(); } + /** + * Process order to corresponded status. + * + * @param string $orderSteps + * @param OrderInjectable $order + * @return void + */ + protected function processOrder($orderSteps, OrderInjectable $order) + { + if (!$orderSteps) { + return; + } + $orderStatus = explode(',', $orderSteps); + foreach ($orderStatus as $orderStep) { + $this->objectManager->create( + 'Magento\Sales\Test\TestStep\\Create' . ucfirst(trim($orderStep)) . 'Step', + ['order' => $order] + )->run(); + } + } + /** * Delete all tax rules after test. * diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv index 733b7a871cd84..615e27ca04b68 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/SalesTaxReportEntityTest/test.csv @@ -1,4 +1,4 @@ -"taxRule/dataSet";"order/dataSet";"orderStatus";"report/report_type";"report/period_type";"report/from";"report/to";"report/show_order_statuses";"report/order_statuses";"report/show_empty_rows";"invoice/do_shipment";"taxAmount";"constraint";"issue" -"custom_rule";"default";"Pending";"Order Created Date";"Day";"m/d/Y";"m/d/Y";"Any";"-";"-";"No";"$46.20";"assertTaxReportNotInGrid";"" -"custom_rule";"default";"Processing";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Specified";"Processing";"-";"No";"$46.20";"assertTaxReportInGrid";"" -"custom_rule";"default";"Complete";"Order Updated Date";"Year";"m/d/Y";"m/d/Y";"Specified";"Complete";"Yes";"Yes";"$46.20";"assertTaxReportInGrid";"Bug: MAGETWO-28611" +"orderSteps";"taxRule/dataSet";"order/dataSet";"orderStatus";"report/report_type";"report/period_type";"report/from";"report/to";"report/show_order_statuses";"report/order_statuses";"report/show_empty_rows";"invoice/do_shipment";"taxAmount";"constraint";"issue" +"";"custom_rule";"default";"Pending";"Order Created Date";"Day";"m/d/Y";"m/d/Y";"Any";"-";"-";"No";"$46.20";"assertTaxReportNotInGrid";"" +"invoice";"custom_rule";"default";"Processing";"Order Created Date";"Month";"m/d/Y";"m/d/Y";"Specified";"Processing";"-";"No";"$46.20";"assertTaxReportInGrid";"" +"invoice,shipment";"custom_rule";"default";"Complete";"Order Updated Date";"Year";"m/d/Y";"m/d/Y";"Specified";"Complete";"Yes";"Yes";"$46.20";"assertTaxReportInGrid";"BUG: MAGETWO-29383" 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 77ab7cdba8d7f..d9e2df96f8ed1 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 @@ -5,10 +5,11 @@ namespace Magento\Reports\Test\TestCase; -use Magento\Reports\Test\Page\Adminhtml\ProductReportView; use Mtf\Client\Browser; -use Mtf\Fixture\FixtureFactory; use Mtf\TestCase\Injectable; +use Mtf\Fixture\FixtureFactory; +use Magento\Reports\Test\Page\Adminhtml\ProductReportView; +use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex; /** * Test Creation for ViewedProductsReportEntity @@ -52,6 +53,18 @@ class ViewedProductsReportEntityTest extends Injectable */ protected $browser; + /** + * Delete all products + * + * @param CatalogProductIndex $catalogProductIndexPage + * @return void + */ + public function __prepare(CatalogProductIndex $catalogProductIndexPage) + { + $catalogProductIndexPage->open(); + $catalogProductIndexPage->getProductGrid()->massaction([], 'Delete', true, 'Select All'); + } + /** * Inject pages * @@ -80,7 +93,6 @@ public function __inject( */ public function test($products, array $viewsReport, $total) { - $this->markTestIncomplete('MAGETWO-15707'); // Preconditions $productsList = $this->prepareProducts($products); $this->openProducts($productsList, $total); diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv index 390345cb8208f..fd637ffda83b6 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest/test.csv @@ -1,4 +1,4 @@ "description";"total";"products";"viewsReport/period_type";"viewsReport/from";"viewsReport/to";"viewsReport/show_empty_rows";"constraint" "view products on front and verify they all reflected in Year report";"2, 1";"catalogProductSimple::default, catalogProductVirtual::default";"Year";"m/d/Y -1 year";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Month report";"1, 1";"downloadableProductInjectable::default, catalogProductBundle::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" -"view products on front and verify they all reflected in Day report";"1, 1";"configurableProductInjectable::default, catalogProductGrouped::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Month report";"1, 1";"downloadableProductInjectable::default, bundleProduct::bundle_dynamic_product";"Month";"m/d/Y";"m/d/Y";"No";"assertProductViewsReportTotalResult" +"view products on front and verify they all reflected in Day report";"1, 1";"configurableProductInjectable::default, groupedProductInjectable::default";"Day";"m/d/Y -1 day";"m/d/Y +1 day";"Yes";"assertProductViewsReportTotalResult" diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml index 12d41c877d45a..265b5217ffac2 100644 --- a/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Reports/Test/etc/constraint.xml @@ -6,78 +6,78 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml index c00979849ac9d..21db32b88fed9 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\Review\Test\Block\Adminhtml\Customer\Edit\Tab\Reviews - #customer_info_tabs_reviews + #tab_reviews css selector diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php index 8e2d9b1c2e920..c2983dbc7d95c 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Block/Adminhtml/ReviewsTab.php @@ -18,7 +18,7 @@ class ReviewsTab extends Tab * * @var string */ - protected $reviews = '#Product_Reviews'; + protected $reviews = '#reviwGrid'; /** * Returns product reviews grid diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php index a4040a184462a..050c2d10f281e 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInGrid.php @@ -14,12 +14,9 @@ */ class AssertProductRatingInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert product Rating availability in product Rating grid diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php index a491693e25011..66b26ef9c4d13 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingInProductPage.php @@ -18,12 +18,9 @@ */ class AssertProductRatingInProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product rating is displayed on product review(frontend) diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php index cbbaf0b30502d..23cf3f3a88ae1 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertProductRatingNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert product Rating is absent on product Rating grid diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php index 5bc7c81fa2838..43c3cf191fc62 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingNotInProductPage.php @@ -16,12 +16,9 @@ */ class AssertProductRatingNotInProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product rating is not displayed on frontend on product review diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php index a0e657f29f421..4f3e23a8338ea 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingOnReviewPage.php @@ -15,12 +15,9 @@ */ class AssertProductRatingOnReviewPage extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product rating is displayed on product review(backend) 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 a138f6038a5ae..62490decee02b 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertProductRatingSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the rating.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the rating.'; /** * Assert that success message is displayed after rating delete 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 b2be0173d951c..db1fb17ba36ae 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductRatingSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertProductRatingSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the rating.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the rating.'; /** * Assert that success message is displayed after rating save 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 b7bfe5a5ebf6e..fad1e066f90dd 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 @@ -14,18 +14,15 @@ */ class AssertProductReviewBackendSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Text of success message after review created */ const SUCCESS_MESSAGE = 'You saved the review.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Assert that success message is displayed after review created * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php index 32bbc3723eb44..b83eeecf9381f 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGrid.php @@ -16,12 +16,9 @@ */ class AssertProductReviewInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Filter params diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php index a59b875ab0e77..f135712301a99 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewInGridOnCustomerPage.php @@ -18,12 +18,9 @@ */ class AssertProductReviewInGridOnCustomerPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts all Product Review variables in the reviews grid on customer page 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 df39cca65f837..811356bb59764 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 @@ -15,18 +15,15 @@ */ class AssertProductReviewMassActionSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message that appears after deletion via mass actions */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) have been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after deletion via mass actions * 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 fab20856815fd..85dda0cdc5a16 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 @@ -15,18 +15,15 @@ */ class AssertProductReviewMassActionSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message that appears after updates via mass actions */ const SUCCESS_MESSAGE = 'A total of %d record(s) have been updated.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after updated via mass actions * diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php index aa96f23a1380c..d60bd2d1f823c 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotInGrid.php @@ -16,12 +16,9 @@ */ class AssertProductReviewNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Filter params diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php index 7776da4c89cd7..e5a3ae3b556ec 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewNotOnProductPage.php @@ -17,12 +17,9 @@ */ class AssertProductReviewNotOnProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product review Not available on product page diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php index 5bff591d0208d..7ff7a616b380b 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertProductReviewOnProductPage.php @@ -18,12 +18,9 @@ */ class AssertProductReviewOnProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that product review available on product page 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 1093c4e23528e..c7fc83dedb5c5 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php @@ -13,18 +13,15 @@ */ class AssertReviewCreationSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text of success message after review created */ const SUCCESS_MESSAGE = 'Your review has been accepted for moderation.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success message is displayed after review created * 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 1316973c66562..1f65a344f5fb1 100755 --- a/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertReviewSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the review.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the review.'; /** * Assert that success message is displayed after review save diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml index 5174b9ce6d7f3..fa4d771db01fb 100644 --- a/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Review/Test/etc/constraint.xml @@ -6,63 +6,63 @@ --> - high + high - high + high - middle + middle - middle + middle - middle + middle - middle + middle - high + high - high + high - low + low - middle + middle - middle + middle - high + high - high + high - middle + middle - middle + middle - middle + middle - low + low - low + low \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Adminhtml/Edit/CustomerForm.xml index 49594edd6b181..41ac57ea76c0b 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\Reward\Test\Block\Adminhtml\Edit\Tab\Reward - #customer_info_tabs_customer_edit_tab_reward + #tab_customer_edit_tab_reward css selector reward diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Customer/RewardPoints/RewardPointsInformation.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Customer/RewardPoints/RewardPointsInformation.php index ffc0c8e4f7a5a..e21ad425b9c23 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Customer/RewardPoints/RewardPointsInformation.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Block/Customer/RewardPoints/RewardPointsInformation.php @@ -34,7 +34,8 @@ class RewardPointsInformation extends Block */ public function getRewardPointsRates() { - return $this->_rootElement->find($this->rewardRatesSelector)->getText(); + $rates = $this->_rootElement->find($this->rewardRatesSelector)->getText(); + return trim(preg_replace('/\s+/', ' ', $rates)); } /** diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRateSuccessSaveMessage.php index 151eb906afa63..2ea437c7f27bd 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRateSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRateSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertRateSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message after success saved Exchange Rate */ const SUCCESS_SAVE_MESSAGE = 'You saved the rate.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that specified message is present on page * diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardInHistoryGrid.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardInHistoryGrid.php index 34ac9b963bde8..d6ace74e69249 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardInHistoryGrid.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardInHistoryGrid.php @@ -18,12 +18,9 @@ */ class AssertRewardInHistoryGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after updating reward balance - it reflects in history grid: check Points, Website, Comment diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForCurrencyToPoints.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForCurrencyToPoints.php index 92b2aa8696b61..42f77a3e9baff 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForCurrencyToPoints.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForCurrencyToPoints.php @@ -20,12 +20,9 @@ */ class AssertRewardNoExchangeMessageForCurrencyToPoints extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that "Each $X spent will earn X Reward points" message is not displayed on the RewardCustomerInfo page. diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForPointsToCurrency.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForPointsToCurrency.php index 5f6e2776193a9..e84b96e0e853e 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForPointsToCurrency.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardNoExchangeMessageForPointsToCurrency.php @@ -19,12 +19,9 @@ */ class AssertRewardNoExchangeMessageForPointsToCurrency extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Each X Reward points can be redeemed for $X message is not displayed on the RewardCustomerInfo page. diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsBalance.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsBalance.php index 871d92d218797..7351b25540b3e 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsBalance.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsBalance.php @@ -19,6 +19,10 @@ */ class AssertRewardPointsBalance extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Messages about reward points balance */ @@ -27,14 +31,7 @@ class AssertRewardPointsBalance extends AbstractConstraint /** * Message about reward points exchange rate */ - const REWARD_POINTS_EXCHANGE_RATE = 'Current exchange rates: Each %d Reward points can be redeemed for $%.2f.'; - - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const REWARD_POINTS_EXCHANGE_RATE = 'Current exchange rates: %d Reward points = $%.2f'; /** * Assert that "Your balance is X Reward points ($X.00)." and current exchange message are appeared diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnCustomerRegistration.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnCustomerRegistration.php index af039d565ebd5..ebe04a975c39b 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnCustomerRegistration.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnCustomerRegistration.php @@ -15,18 +15,15 @@ */ class AssertRewardPointsMessageOnCustomerRegistration extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message about reward points on registration page */ const REGISTRATION_REWARD_MESSAGE = 'Register on our site now and earn %d Reward points.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that reward points message is appeared on the Create New Customer Account page * diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnShoppingCart.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnShoppingCart.php index a65a7b2e51e57..f12b4b79f6cb4 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnShoppingCart.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsMessageOnShoppingCart.php @@ -17,18 +17,15 @@ */ class AssertRewardPointsMessageOnShoppingCart extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message about reward points on checkout page */ const CHECKOUT_REWARD_MESSAGE = 'Check out now and earn %d Reward points for this order.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that reward points message is displayed on shopping cart page * diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessDeleteMessage.php index 45f51f540d42b..27c2d8ab2c684 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertRewardPointsSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message about successful deletion reward exchange rate */ const SUCCESS_DELETE_MESSAGE = 'You deleted the rate.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Asserts that success delete message equals to expected message * diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessRemoveMessage.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessRemoveMessage.php index 51f8255d67104..7870b683ec721 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessRemoveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardPointsSuccessRemoveMessage.php @@ -14,18 +14,15 @@ */ class AssertRewardPointsSuccessRemoveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after remove reward points */ const SUCCESS_REMOVE_MESSAGE = 'You removed the reward points from this order.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after remove reward points successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionOnBackend.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionOnBackend.php index 8fe80f39d7ace..e874abc9ff03d 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionOnBackend.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionOnBackend.php @@ -17,12 +17,9 @@ */ class AssertRewardSubscriptionOnBackend extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that customer reward subscriptions checkboxes are empty diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionSaveMessage.php b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionSaveMessage.php index 057ea51f550fe..6e5ec953c2607 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/Constraint/AssertRewardSubscriptionSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertRewardSubscriptionSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'You saved the settings.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_SAVE_MESSAGE = 'You saved the settings.'; /** * Assert that reward points subscription settings success save message is present on page diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/CreateExchangeRateForRewardPointsEntityTest.php b/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/CreateExchangeRateForRewardPointsEntityTest.php index 48c73d83e7724..57ac4fd519770 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/CreateExchangeRateForRewardPointsEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/CreateExchangeRateForRewardPointsEntityTest.php @@ -91,19 +91,13 @@ public function __inject( * @param CustomerInjectable $customer * @param ConfigData $config * @param ConfigData $configRollback - * @param string $registrationReward - * @param string $checkoutReward * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function test( RewardRate $rate, CustomerInjectable $customer, ConfigData $config, - ConfigData $configRollback, - $registrationReward, - $checkoutReward + ConfigData $configRollback ) { // Precondition $this->configRollback = $configRollback; diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/RemoveRewardPointsOnCheckoutTest.php b/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/RemoveRewardPointsOnCheckoutTest.php index 4c68780865514..673d278c39da1 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/RemoveRewardPointsOnCheckoutTest.php +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/TestCase/RemoveRewardPointsOnCheckoutTest.php @@ -129,10 +129,6 @@ public function __prepare( $this->fixtureFactory = $fixtureFactory; $product = $fixtureFactory->createByCode('catalogProductSimple'); $product->persist(); - $rewardRate = $fixtureFactory->createByCode('rewardRate', ['dataSet' => 'rate_1_point_to_1_currency']); - $rewardRate->persist(); - $rewardRate = $fixtureFactory->createByCode('rewardRate', ['dataSet' => 'rate_1_currency_to_1_point']); - $rewardRate->persist(); return ['product' => $product]; } @@ -162,6 +158,11 @@ public function __inject( $this->checkoutCart = $checkoutCart; $this->checkoutOnepage = $checkoutOnepage; $this->customerAccountLogout = $customerAccountLogout; + // TODO: Move creation of reward rates to "__prepare" method after fix bug MAGETWO-29331 + $rewardRate = $this->fixtureFactory->createByCode('rewardRate', ['dataSet' => 'rate_1_point_to_1_currency']); + $rewardRate->persist(); + $rewardRate = $this->fixtureFactory->createByCode('rewardRate', ['dataSet' => 'rate_1_currency_to_1_point']); + $rewardRate->persist(); } /** @@ -185,8 +186,6 @@ public function test( array $payment, $rewardPoints ) { - $this->markTestIncomplete("Bug: MAGETWO-30435"); - // Preconditions $customer->persist(); $reward = $this->fixtureFactory->createByCode( @@ -225,15 +224,8 @@ public function test( public function tearDown() { $this->customerAccountLogout->open(); - } - /** - * Delete reward exchange rates - * - * @return void - */ - public static function tearDownAfterClass() - { + // TODO: Move deletion of reward rates to "tearDownAfterClass" method after fix bug MAGETWO-29331 self::$rewardRateIndexPage->open(); while (self::$rewardRateIndexPage->getRewardRateGrid()->isFirstRowVisible()) { self::$rewardRateIndexPage->getRewardRateGrid()->openFirstRow(); diff --git a/dev/tests/functional/tests/app/Magento/Reward/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Reward/Test/etc/constraint.xml index 677f281646416..82e5bcf86f2ef 100644 --- a/dev/tests/functional/tests/app/Magento/Reward/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Reward/Test/etc/constraint.xml @@ -6,13 +6,13 @@ --> - low + low - low + low @@ -23,7 +23,7 @@ - low + low @@ -34,13 +34,13 @@ - low + low - low + low @@ -49,20 +49,20 @@ - high + high - high + high - low + low @@ -73,7 +73,7 @@ - low + low @@ -81,7 +81,7 @@ - low + low @@ -90,7 +90,7 @@ - high + high diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaForm.php b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaForm.php index 1466a87d581c4..10b657d6b75bb 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaForm.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaForm.php @@ -18,12 +18,9 @@ */ class AssertRmaForm extends AbstractAssertForm { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Array skipped fields. diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaInGrid.php b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaInGrid.php index cafe2e2fd5c5c..4fa732a3f2001 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaInGrid.php @@ -16,12 +16,9 @@ */ class AssertRmaInGrid extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that return request displayed in Returns grid: diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForCustomer.php b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForCustomer.php index 3b04ac3eb8f0c..f90931bfac0ba 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForCustomer.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForCustomer.php @@ -18,12 +18,9 @@ */ class AssertRmaOnFrontendForCustomer extends AbstractAssertRmaOnFrontend { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that rma is correct display on frontend (MyAccount - My Returns): diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForGuest.php b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForGuest.php index f44d3ceb2d13b..5a0bf56c4a0bf 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForGuest.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaOnFrontendForGuest.php @@ -16,12 +16,9 @@ */ class AssertRmaOnFrontendForGuest extends AbstractAssertRmaOnFrontend { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'middle'; + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ /** * Assert that rma is correct display for guest on frontend (Orders and Returns): @@ -47,7 +44,7 @@ public function processAssert( ['order' => $order] )->run(); - $salesGuestView->getViewBlock()->clickLink('Returns'); + $salesGuestView->getViewBlock()->openLinkByName('Returns'); $fixtureRmaStatus = $rma->getStatus(); $pageRmaData = $rmaGuestIndex->getReturnsBlock()->getRmaRow($rma)->getData(); \PHPUnit_Framework_Assert::assertEquals( diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaSuccessSaveMessage.php index 6bc55e0031d42..85b7644f6bd74 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/Constraint/AssertRmaSuccessSaveMessage.php @@ -13,18 +13,15 @@ */ class AssertRmaSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Rma success save message. */ const SUCCESS_SAVE_MESSAGE = 'You submitted the RMA request.'; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'middle'; - /** * Assert success message appears after submitting new return request. * diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/Fixture/ReturnItem.php b/dev/tests/functional/tests/app/Magento/Rma/Test/Fixture/ReturnItem.php index 545f0076916d5..eeb2fee6f93d1 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/Fixture/ReturnItem.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/Fixture/ReturnItem.php @@ -50,7 +50,7 @@ protected function _initData() 'value' => '', ], 'find_order_by' => [ - 'value' => 'Email Address', + 'value' => 'Email', ], 'email_address' => [ 'value' => '', diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/CreateRmaEntityOnBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/CreateRmaEntityOnBackendTest/test.csv index 37936895c9eb3..15236e8954db8 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/CreateRmaEntityOnBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/CreateRmaEntityOnBackendTest/test.csv @@ -1,5 +1,5 @@ -"rma/data/order_id/preset";"rma/data/order_id/data/customer_id/dataSet";"rma/data/order_id/data/entity_id/products";"rma/data/items/data/0/qty_requested";"rma/data/items/data/0/reason";"rma/data/items/data/0/reason_other";"rma/data/items/data/0/condition";"rma/data/items/data/0/resolution";"rma/data/contact_email";"rma/data/comment/comment";"rma/data/comment/is_visible_on_front";"rma/data/status";"constraint";"issue" -"default";"default";"catalogProductSimple::default";"1";"Wrong Size";"-";"Damaged";"Exchange";"test%isolation%@example.com";"comments %isolation%";"Yes";"Pending";"assertRmaInGrid, assertRmaForm, assertRmaOnFrontendForCustomer";"" -"default";"default";"configurableProductInjectable::default";"1";"Wrong Color";"-";"Opened";"Refund";"test%isolation%@example.com";"comments %isolation%";"No";"Pending";"assertRmaInGrid, assertRmaConfigurableForm, assertRmaConfigurableOnFrontendForCustomer";"" -"default";"default";"bundleProduct::bundle_fixed_product";"1";"Out of Service";"-";"Unopened";"Store Credit";"test%isolation%@example.com";"comments %isolation%";"Yes";"Pending";"assertRmaInGrid, assertRmaBundleOnFrontendForCustomer";"" -"default";"default";"catalogProductSimple::default";"1";"Other";"Other %isolation%";"Unopened";"Exchange";"test%isolation%@example.com";"comments %isolation%";"Yes";"Pending";"assertRmaInGrid, assertRmaOnFrontendForGuest";"Bug: MAGETWO-29552" +"rma/data/order_id/preset";"rma/data/order_id/data/customer_id/dataSet";"rma/data/order_id/data/entity_id/products";"rma/data/items/data/0/qty_requested";"rma/data/items/data/0/reason";"rma/data/items/data/0/reason_other";"rma/data/items/data/0/condition";"rma/data/items/data/0/resolution";"rma/data/contact_email";"rma/data/comment/comment";"rma/data/comment/is_visible_on_front";"rma/data/status";"constraint" +"default";"default";"catalogProductSimple::default";"1";"Wrong Size";"-";"Damaged";"Exchange";"test%isolation%@example.com";"comments %isolation%";"Yes";"Pending";"assertRmaInGrid, assertRmaForm, assertRmaOnFrontendForCustomer" +"default";"default";"configurableProductInjectable::default";"1";"Wrong Color";"-";"Opened";"Refund";"test%isolation%@example.com";"comments %isolation%";"No";"Pending";"assertRmaInGrid, assertRmaConfigurableForm, assertRmaConfigurableOnFrontendForCustomer" +"default";"default";"bundleProduct::bundle_fixed_product";"1";"Out of Service";"-";"Unopened";"Store Credit";"test%isolation%@example.com";"comments %isolation%";"Yes";"Pending";"assertRmaInGrid, assertRmaBundleOnFrontendForCustomer" +"default";"default";"catalogProductSimple::default";"1";"Other";"Other %isolation%";"Unopened";"Exchange";"test%isolation%@example.com";"comments %isolation%";"Yes";"Pending";"assertRmaInGrid, assertRmaOnFrontendForGuest" diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/RmaTest.php b/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/RmaTest.php index 96f0df2594fde..681db07f80498 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/RmaTest.php +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/TestCase/RmaTest.php @@ -44,8 +44,7 @@ public function testRma() $searchForm->submit(); // Step 5: Click "Return" link - $viewBlock = Factory::getPageFactory()->getSalesGuestView()->getViewBlock(); - $viewBlock->clickLink('Return'); + Factory::getPageFactory()->getSalesGuestView()->getActionsToolbar()->clickLink('Return'); // Steps 6 - 9: $returnId = $this->createRma($returnItem, $payPalExpressOrder); diff --git a/dev/tests/functional/tests/app/Magento/Rma/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Rma/Test/etc/constraint.xml index cbba8c868ea87..84a7c159b275e 100644 --- a/dev/tests/functional/tests/app/Magento/Rma/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Rma/Test/etc/constraint.xml @@ -6,27 +6,27 @@ --> - high + high - low + low - middle + middle - middle + middle - high + high - middle + middle - middle + middle - high + high diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php index 761e3a8936e33..355bdef0c473c 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/AbstractForm.php @@ -25,7 +25,7 @@ abstract class AbstractForm extends Form * * @var string */ - protected $loader = '#loading_mask_loader'; + protected $loader = '[data-role="loader"]'; /** * Fill form data diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Info/Buttons.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View/ActionsToolbar.php similarity index 53% rename from dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Info/Buttons.php rename to dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View/ActionsToolbar.php index b48213a3076b3..d1e49fb25fa47 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/Info/Buttons.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Order/View/ActionsToolbar.php @@ -3,7 +3,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Sales\Test\Block\Order\Info; +namespace Magento\Sales\Test\Block\Order\View; use Mtf\Block\Block; use Mtf\Client\Element\Locator; @@ -11,21 +11,14 @@ /** * Order view block. */ -class Buttons extends Block +class ActionsToolbar extends Block { - /** - * Selector for "Print Order" link. - * - * @var string - */ - protected $printOrderSelector = '.action.print'; - /** * Link selector. * * @var string */ - protected $linkSelector = '//div[contains(@class, "order-actions-toolbar")]//span[contains(text(), "%s")]'; + protected $linkSelector = './/a[contains(@class, "action")]//span[contains(text(), "%s")]'; /** * Click link on this page. @@ -38,14 +31,4 @@ public function clickLink($linkName) } $link->click(); } - - /** - * Click on "Print Order" link. - * - * @return void - */ - public function clickPrintOrder() - { - $this->_rootElement->find($this->printOrderSelector)->click(); - } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Widget/Guest/Form.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Widget/Guest/Form.php index ade2c1ebf3bdb..0965eafbcf4a5 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Widget/Guest/Form.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Widget/Guest/Form.php @@ -51,7 +51,7 @@ public function fill(FixtureInterface $fixture, Element $element = null, $isSear ]; if ($isSearchByEmail) { - $data['find_order_by'] = 'Email Address'; + $data['find_order_by'] = 'Email'; $data['email_address'] = $customer->getEmail(); } else { $data['find_order_by'] = 'ZIP Code'; diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php index 6bd378142ea61..5fd4edeb0fce6 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoButton.php @@ -16,12 +16,9 @@ */ class AssertCreditMemoButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that 'Credit Memo' button is present on order's page diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php index e0f1d607a516a..cc35b869a4321 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertCreditMemoItems.php @@ -15,12 +15,9 @@ */ class AssertCreditMemoItems extends AbstractAssertItems { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert credit memo items on credit memo view page diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php index b71eeff1d8bdf..81d456687301c 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesGrid.php @@ -15,12 +15,9 @@ */ class AssertInvoiceInInvoicesGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert invoice with corresponding order ID is present in the invoices grid with corresponding amount diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php index 79261d1e49acb..d4c5694227655 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php @@ -17,12 +17,9 @@ */ class AssertInvoiceInInvoicesTab extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that invoice is present in the invoices tab of the order with corresponding amount(Grand Total) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php index 5f7144c5912e7..c7fbe84aa3b37 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoiceItems.php @@ -15,12 +15,9 @@ */ class AssertInvoiceItems extends AbstractAssertItems { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert invoice items on invoice view page 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 d131a3dfbb061..8206e7eaae71d 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 @@ -14,18 +14,15 @@ */ class AssertInvoiceSuccessCreateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_CREATE_MESSAGE = 'The invoice has been created.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message present after create invoice * 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 b5cde5b62a33c..cd449db40f2a0 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 @@ -14,18 +14,15 @@ */ class AssertInvoiceWithShipmentSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You created the invoice and shipment.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert success message presents * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php index b5e0208be196a..e3fb1df7948fb 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertInvoicedAmountOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertInvoicedAmountOnFrontend extends AbstractAssertOrderOnFrontend { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that invoiced Grand Total amount is equal to placed order Grand total amount on invoice page (frontend) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php index 8c2162be29f8b..4ae5a4064758a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoCreditMemoButton.php @@ -16,12 +16,9 @@ */ class AssertNoCreditMemoButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after refunding full amount 'Credit Memo' is not available any more diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php index 7f0b6cdbcc155..b1033dc4090a3 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertNoInvoiceButton.php @@ -16,12 +16,9 @@ */ class AssertNoInvoiceButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert no Invoice button the order grid diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php index f67fb515cb6a8..8e869beca3967 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsAvailable.php @@ -14,12 +14,9 @@ */ class AssertOrderButtonsAvailable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that specified in data set buttons exist on order page in backend diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php index ce499476d8e2e..0289645ddae1a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderButtonsUnavailable.php @@ -16,12 +16,9 @@ */ class AssertOrderButtonsUnavailable extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that buttons from dataSet are not present on page 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 794b28b63fe49..5f1f0b5d0da7c 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 @@ -14,18 +14,15 @@ */ class AssertOrderCancelMassActionFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const FAIL_CANCEL_MESSAGE = 'You cannot cancel the order(s).'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert cancel fail message is displayed on order index page * 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 1c2d14f3bc2d1..6000f81f90aee 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 @@ -14,18 +14,15 @@ */ class AssertOrderCancelMassActionSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_CANCEL_MESSAGE = 'We canceled %d order(s).'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert cancel success message is displayed on order index page * 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 79fdaa0235305..ccaccec1462c6 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 @@ -14,18 +14,15 @@ */ class AssertOrderCancelSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after cancel sales order */ const SUCCESS_CANCEL_MESSAGE = 'You canceled the order.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after cancel sales order successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php index a918204c9dfda..6c5fd44e89f17 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderGrandTotal.php @@ -14,12 +14,9 @@ */ class AssertOrderGrandTotal extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that Order Grand Total is correct on order page in backend diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php index ae3ceedbfffc9..ba38d09c704e8 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php @@ -15,12 +15,9 @@ */ class AssertOrderInOrdersGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order with fixture data is present in Sales -> Orders Grid diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php index 404e865c56318..d306db2545dab 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php @@ -18,12 +18,9 @@ */ class AssertOrderInOrdersGridOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order is present in Orders grid on frontend 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 674833b9cbeff..5067162e0e70a 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 @@ -14,18 +14,15 @@ */ class AssertOrderMassOnHoldSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_ON_HOLD_MESSAGE = 'You have put %d order(s) on hold.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert on hold success message is displayed on order index page * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php index b08ab15c25c76..eaa43a0698407 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotInOrdersGrid.php @@ -15,12 +15,9 @@ */ class AssertOrderNotInOrdersGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order with fixture data in not more in the Orders grid diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php index 9f1df5ee16c7c..c1ab57a2c3a83 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderNotVisibleOnMyAccount.php @@ -18,12 +18,9 @@ */ class AssertOrderNotVisibleOnMyAccount extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert order is not visible in customer account on frontend 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 c2a036770ed83..50d3bb40e57f5 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 @@ -14,18 +14,15 @@ */ class AssertOrderOnHoldFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const FAIL_ON_HOLD_MESSAGE = 'No order(s) were put on hold.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert on hold fail message is displayed on order index page * 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 555fb7bb0cece..0506a299486d4 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 @@ -14,6 +14,10 @@ */ class AssertOrderOnHoldSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked for single order on hold */ @@ -24,13 +28,6 @@ class AssertOrderOnHoldSuccessMessage extends AbstractConstraint */ const MULTIPLE_SUCCESS_ON_HOLD_MESSAGE = 'You have put %d order(s) on hold.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert on hold success message is displayed on order index page * 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 f74d71b8731c5..2809a61b59da9 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 @@ -14,18 +14,15 @@ */ class AssertOrderReleaseFailMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const FAIL_RELEASE_MESSAGE = 'No order(s) were released from on hold status.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert release fail message is displayed on order index page * 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 8c7358c5ee1ad..36d5735b1d8ce 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 @@ -14,18 +14,15 @@ */ class AssertOrderReleaseSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_RELEASE_MESSAGE = '%d order(s) have been released from on hold status.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert release success message is displayed on order index page * 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 05f1bd9dfd4a4..62dce1b4ebb4d 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 @@ -14,14 +14,11 @@ */ class AssertOrderStatusDuplicateStatus extends AbstractConstraint { - const DUPLICATE_MESSAGE = 'We found another order status with the same order status code.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const DUPLICATE_MESSAGE = 'We found another order status with the same order status code.'; /** * Assert that duplicate message is displayed diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php index aebf4e781cc51..5b8b9561c4ffe 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusInGrid.php @@ -15,12 +15,9 @@ */ class AssertOrderStatusInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Order status state data mapping diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php index 764758fb3e6ca..5913e5fa97fad 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php @@ -15,12 +15,9 @@ */ class AssertOrderStatusIsCorrect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that status is correct on order page in backend (same with value of orderStatus variable) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php index 94dc0b6f1f6d0..f80348df2b749 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderStatusNotAssigned.php @@ -15,12 +15,9 @@ */ class AssertOrderStatusNotAssigned extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order status with status code from fixture have empty "State Code and Title" value 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 53cffa38d2cc3..778acb060b5d7 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 @@ -14,18 +14,15 @@ */ class AssertOrderStatusSuccessAssignMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * OrderStatus assigning success message */ const SUCCESS_MESSAGE = 'You have assigned the order status.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after order status assigning * 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 50078f4ef941d..cf7628ebc0d5d 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 @@ -14,14 +14,11 @@ */ class AssertOrderStatusSuccessCreateMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You have saved the order status.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You have saved the order status.'; /** * Assert that success message is displayed after order status saved. 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 4450b4dcbdb42..d80fd40c80362 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 @@ -14,18 +14,15 @@ */ class AssertOrderStatusSuccessUnassignMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * OrderStatus unassign success message */ const SUCCESS_MESSAGE = 'You have unassigned the order status.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after order status unassign * 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 ae279f1c188d1..cd3b2a7a99b68 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 @@ -14,18 +14,15 @@ */ class AssertOrderSuccessCreateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after created sales order */ const SUCCESS_MESSAGE = "You created the order."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that after create sales order successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php index f710f7ee682c5..8d1ffb4c4e9f4 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrdersInOrdersGrid.php @@ -15,12 +15,9 @@ */ class AssertOrdersInOrdersGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that orders are present in Sales -> Orders Grid diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php index c28c1d2c6ea32..5e7a3f884138e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php @@ -15,12 +15,9 @@ */ class AssertProductInItemsOrderedGrid extends AbstractAssertForm { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Fields for assert. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php index 9d6d67440dd59..1f78b2625efbe 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInCreditMemoTab.php @@ -17,12 +17,9 @@ */ class AssertRefundInCreditMemoTab extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that refund is present in the tab with ID and refunded amount(depending on full/partial refund) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php index 57255ec8b3f48..6b1501aad3f36 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundInRefundsGrid.php @@ -15,12 +15,9 @@ */ class AssertRefundInRefundsGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that refund is present in the 'Refunds' grid with correct ID, order ID, refunded amount 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 6bb7899fc1397..5f23de1fe7e35 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 @@ -14,18 +14,15 @@ */ class AssertRefundSuccessCreateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_CREATE_MESSAGE = 'You created the credit memo.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success create credit memo message is present on order view page * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php index d1f0f511b6ba7..bcba940b0356e 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertRefundedGrandTotalOnFrontend.php @@ -16,12 +16,9 @@ */ class AssertRefundedGrandTotalOnFrontend extends AbstractAssertOrderOnFrontend { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that refunded grand total is equal to data from fixture on My Account page diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php index 8b02b890234ea..354017f8ca150 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php @@ -16,12 +16,9 @@ */ class AssertReorderStatusIsCorrect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that status is correct on order page in backend (same with value of orderStatus variable) diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php index a570cf69e4daa..952dce858e8c9 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php @@ -14,12 +14,9 @@ */ class AssertSalesPrintOrderBillingAddress extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that BillingAddress printed correctly on sales guest print page. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php index 098818def36d3..4ad51c43c4f62 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php @@ -13,12 +13,9 @@ */ class AssertSalesPrintOrderGrandTotal extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Grand Total price was printed correctly on sales guest print page. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php index e3da94f19888d..f465275381fda 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php @@ -13,12 +13,9 @@ */ class AssertSalesPrintOrderPaymentMethod extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that payment method was printed correctly on sales guest print page. diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php index ccb6998237c57..34c30a4834b52 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php @@ -14,18 +14,15 @@ */ class AssertSalesPrintOrderProducts extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Template for error message. */ const ERROR_MESSAGE = "Product with name: '%s' was not found on sales guest print page.\n"; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that products printed correctly on sales guest print page. * diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php index 53acd4a7d63e7..af06e6388c521 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertUnholdButton.php @@ -16,12 +16,9 @@ */ class AssertUnholdButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that 'Unhold' button present on order page diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.php deleted file mode 100644 index 5e5a00f93ff93..0000000000000 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.php +++ /dev/null @@ -1,49 +0,0 @@ -_url = $this->_url = $_ENV['app_frontend_url'] . self::MCA; - } - - /** - * Get view block - * - * @return \Magento\Sales\Test\Block\Order\Info\Buttons - */ - public function getViewBlock() - { - return Factory::getBlockFactory()->getMagentoSalesOrderInfoButtons( - $this->_browser->find($this->blockSelector) - ); - } -} diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.xml new file mode 100644 index 0000000000000..93f0d1fc97b4e --- /dev/null +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Page/SalesGuestView.xml @@ -0,0 +1,20 @@ + + + + + + Magento\Sales\Test\Block\Order\View\ActionsToolbar + .actions-toolbar + css selector + + + Magento\Sales\Test\Block\Order\View + .column.main + css selector + + + diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AbstractMoveComparedProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AbstractMoveComparedProductsOnOrderPageTest.php index e1dd056d2754f..f5ac6e1b63524 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AbstractMoveComparedProductsOnOrderPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/AbstractMoveComparedProductsOnOrderPageTest.php @@ -20,6 +20,8 @@ /** * Class AbstractMoveComparedProductsOnOrderPageTest * Abstract class for move compared products on order page + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractMoveComparedProductsOnOrderPageTest extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest/test.csv index d4358b9761bd9..ef91f9cd62b13 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateCreditMemoEntityTest/test.csv @@ -1,4 +1,4 @@ -"description";"data/items_data/0/back_to_stock";"data/items_data/0/qty";"data/form_data/shipping_amount";"data/form_data/adjustment_positive";"data/form_data/adjustment_negative";"data/form_data/refund_customerbalance_return_enable";"data/form_data/refund_customerbalance_return";"order/dataSet";"order/data/entity_id/products";"order/data/price/preset";"constraint";"issue" -"assert items return to stock (partial refund)";"Yes";"1";"-";"-";"-";"-";"-";"default";"catalogProductSimple::100_dollar_product";"partial_refund";"assertRefundSuccessCreateMessage, assertCreditMemoButton, assertRefundInCreditMemoTab, assertRefundInRefundsGrid, assertRefundedGrandTotalOnFrontend, assertProductForm, assertCreditMemoItems";"" -"assert money return to StoreCredit";"-";"-";"5";"-";"-";"Yes";"10";"default";"catalogProductSimple::default";"full_refund";"assertRefundSuccessCreateMessage, assertNoCreditMemoButton, assertRefundInCreditMemoTab, assertRefundInRefundsGrid, assertRefundedGrandTotalOnFrontend, assertCustomerBalanceAmount, assertCreditMemoItems";"Bug: MAGETWO-29184" -"assert 0 shipping refund";"-";"-";"0";"5";"10";"-";"-";"default";"catalogProductSimple::default";"full_refund_with_zero_shipping_refund";"assertRefundSuccessCreateMessage, assertCreditMemoButton, assertRefundInCreditMemoTab, assertRefundInRefundsGrid, assertRefundedGrandTotalOnFrontend, assertCreditMemoItems";"" +"description";"data/items_data/0/back_to_stock";"data/items_data/0/qty";"data/form_data/shipping_amount";"data/form_data/adjustment_positive";"data/form_data/adjustment_negative";"data/form_data/refund_customerbalance_return_enable";"data/form_data/refund_customerbalance_return";"order/dataSet";"order/data/entity_id/products";"order/data/price/preset";"constraint" +"assert items return to stock (partial refund)";"Yes";"1";"-";"-";"-";"-";"-";"default";"catalogProductSimple::100_dollar_product";"partial_refund";"assertRefundSuccessCreateMessage, assertCreditMemoButton, assertRefundInCreditMemoTab, assertRefundInRefundsGrid, assertRefundedGrandTotalOnFrontend, assertProductForm, assertCreditMemoItems" +"assert money return to StoreCredit";"-";"-";"5";"-";"-";"Yes";"10";"default";"catalogProductSimple::default";"full_refund";"assertRefundSuccessCreateMessage, assertNoCreditMemoButton, assertRefundInCreditMemoTab, assertRefundInRefundsGrid, assertRefundedGrandTotalOnFrontend, assertCustomerBalanceAmount, assertCreditMemoItems" +"assert 0 shipping refund";"-";"-";"0";"5";"10";"-";"-";"default";"catalogProductSimple::default";"full_refund_with_zero_shipping_refund";"assertRefundSuccessCreateMessage, assertCreditMemoButton, assertRefundInCreditMemoTab, assertRefundInRefundsGrid, assertRefundedGrandTotalOnFrontend, assertCreditMemoItems" diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest/test.csv b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest/test.csv index edc687b2014b1..76191653bc2b3 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderBackendTest/test.csv @@ -1,16 +1,16 @@ -"products";"giftCardAccount";"salesRule";"customer/dataSet";"rewardPoints";"customerBalance";"billingAddress/dataSet";"shipping/shipping_service";"shipping/shipping_method";"grandTotal";"payment/method";"payment/po_number";"payment/use_reward_points";"payment/use_customer_balance";"status";"orderButtonsAvailable";"configData";"backendOrder/data/firstname";"backendOrder/data/lastname";"backendOrder/data/street[0]";"backendOrder/data/city";"backendOrder/data/country_id";"backendOrder/data/region_id";"backendOrder/data/postcode";"backendOrder/data/telephone";"backendOrder/data/shipping_same_as_billing";"constraint";"issue" -"catalogProductSimple::simple_for_sales, catalogProductVirtual::virtual_for_sales";"-";"active_sales_rule_with_fixed_price_discount_coupon";"customer_US";"reward_points_50";"-";"customer_US";"Flat Rate";"Fixed";"315.00";"cashondelivery";"-";"Yes";"-";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"cashondelivery";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductVirtual::default";"default";"active_sales_rule_with_fixed_price_discount_coupon";"customer_UK";"-";"-";"customer_UK";"-";"-";"0.00";"free";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"cashondelivery_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"Bug MAGETWO-28633" -"catalogProductSimple::default";"-";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"cashondelivery";"-";"-";"-";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"cashondelivery";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductSimple::default, catalogProductVirtual::default";"default";"-";"-";"-";"customerBalance_5";"customer_US";"Flat Rate";"Fixed";"575.00";"checkmo";"-";"-";"Yes";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"checkmo";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductVirtual::default";"-";"-";"customer_UK";"-";"-";"customer_UK";"-";"-";"10.00";"checkmo";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"checkmo_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"Bug MAGETWO-28633" -"catalogProductSimple::default";"default";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"checkmo";"-";"-";"-";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"checkmo";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductSimple::default, catalogProductVirtual::default";"-";"-";"customer_US";"-";"customerBalance_5";"customer_US";"Flat Rate";"Fixed";"575.00";"banktransfer";"-";"-";"Yes";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductVirtual::default";"default";"-";"customer_UK";"-";"-";"customer_UK";"-";"-";"10.00";"free";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"banktransfer_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"Bug MAGETWO-28633" -"catalogProductSimple::default";"-";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"banktransfer";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductSimple::default, catalogProductVirtual::default";"default";"active_sales_rule_with_fixed_price_discount_coupon";"customer_US";"reward_points_50";"-";"customer_US";"Free Shipping";"Free";"510.00";"banktransfer";"-";"Yes";"-";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"freeshipping, banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductVirtual::default";"-";"-";"customer_UK";"-";"-";"customer_UK";"-";"-";"10.00";"banktransfer";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"freeshipping_specificcountry_gb, banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"Bug MAGETWO-28633" -"catalogProductSimple::default";"default";"-";"customer_US";"-";"-";"customer_US";"Free Shipping";"Free";"560.00";"checkmo";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"freeshipping, checkmo";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductSimple::default, catalogProductVirtual::default";"-";"-";"customer_US";"-";"customerBalance_5";"customer_US";"Flat Rate";"Fixed";"575.00";"purchaseorder";"123456";"-";"Yes";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"purchaseorder";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" -"catalogProductVirtual::default";"default";"active_sales_rule_with_fixed_price_discount_coupon";"customer_UK";"-";"-";"customer_UK";"-";"-";"0.00";"free";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"purchaseorder_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"Bug MAGETWO-28633" -"catalogProductSimple::default";"-";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"purchaseorder";"123456";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Reorder, Edit";"purchaseorder";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend";"" +"products";"giftCardAccount";"salesRule";"customer/dataSet";"rewardPoints";"customerBalance";"billingAddress/dataSet";"shipping/shipping_service";"shipping/shipping_method";"grandTotal";"payment/method";"payment/po_number";"payment/use_reward_points";"payment/use_customer_balance";"status";"orderButtonsAvailable";"configData";"backendOrder/data/firstname";"backendOrder/data/lastname";"backendOrder/data/street[0]";"backendOrder/data/city";"backendOrder/data/country_id";"backendOrder/data/region_id";"backendOrder/data/postcode";"backendOrder/data/telephone";"backendOrder/data/shipping_same_as_billing";"constraint" +"catalogProductSimple::simple_for_sales, catalogProductVirtual::virtual_for_sales";"-";"active_sales_rule_with_fixed_price_discount_coupon";"customer_US";"reward_points_50";"-";"customer_US";"Flat Rate";"Fixed";"315.00";"cashondelivery";"-";"Yes";"-";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"cashondelivery";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductVirtual::default";"default";"active_sales_rule_with_fixed_price_discount_coupon";"customer_UK";"-";"-";"customer_UK";"-";"-";"0.00";"free";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"cashondelivery_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default";"-";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"cashondelivery";"-";"-";"-";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"cashondelivery";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default, catalogProductVirtual::default";"default";"-";"-";"-";"customerBalance_5";"customer_US";"Flat Rate";"Fixed";"575.00";"checkmo";"-";"-";"Yes";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"checkmo";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductVirtual::default";"-";"-";"customer_UK";"-";"-";"customer_UK";"-";"-";"10.00";"checkmo";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"checkmo_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default";"default";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"checkmo";"-";"-";"-";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"checkmo";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default, catalogProductVirtual::default";"-";"-";"customer_US";"-";"customerBalance_5";"customer_US";"Flat Rate";"Fixed";"575.00";"banktransfer";"-";"-";"Yes";"Pending";"Back, Reorder, Cancel, Send Notification, Hold, Invoice, Ship, Edit";"banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductVirtual::default";"default";"-";"customer_UK";"-";"-";"customer_UK";"-";"-";"10.00";"free";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"banktransfer_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default";"-";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"banktransfer";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default, catalogProductVirtual::default";"default";"active_sales_rule_with_fixed_price_discount_coupon";"customer_US";"reward_points_50";"-";"customer_US";"Free Shipping";"Free";"510.00";"banktransfer";"-";"Yes";"-";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"freeshipping, banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductVirtual::default";"-";"-";"customer_UK";"-";"-";"customer_UK";"-";"-";"10.00";"banktransfer";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"freeshipping_specificcountry_gb, banktransfer";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default";"default";"-";"customer_US";"-";"-";"customer_US";"Free Shipping";"Free";"560.00";"checkmo";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"freeshipping, checkmo";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default, catalogProductVirtual::default";"-";"-";"customer_US";"-";"customerBalance_5";"customer_US";"Flat Rate";"Fixed";"575.00";"purchaseorder";"123456";"-";"Yes";"Pending";"Back, Cancel, Send Notification, Hold, Reorder, Invoice, Edit";"purchaseorder";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductVirtual::default";"default";"active_sales_rule_with_fixed_price_discount_coupon";"customer_UK";"-";"-";"customer_UK";"-";"-";"0.00";"free";"-";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Edit";"purchaseorder_specificcountry_gb";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" +"catalogProductSimple::default";"-";"-";"customer_US";"-";"-";"customer_US";"Flat Rate";"Fixed";"565.00";"purchaseorder";"123456";"-";"-";"Pending";"Back, Cancel, Send Notification, Hold, Invoice, Reorder, Edit";"purchaseorder";"First Name%isolation%";"Last Name%isolation%";"6161 West Centinela Avenue";"Culver City";"Unites States";"California";"90230";"55555555";"Yes";"assertOrderSuccessCreateMessage, assertOrderButtonsAvailable, assertOrderGrandTotal, assertOrderInOrdersGrid, assertOrderInOrdersGridOnFrontend" diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php index 8ee34aa5b2168..45fc4f03962ea 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php @@ -37,6 +37,8 @@ * * @group Order_Management_(CS) * @ZephyrId MAGETWO-28540 + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MoveShoppingCartProductsOnOrderPageTest extends Injectable { diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php index a4ad3337b351c..bb676a6c7fde4 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/PrintOrderOnFrontendStep.php @@ -46,7 +46,7 @@ public function __construct(SalesGuestView $salesGuestView, Browser $browser) */ public function run() { - $this->salesGuestView->getViewBlock()->clickPrintOrder(); + $this->salesGuestView->getActionsToolbar()->clickLink('Print Order'); $this->browser->selectWindow(); } } diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml index e3326f520573c..44fb7864e363f 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/constraint.xml @@ -6,154 +6,154 @@ --> - low + low - high + high - high + high - high + high - low + low - low + low - low + low - low + low - high + high - low + low - low + low - low + low - high + high - high + high - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoInGrid.php index 9280ee94f3544..67409cbd1549a 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoInGrid.php @@ -15,12 +15,9 @@ */ class AssertArchiveCreditMemoInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Refund with corresponding fixture data is present in Archive Credit Memos grid diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoItems.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoItems.php index 362940eecc652..f12b6cf50cbdf 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoItems.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveCreditMemoItems.php @@ -16,12 +16,9 @@ */ class AssertArchiveCreditMemoItems extends AbstractAssertItems { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ /** * Assert returned product represented on Credit memo page: diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceInGrid.php index 469305e2405f9..b0328d97ed8d1 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceInGrid.php @@ -15,12 +15,9 @@ */ class AssertArchiveInvoiceInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Invoice with corresponding data is present in Sales Archive Invoices grid diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceItems.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceItems.php index 72aed7f4beed9..7f0a3b16eaf18 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceItems.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveInvoiceItems.php @@ -16,12 +16,9 @@ */ class AssertArchiveInvoiceItems extends AbstractAssertItems { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ /** * Assert invoiced product represented in invoice archive: diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderAvailableButtons.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderAvailableButtons.php index 27353574d1829..d3dea3ee86479 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderAvailableButtons.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderAvailableButtons.php @@ -16,12 +16,9 @@ */ class AssertArchiveOrderAvailableButtons extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that specified in data set buttons exist on order page in backend diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionErrorMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionErrorMessage.php index 4660d9a686f0e..cf393cd6882ec 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionErrorMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionErrorMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderCancelMassActionErrorMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message displayed after unsuccessful orders canceling */ const ERROR_MESSAGE = 'You cannot cancel the order(s).'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error message is displayed on "Archived Orders Grid" page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionSuccessMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionSuccessMessage.php index 57eec1f8fcb86..38b8b35f2ce05 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderCancelMassActionSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderCancelMassActionSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message displayed after cancel order from archive */ const SUCCESS_MESSAGE = 'We canceled %d order(s).'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed on "Archived Orders Grid" page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderInGrid.php index 973faa9d29f9b..740358244a1e2 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderInGrid.php @@ -15,12 +15,9 @@ */ class AssertArchiveOrderInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order with fixture data is in archive orders grid diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderNotInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderNotInGrid.php index dcace14cc4d08..cd13d7ac79573 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertArchiveOrderNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that order is absent in archive orders grid diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldErrorMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldErrorMessage.php index d845a2eea6c07..6a8f2664e6274 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldErrorMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldErrorMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderOnHoldErrorMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const ERROR_MESSAGE = 'No order(s) were put on hold.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert on hold fail message is displayed on archive order index page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldSuccessMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldSuccessMessage.php index 3b68fe61ba6f5..b6e51a5cc0ede 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderOnHoldSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderOnHoldSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'You have put %d order(s) on hold.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert on hold success message is displayed on archived order index page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseErrorMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseErrorMessage.php index 4b61df81539b4..4f6c584d3cc0f 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseErrorMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseErrorMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderReleaseErrorMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const ERROR_MESSAGE = 'No order(s) were released from on hold status.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert release error message is displayed on archived order index page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseSuccessMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseSuccessMessage.php index 72a05e5ba5c5f..6abfcf0260383 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderReleaseSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderReleaseSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = '%d order(s) have been released from on hold status.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert release success message is displayed on archive order index page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderStatusInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderStatusInGrid.php index c43c482452dca..82f5a765911ec 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderStatusInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderStatusInGrid.php @@ -16,12 +16,9 @@ */ class AssertArchiveOrderStatusInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that status is correct on order page in backend (same with value of orderStatus variable) diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessMessage.php index 1f27f9d58759a..d1fe94f39f51c 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message displayed after moving order to archive */ const SUCCESS_MESSAGE = 'We archived %d order(s).'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed on "Orders Grid" page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessRemoveMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessRemoveMessage.php index 3a735b960ccc2..5a61facf33395 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessRemoveMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderSuccessRemoveMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderSuccessRemoveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'We removed %d order(s) from the archive.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after removed orders success message presents * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderWarningMessage.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderWarningMessage.php index 2a693c23dea50..644c1b3ce4551 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderWarningMessage.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrderWarningMessage.php @@ -14,18 +14,15 @@ */ class AssertArchiveOrderWarningMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Message displayed after cancel sales order */ const WARNING_MESSAGE = "We can't archive the selected order(s)."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that warning message present on order grid page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersCancelMassActionsMessages.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersCancelMassActionsMessages.php index 098e326baf89f..7efc58b5d3048 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersCancelMassActionsMessages.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersCancelMassActionsMessages.php @@ -14,6 +14,10 @@ */ class AssertArchiveOrdersCancelMassActionsMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message displayed after cancel order from archive */ @@ -24,13 +28,6 @@ class AssertArchiveOrdersCancelMassActionsMessages extends AbstractConstraint */ const ERROR_MESSAGE = '%d order(s) cannot be canceled.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error and success messages are displayed on "Archived Orders Grid" page * diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersInGrid.php index cf1155c8058e0..427a5d0926927 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveOrdersInGrid.php @@ -14,12 +14,9 @@ */ class AssertArchiveOrdersInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that orders with specified id and status is in archive orders grid diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentInGrid.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentInGrid.php index c44ea19b85275..bf874ce5f746e 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentInGrid.php @@ -15,12 +15,9 @@ */ class AssertArchiveShipmentInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Shipment with corresponding fixture data is present in Sales Archive Shipments grid diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentItems.php b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentItems.php index 2c6cea11e1723..ddeedbacaae5f 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentItems.php +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/Constraint/AssertArchiveShipmentItems.php @@ -17,12 +17,9 @@ */ class AssertArchiveShipmentItems extends AssertShipmentItems { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @constructor diff --git a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/etc/constraint.xml index 62907fff94de2..12327d381ad27 100644 --- a/dev/tests/functional/tests/app/Magento/SalesArchive/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/SalesArchive/Test/etc/constraint.xml @@ -6,66 +6,66 @@ --> - low + low - low + low - high + high - low + low - low + low - low + low - low + low - high + high - low + low - low + low - medium + medium - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php index 0e89d149b5fe8..8816c24b032fc 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php @@ -11,12 +11,9 @@ */ class AssertCartPriceRuleConditionIsApplied extends AssertCartPriceRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that shopping cart subtotal not equals with grand total diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php index 70f6d1b280220..43e8d2cd8be94 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php @@ -11,12 +11,9 @@ */ class AssertCartPriceRuleConditionIsNotApplied extends AssertCartPriceRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that shopping cart subtotal equals with grand total diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php index 9712ae7a9edc8..ec9d5d61b1534 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php @@ -15,12 +15,9 @@ */ class AssertCartPriceRuleForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data @@ -32,6 +29,7 @@ class AssertCartPriceRuleForm extends AbstractConstraint 'actions_serialized', 'from_date', 'to_date', + 'id' ]; /** @@ -88,7 +86,7 @@ protected function verify(array $fixtureData, array $formData) . "\nActual: " . implode(", ", $formData[$key]); } } else { - if ($value !== $formData[$key] && !in_array($key, $this->skippedFields)) { + if (!in_array($key, $this->skippedFields) && $value !== $formData[$key]) { $errorMessage[] = "Data in " . $key . " field not equal." . "\nExpected: " . $value . "\nActual: " . $formData[$key]; diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php index 3acb9213e9d01..307bab259c1c3 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php @@ -11,14 +11,11 @@ */ class AssertCartPriceRuleFreeShippingIsApplied extends AssertCartPriceRuleApplying { - const FREE_SHIPPING_PRICE = '0.00'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const FREE_SHIPPING_PRICE = '0.00'; /** * Assert that free shipping is applied in shopping cart diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php index 1236146ae2aec..1755cfbcac45e 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php @@ -14,12 +14,9 @@ */ class AssertCartPriceRuleIsNotPresentedInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sales rule is not present in cart price rules grid 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 2c0149ba8f2f7..b704e1ec18511 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 @@ -13,14 +13,11 @@ */ class AssertCartPriceRuleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The rule has been deleted.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'The rule has been deleted.'; /** * Assert that success message is displayed after sales rule delete 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 aaeecedc86c9c..607fe465f3f11 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 @@ -13,14 +13,11 @@ */ class AssertCartPriceRuleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The rule has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The rule has been saved.'; /** * Assert that success message is displayed after sales rule save diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertSalesRuleOnPrintOrder.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertSalesRuleOnPrintOrder.php index c2b311a9e7b75..dbe8619113ea5 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertSalesRuleOnPrintOrder.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Constraint/AssertSalesRuleOnPrintOrder.php @@ -13,12 +13,9 @@ */ class AssertSalesRuleOnPrintOrder extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sales rule amount printed correctly on sales guest print page. diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php index 476580ea5d1e7..c74301060d42a 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php @@ -113,21 +113,10 @@ public function __prepare(FixtureFactory $fixtureFactory) * Create Sales Rule Entity * * @param SalesRuleInjectable $salesRule - * @param AddressInjectable $address - * @param array $productQuantity - * @param array $shipping - * @param int $isLoggedIn * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function testCreateSalesRule( - SalesRuleInjectable $salesRule, - AddressInjectable $address, - $productQuantity, - $shipping, - $isLoggedIn - ) { + public function testCreateSalesRule(SalesRuleInjectable $salesRule) + { // Preconditions $this->salesRuleName = $salesRule->getName(); diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/constraint.xml index 287b632f2b6be..a0ed31ac332cb 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/etc/constraint.xml @@ -6,27 +6,27 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php index c3792a62bf773..f7167eff5402a 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertNoShipButton.php @@ -16,12 +16,9 @@ */ class AssertNoShipButton extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert no Ship button in the order grid diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php index 7ffd86d560a1b..854bb88d1e3a4 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipTotalQuantity.php @@ -17,12 +17,9 @@ */ class AssertShipTotalQuantity extends AbstractAssertOrderOnFrontend { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that shipped items quantity in 'Total Quantity' is equal to data from fixture on My Account page diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php index 0a38d1127164b..227bac515482e 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsGrid.php @@ -15,12 +15,9 @@ */ class AssertShipmentInShipmentsGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert shipment with corresponding shipment/order ID is present in 'Shipments' with correct total qty field diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php index 1a4d3a816c517..6ad8c71f09b35 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php @@ -16,12 +16,9 @@ */ class AssertShipmentInShipmentsTab extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that shipment is present in the Shipments tab with correct shipped items quantity diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php index cad9510a91ee3..23c1e40e276b5 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShipmentItems.php @@ -17,12 +17,9 @@ */ class AssertShipmentItems extends AbstractAssertItems { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Shipment index page 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 61e3b0c4db10e..7d97f565ef579 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 @@ -14,18 +14,15 @@ */ class AssertShipmentSuccessCreateMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Shipment created success message */ const SUCCESS_MESSAGE = 'The shipment has been created.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert success message presents * diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php index 0f7cb916c3f78..c7bf8c6c929be 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php @@ -13,18 +13,15 @@ */ class AssertShippingMethodOnPrintOrder extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Shipping method and carrier template. */ const SHIPPING_TEMPLATE = "%s - %s"; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that shipping method was printed correctly on sales guest print page. * diff --git a/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml index b95673355dbca..d722318c8177a 100644 --- a/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Shipping/Test/etc/constraint.xml @@ -6,24 +6,24 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php index 5b6f43a081a09..108dea9ad159b 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapContent.php @@ -18,12 +18,9 @@ */ class AssertSitemapContent extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sitemap.xml file contains correct content according to dataset: 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 7ee7996c9ca0d..b9e3669f34ab0 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 @@ -14,14 +14,11 @@ */ class AssertSitemapFailFolderSaveMessage extends AbstractConstraint { - const FAIL_FOLDER_MESSAGE = 'Please create the specified folder "%s" before saving the sitemap.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const FAIL_FOLDER_MESSAGE = 'Please create the specified folder "%s" before saving the sitemap.'; /** * Assert that error message is displayed after creating sitemap with wrong folder 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 e282eb331fbd6..3c6e69eeaf06f 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 @@ -14,14 +14,11 @@ */ class AssertSitemapFailPathSaveMessage extends AbstractConstraint { - const FAIL_PATH_MESSAGE = 'Path "/%s" is not available and cannot be used.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const FAIL_PATH_MESSAGE = 'Path "/%s" is not available and cannot be used.'; /** * Assert that error message is displayed after creating sitemap with wrong path diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php index a0b778a44a81e..6e272f806148b 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapInGrid.php @@ -14,12 +14,9 @@ */ class AssertSitemapInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sitemap availability in sitemap grid diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php index 69f1896267b81..13d0a9d87b7c3 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertSitemapNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that sitemap not availability in sitemap grid 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 2eefb99295dc5..63303aa1a56d3 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 @@ -13,14 +13,11 @@ */ class AssertSitemapSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The sitemap has been deleted.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'The sitemap has been deleted.'; /** * Assert that success message is displayed after sitemap delete 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 4e17c680ee6a2..b60dd94793718 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 @@ -14,14 +14,11 @@ */ class AssertSitemapSuccessGenerateMessage extends AbstractConstraint { - const SUCCESS_GENERATE_MESSAGE = 'The sitemap "%s" has been generated.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_GENERATE_MESSAGE = 'The sitemap "%s" has been generated.'; /** * Assert that success message is displayed after sitemap generate diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php index 2c6aa227d2c80..1da3573347087 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php @@ -14,17 +14,14 @@ */ class AssertSitemapSuccessSaveAndGenerateMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + const SUCCESS_GENERATE_MESSAGE = 'The sitemap "%s" has been generated.'; const SUCCESS_SAVE_MESSAGE = 'The sitemap has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success messages is displayed after sitemap generate * 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 559021d499df5..ea7fc78a0262a 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 @@ -13,14 +13,11 @@ */ class AssertSitemapSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The sitemap has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The sitemap has been saved.'; /** * Assert that success message is displayed after sitemap save diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml index 6cd73616a8347..c9f2f772e613b 100644 --- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/etc/constraint.xml @@ -6,30 +6,30 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php index d6658afe5c669..02aed4f08755b 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreBackend.php @@ -15,12 +15,9 @@ */ class AssertStoreBackend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created store view displays in backend configuration (Stores > Configuration > "Scope" dropdown) diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php index 2557fe928caf7..6bb5a4f315a3c 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreForm.php @@ -16,12 +16,9 @@ */ class AssertStoreForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that displayed Store View data on edit page equals passed from fixture diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php index 5a378b26cfb9b..882579dc9e77d 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreFrontend.php @@ -15,12 +15,9 @@ */ class AssertStoreFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created store view available on frontend (store view selector on page top) diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php index 955a9e605f433..eb4c8dbcc0a68 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupForm.php @@ -16,12 +16,9 @@ */ class AssertStoreGroupForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php index 2bd403cf3ea2c..c6a9051484e1f 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreGroupInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store Group can be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php index 1ba55fbb0d337..fda67c4c40da0 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreGroupNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store Group can not be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php index 80b3ac7260950..a5994564c4ab9 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupOnStoreViewForm.php @@ -16,12 +16,9 @@ */ class AssertStoreGroupOnStoreViewForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that New Store Group visible on StoreView Form in Store dropdown diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php index 21cfb5150ff02..d43aab2aeb6fc 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreGroupSuccessDeleteAndBackupMessages.php @@ -14,6 +14,10 @@ */ class AssertStoreGroupSuccessDeleteAndBackupMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success backup message */ @@ -24,13 +28,6 @@ class AssertStoreGroupSuccessDeleteAndBackupMessages extends AbstractConstraint */ const SUCCESS_DELETE_MESSAGE = 'The store has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success messages is displayed after deleting store group * 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 79319bc2e0057..0ac251b637021 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 @@ -14,18 +14,15 @@ */ class AssertStoreGroupSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store group delete message */ const SUCCESS_DELETE_MESSAGE = 'The store has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after deleting store group * 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 a67c56fca06a7..91ac06a03f11b 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 @@ -14,18 +14,15 @@ */ class AssertStoreGroupSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store create message */ const SUCCESS_MESSAGE = 'The store has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after Store Group has been created * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php index 6ceb4738a515b..800a512f99543 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store View can be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php index 77654a35ae9d5..5ba7ce2a1e759 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertStoreNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Store can not be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php index a8de5157cdbf2..cd60d922e6b1e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreNotOnFrontend.php @@ -15,12 +15,9 @@ */ class AssertStoreNotOnFrontend extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created store view is not available on frontend (store view selector on page top) diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php index 21d6841aa8c0c..4789b621301bb 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertStoreSuccessDeleteAndBackupMessages.php @@ -14,6 +14,10 @@ */ class AssertStoreSuccessDeleteAndBackupMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success backup message */ @@ -24,13 +28,6 @@ class AssertStoreSuccessDeleteAndBackupMessages extends AbstractConstraint */ const SUCCESS_DELETE_MESSAGE = 'The store view has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that store success delete and backup messages are present * 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 45bc94d23a00b..39c153045062c 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 @@ -14,18 +14,15 @@ */ class AssertStoreSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store delete message */ const SUCCESS_DELETE_MESSAGE = 'The store view has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after store delete successful message appears * 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 ac5208b027162..4772b8a5789de 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 @@ -14,18 +14,15 @@ */ class AssertStoreSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success store view create message */ const SUCCESS_MESSAGE = 'The store view has been saved'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after Store View has been created * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php index aafa658db9608..768810a991a6e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteForm.php @@ -16,12 +16,9 @@ */ class AssertWebsiteForm extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php index b96fc41b0ece9..f783137d79026 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteInGrid.php @@ -15,12 +15,9 @@ */ class AssertWebsiteInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Website can be found in Stores grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php index 026cd7ca95e06..3bc71b517f23f 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertWebsiteNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created Website can't be found in grid by name diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php index 919b1c51f185c..d5283ec4c60f7 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteOnStoreForm.php @@ -16,12 +16,9 @@ */ class AssertWebsiteOnStoreForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that Website visible on Store Group Form in Website dropdown diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php index 7d1abde864aa2..e532649816079 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/Constraint/AssertWebsiteSuccessDeleteAndBackupMessages.php @@ -14,6 +14,10 @@ */ class AssertWebsiteSuccessDeleteAndBackupMessages extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success backup message */ @@ -24,13 +28,6 @@ class AssertWebsiteSuccessDeleteAndBackupMessages extends AbstractConstraint */ const SUCCESS_DELETE_MESSAGE = 'The website has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success messages is displayed after deleting website * 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 7a8b5821ecd9d..761553eab506e 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 @@ -14,18 +14,15 @@ */ class AssertWebsiteSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success website delete message */ const SUCCESS_DELETE_MESSAGE = 'The website has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after deleting website * 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 0b1c5e4a77ff4..1e64f22bc3168 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 @@ -14,18 +14,15 @@ */ class AssertWebsiteSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success website create message */ const SUCCESS_MESSAGE = 'The website has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after Website has been created * diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php index 74ff7199808e2..9d48de56e37bd 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreEntityTest.php @@ -100,6 +100,6 @@ public function test(Store $store, $createBackup) $this->storeIndex->getStoreGrid()->searchAndOpenStore($store); $this->editStore->getFormPageActions()->delete(); $this->storeDelete->getStoreForm()->fillForm(['create_backup' => $createBackup]); - $this->storeDelete->getFormPageFooterActions()->delete(); + $this->storeDelete->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php index 1a5817d2d0ac2..3227833d67e76 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteStoreGroupEntityTest.php @@ -102,6 +102,6 @@ public function test(StoreGroup $storeGroup, $createBackup) $this->storeIndex->getStoreGrid()->searchAndOpenStoreGroup($storeGroup); $this->editGroup->getFormPageActions()->delete(); $this->deleteGroup->getDeleteGroupForm()->fillForm(['create_backup' => $createBackup]); - $this->deleteGroup->getFormPageFooterActions()->delete(); + $this->deleteGroup->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php index 1bdd06c91fc37..66f06e8fbe61e 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/DeleteWebsiteEntityTest.php @@ -102,6 +102,6 @@ public function test(Website $website, $createBackup) $this->storeIndex->getStoreGrid()->searchAndOpenWebsite($website); $this->editWebsite->getFormPageActions()->delete(); $this->deleteWebsite->getDeleteWebsiteForm()->fillForm(['create_backup' => $createBackup]); - $this->deleteWebsite->getFormPageFooterActions()->delete(); + $this->deleteWebsite->getFormPageActions()->delete(); } } diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml index 4c64f9b0ecd9c..da43ec969ced1 100644 --- a/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Store/Test/etc/constraint.xml @@ -6,78 +6,78 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertCrossSellsProductsSectionForCustomerSegment.php b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertCrossSellsProductsSectionForCustomerSegment.php index ba72f4e181593..d2990f891ec96 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertCrossSellsProductsSectionForCustomerSegment.php +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertCrossSellsProductsSectionForCustomerSegment.php @@ -20,12 +20,9 @@ */ class AssertCrossSellsProductsSectionForCustomerSegment extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ /** * Assert that product is displayed in cross-sell section for customer segment diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleForm.php b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleForm.php index d44499dfbfeca..dadd2d86694af 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleForm.php @@ -16,12 +16,9 @@ */ class AssertTargetRuleForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Skipped fields for verify data diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleInGrid.php b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleInGrid.php index e5f08292680fe..db4b46639d939 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleInGrid.php @@ -14,18 +14,15 @@ */ class AssertTargetRuleInGrid extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Day in seconds */ const DAY = 86400; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert target rule availability in Target Rule Grid * diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleIsNotPresentedInGrid.php b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleIsNotPresentedInGrid.php index 7904d0edf44a1..ada783894355d 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleIsNotPresentedInGrid.php +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleIsNotPresentedInGrid.php @@ -14,18 +14,15 @@ */ class AssertTargetRuleIsNotPresentedInGrid extends AbstractConstraint { + /* tags */ + const SEVERITY = 'middle'; + /* end tags */ + /** * Day in seconds */ const DAY = 86400; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'middle'; - /** * Assert that Target Rule is not presented in grid * diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessDeleteMessage.php index 18cc10f3b22e9..59985d9eac7a6 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessDeleteMessage.php @@ -13,14 +13,11 @@ */ class AssertTargetRuleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the rule.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the rule.'; /** * Assert that success message is displayed after target rule delete diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessSaveMessage.php index 7ea86e6bc4221..0e6c970bb3b18 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/Constraint/AssertTargetRuleSuccessSaveMessage.php @@ -13,14 +13,11 @@ */ class AssertTargetRuleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the rule.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'You saved the rule.'; /** * Assert that success message is displayed after target rule save diff --git a/dev/tests/functional/tests/app/Magento/TargetRule/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/TargetRule/Test/etc/constraint.xml index dc420ce94d41c..1a61545db2123 100644 --- a/dev/tests/functional/tests/app/Magento/TargetRule/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/TargetRule/Test/etc/constraint.xml @@ -6,33 +6,33 @@ --> - high + high - high + high - high + high - middle + middle - high + high @@ -41,6 +41,6 @@ - medium + medium diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php index fdec5c70f0bff..a09c55df53cc2 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateForm.php @@ -15,12 +15,9 @@ */ class AssertTaxRateForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rate form filled correctly @@ -69,6 +66,7 @@ protected function prepareData(array $data) } else { unset($data['zip_from'], $data['zip_to']); } + $data['rate'] = number_format($data['rate'], 4); return $data; } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php index 65b5da52bb96a..fb270ab259ce1 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRateInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert tax rule availability in Tax Rate grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php index a54589348c8f5..efed34b3f6e6e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateInTaxRule.php @@ -12,12 +12,9 @@ */ class AssertTaxRateInTaxRule extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php index 51236eea84069..691a3fda7cb20 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php @@ -12,12 +12,9 @@ */ class AssertTaxRateIsInCorrectRange extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * @return void diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php index b331009964523..cb89722285ef3 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRateNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rate not available in Tax Rate grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php index 979175de60f22..b6015c3e57b4b 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php @@ -14,12 +14,9 @@ */ class AssertTaxRateNotInTaxRule extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rate is absent in tax rule form 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 80ce8e1582ff3..793c1d32c7efb 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 @@ -13,14 +13,11 @@ */ class AssertTaxRateSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The tax rate has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'The tax rate has been deleted.'; /** * Assert that success delete message is displayed after tax rate deleted 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 0e49736f61315..ee423b128ad03 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 @@ -13,14 +13,11 @@ */ class AssertTaxRateSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The tax rate has been saved.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_MESSAGE = 'The tax rate has been saved.'; /** * Assert that success message is displayed after tax rate saved diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php index dc08945f555e2..2da55c6b88294 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleForm.php @@ -15,12 +15,9 @@ */ class AssertTaxRuleForm extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule form filled right diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php index 85c8d5e0da535..61263b8e73140 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRuleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert tax rule availability in Tax Rule grid diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php index 9ca882c846d1b..a8525b09c479e 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsApplied.php @@ -10,12 +10,9 @@ */ class AssertTaxRuleIsApplied extends AssertTaxRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule is applied on product in shopping cart. diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php index 73cfcca5f4c7a..ac4a53f3f3131 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPrices.php @@ -20,6 +20,10 @@ */ class AssertTaxRuleIsAppliedToAllPrices extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Cms index page * @@ -48,13 +52,6 @@ class AssertTaxRuleIsAppliedToAllPrices extends AbstractConstraint */ protected $checkoutCart; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that specified prices are actual on category, product and cart pages * @@ -162,14 +159,14 @@ public function getProductPagePrices($actualPrices) */ public function getCartPrices(CatalogProductSimple $product, $actualPrices) { - $actualPrices['cart_item_price_excl_tax'] = - $this->checkoutCart->getCartBlock()->getCartItem($product)->getPrice(); - $actualPrices['cart_item_price_incl_tax'] = - $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax(); $actualPrices['cart_item_subtotal_excl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPrice(); $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product)->getSubtotalPriceInclTax(); + $actualPrices['cart_item_price_excl_tax'] = + $this->checkoutCart->getCartBlock()->getCartItem($product)->getPrice(); + $actualPrices['cart_item_price_incl_tax'] = + $this->checkoutCart->getCartBlock()->getCartItem($product)->getPriceInclTax(); return $actualPrices; } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php index c99ef7989e517..d3df0e46cbc4f 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleIsNotApplied.php @@ -10,12 +10,9 @@ */ class AssertTaxRuleIsNotApplied extends AssertTaxRuleApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule is not applied on product in shopping cart. diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php index a424b1e11a165..01b38ea99c3f4 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertTaxRuleNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that tax rule not available in Tax Rule grid 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 6595fccbaedb1..721c52e935252 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 @@ -13,14 +13,11 @@ */ class AssertTaxRuleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'The tax rule has been deleted.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_DELETE_MESSAGE = 'The tax rule has been deleted.'; /** * Assert that success delete message is displayed after tax rule deleted 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 e176957e2965e..39db50df2b042 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 @@ -13,14 +13,11 @@ */ class AssertTaxRuleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The tax rule has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The tax rule has been saved.'; /** * Assert that success message is displayed after tax rule saved diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php index 52021d7192e13..17478d3afc0ff 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php @@ -11,12 +11,9 @@ */ class AssertTaxWithCrossBorderApplied extends AbstractAssertTaxWithCrossBorderApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert prices on category, product and cart pages are equal for both customers diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php index 390eb15183fdd..b64b3663a6baf 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxWithCrossBorderNotApplied.php @@ -11,12 +11,9 @@ */ class AssertTaxWithCrossBorderNotApplied extends AbstractAssertTaxWithCrossBorderApplying { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert prices on category, product and cart pages are different for each customer diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php index 68d001c6c4f6b..600aced0b8f38 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest.php @@ -8,13 +8,11 @@ use Magento\Catalog\Test\Fixture\CatalogProductSimple; use Magento\Checkout\Test\Page\CheckoutCart; use Magento\Cms\Test\Page\CmsIndex; -use Magento\Core\Test\Fixture\ConfigData; use Magento\Customer\Test\Fixture\CustomerInjectable; use Magento\Customer\Test\Page\CustomerAccountLogin; use Magento\SalesRule\Test\Fixture\SalesRuleInjectable; use Magento\Tax\Test\Fixture\TaxRule; use Mtf\Fixture\FixtureFactory; -use Mtf\ObjectManager; use Mtf\TestCase\Injectable; /** @@ -102,7 +100,7 @@ class TaxCalculationTest extends Injectable */ public static function setUpBeforeClass() { - self::markTestIncomplete("MAGETWO-28454"); + self::markTestIncomplete("Epic: MAGETWO-30073"); } /** @@ -172,13 +170,14 @@ protected function clearShoppingCart() * * @param CatalogProductSimple $product * @param TaxRule $taxRule - * @param ConfigData $config + * @param string $configData * @return array */ - public function test(CatalogProductSimple $product, TaxRule $taxRule, ConfigData $config) + public function test(CatalogProductSimple $product, TaxRule $taxRule, $configData) { //Preconditions - $config->persist(); + $this->objectManager->create('Magento\Core\Test\TestStep\SetupConfigurationStep', ['configData' => $configData]) + ->run(); $product->persist(); $taxRule->persist(); self::$taxRuleCode = $taxRule->getData()['code']; @@ -195,29 +194,11 @@ public function test(CatalogProductSimple $product, TaxRule $taxRule, ConfigData */ public function tearDown() { - $taxRuleIndex = ObjectManager::getInstance()->create('\Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex'); - $taxRuleIndex->open(); - $taxRuleIndex->getTaxRuleGrid()->searchAndOpen(['code' => self::$taxRuleCode]); - $taxRuleNewPage = ObjectManager::getInstance()->create('Magento\Tax\Test\Page\Adminhtml\TaxRuleNew'); - $taxRuleNewPage->getFormPageActions()->delete(); - } - - /** - * Tear down after tests. - * - * @return void - */ - public static function tearDownAfterClass() - { - $promoQuoteIndex = ObjectManager::getInstance() - ->create('Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex'); - $promoQuoteIndex->open(); - $promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => self::$salesRuleName]); - $promoQuoteEdit = ObjectManager::getInstance() - ->create('Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteEdit'); - $promoQuoteEdit->getFormPageActions()->delete(); - $fixtureFactory = ObjectManager::getInstance()->create('Mtf\Fixture\FixtureFactory'); - $config = $fixtureFactory->createByCode('configData', ['dataSet' => 'default_tax_configuration']); - $config->persist(); + $this->objectManager->create('Magento\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); + $this->objectManager->create('Magento\SalesRule\Test\TestStep\DeleteAllSalesRuleStep')->run(); + $this->objectManager->create( + 'Magento\Core\Test\TestStep\SetupConfigurationStep', + ['configData' => 'default_tax_configuration,shipping_tax_class_taxable_goods_rollback'] + )->run(); } } diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv index 3c6255166eea2..b34a0dc97d871 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxCalculationTest/test.csv @@ -1,11 +1,11 @@ -"config/dataSet";"product/dataSet";"taxRule/dataSet";"prices/category_price_excl_tax";"prices/category_price_incl_tax";"prices/product_view_price_excl_tax";"prices/product_view_price_incl_tax";"prices/cart_item_subtotal_excl_tax";"prices/cart_item_subtotal_incl_tax";"prices/cart_item_price_excl_tax";"prices/cart_item_price_incl_tax";"prices/subtotal_excl_tax";"prices/subtotal_incl_tax";"prices/discount";"prices/shipping_excl_tax";"prices/shipping_incl_tax";"prices/tax";"prices/grand_total_excl_tax";"prices/grand_total_incl_tax";"constraint" -"row_cat_incl_ship_excl_after_disc_on_excl";"simple_with_tier_price_and_category";"customer_equals_store_rate";"277.14";"300.00";"277.14";"300.00";"41.57";"45.00";"13.86";"15.00";"41.57";"45.00";"20.79";"15.00";"16.24";"3.09";"37.36";"40.45";"assertTaxRuleIsAppliedToAllPrices" -"row_cat_excl_ship_incl_before_disc_on_incl";"simple_with_group_price_and_category";"customer_greater_store_rate";"90.99";"98.61";"90.99";"98.61";"272.97";"295.83";"90.99";"98.61";"272.97";"295.83";"147.92";"13.86";"15.02";"24.02";"138.91";"162.93";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_excl_ship_incl_after_disc_on_excl";"simple_with_group_price_and_category";"customer_less_store_rate";"90.99";"98.50";"90.99";"98.50";"272.97";"295.49";"90.99";"98.50";"272.97";"295.49";"136.49";"13.84";"14.98";"12.40";"150.32";"162.72";"assertTaxRuleIsAppliedToAllPrices" -"row_cat_incl_ship_excl_before_disc_on_incl";"product_with_special_price_and_category";"customer_less_store_rate";"83.05";"89.90";"83.05";"89.90";"249.15";"269.70";"83.05";"89.90";"249.15";"269.70";"134.85";"15.00";"16.24";"21.79";"129.30";"151.09";"assertTaxRuleIsAppliedToAllPrices" -"unit_cat_incl_ship_incl_before_disc_on_incl";"simple_with_tier_price_and_category";"customer_less_store_rate";"276.81";"299.65";"276.81";"299.65";"41.52";"44.94";"13.84";"14.98";"41.52";"44.94";"22.47";"13.84";"14.98";"4.56";"32.89";"37.45";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_excl_ship_incl_before_disc_on_incl";"product_with_special_price_and_category";"customer_equals_store_rate";"90.00";"97.43";"90.00";"97.43";"270.00";"292.28";"90.00";"97.43";"270.00";"292.28";"146.15";"13.86";"15.00";"23.42";"137.71";"161.13";"assertTaxRuleIsAppliedToAllPrices" -"unit_cat_excl_ship_excl_after_disc_on_excl";"simple_with_group_price_and_category";"customer_equals_store_rate";"90.99";"98.50";"90.99";"98.50";"272.97";"295.50";"90.99";"98.50";"272.97";"295.50";"136.49";"15.00";"16.24";"12.49";"151.48";"163.97";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_incl_ship_excl_before_disc_on_excl";"simple_with_group_price_and_category";"customer_greater_store_rate";"84.06";"91.10";"84.06";"91.10";"252.18";"273.30";"84.06";"91.10";"252.18";"273.30";"126.09";"15.00";"16.26";"22.38";"141.09";"163.47";"assertTaxRuleIsAppliedToAllPrices" -"total_cat_excl_ship_incl_after_disc_on_incl";"simple_with_tier_price_and_category";"customer_greater_store_rate";"300.00";"325.13";"300.00";"325.13";"45.00";"48.77";"15.00";"16.26";"45.00";"48.77";"24.39";"13.86";"15.02";"2.89";"34.47";"37.36";"assertTaxRuleIsAppliedToAllPrices" -"unit_cat_excl_ship_incl_after_disc_on_excl";"product_with_special_price_and_category";"customer_greater_store_rate";"90.00";"97.54";"90.00";"97.54";"270.00";"292.62";"90.00";"97.54";"270.00";"292.62";"135.00";"13.86";"15.02";"12.47";"148.86";"161.33";"assertTaxRuleIsAppliedToAllPrices" +"configData";"product/dataSet";"taxRule/dataSet";"prices/category_price_excl_tax";"prices/category_price_incl_tax";"prices/product_view_price_excl_tax";"prices/product_view_price_incl_tax";"prices/cart_item_subtotal_excl_tax";"prices/cart_item_subtotal_incl_tax";"prices/cart_item_price_excl_tax";"prices/cart_item_price_incl_tax";"prices/subtotal_excl_tax";"prices/subtotal_incl_tax";"prices/discount";"prices/shipping_excl_tax";"prices/shipping_incl_tax";"prices/tax";"prices/grand_total_excl_tax";"prices/grand_total_incl_tax";"constraint" +"shipping_tax_class_taxable_goods,row_cat_incl_ship_excl_after_disc_on_excl";"simple_with_tier_price_and_category";"customer_equals_store_rate";"277.14";"300.00";"277.14";"300.00";"41.57";"45.00";"13.86";"15.00";"41.57";"45.00";"20.79";"15.00";"16.24";"3.09";"37.36";"40.45";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,row_cat_excl_ship_incl_before_disc_on_incl";"simple_with_group_price_and_category";"customer_greater_store_rate";"90.99";"98.61";"90.99";"98.61";"272.97";"295.83";"90.99";"98.61";"272.97";"295.83";"147.92";"13.86";"15.02";"24.02";"138.91";"162.93";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,total_cat_excl_ship_incl_after_disc_on_excl";"simple_with_group_price_and_category";"customer_less_store_rate";"90.99";"98.50";"90.99";"98.50";"272.97";"295.49";"90.99";"98.50";"272.97";"295.49";"136.49";"13.84";"14.98";"12.40";"150.32";"162.72";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,row_cat_incl_ship_excl_before_disc_on_incl";"product_with_special_price_and_category";"customer_less_store_rate";"83.05";"89.90";"83.05";"89.90";"249.15";"269.70";"83.05";"89.90";"249.15";"269.70";"134.85";"15.00";"16.24";"21.79";"129.30";"151.09";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,unit_cat_incl_ship_incl_before_disc_on_incl";"simple_with_tier_price_and_category";"customer_less_store_rate";"276.81";"299.65";"276.81";"299.65";"41.52";"44.94";"13.84";"14.98";"41.52";"44.94";"22.47";"13.84";"14.98";"4.56";"32.89";"37.45";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,total_cat_excl_ship_incl_before_disc_on_incl";"product_with_special_price_and_category";"customer_equals_store_rate";"90.00";"97.43";"90.00";"97.43";"270.00";"292.28";"90.00";"97.43";"270.00";"292.28";"146.15";"13.86";"15.00";"23.42";"137.71";"161.13";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,unit_cat_excl_ship_excl_after_disc_on_excl";"simple_with_group_price_and_category";"customer_equals_store_rate";"90.99";"98.50";"90.99";"98.50";"272.97";"295.50";"90.99";"98.50";"272.97";"295.50";"136.49";"15.00";"16.24";"12.49";"151.48";"163.97";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,total_cat_incl_ship_excl_before_disc_on_excl";"simple_with_group_price_and_category";"customer_greater_store_rate";"84.06";"91.10";"84.06";"91.10";"252.18";"273.30";"84.06";"91.10";"252.18";"273.30";"126.09";"15.00";"16.26";"22.38";"141.09";"163.47";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,total_cat_excl_ship_incl_after_disc_on_incl";"simple_with_tier_price_and_category";"customer_greater_store_rate";"300.00";"325.13";"300.00";"325.13";"45.00";"48.77";"15.00";"16.26";"45.00";"48.77";"24.39";"13.86";"15.02";"2.89";"34.47";"37.36";"assertTaxRuleIsAppliedToAllPrices" +"shipping_tax_class_taxable_goods,unit_cat_excl_ship_incl_after_disc_on_excl";"product_with_special_price_and_category";"customer_greater_store_rate";"90.00";"97.54";"90.00";"97.54";"270.00";"292.62";"90.00";"97.54";"270.00";"292.62";"135.00";"13.86";"15.02";"12.47";"148.86";"161.33";"assertTaxRuleIsAppliedToAllPrices" diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml index 535fba0e8e1ec..f61aa496c071a 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/etc/constraint.xml @@ -6,20 +6,20 @@ --> - low + low - high + high - high + high @@ -27,20 +27,20 @@ - high + high - high + high - high + high @@ -48,54 +48,54 @@ - low + low - low + low - high + high - high + high - high + high - high + high - high + high - high + high - high + high - high + high - high + high - high + high diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php index 0bc7e229d21d1..fc56ae562a33a 100644 --- a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php +++ b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Html/Footer.php @@ -28,7 +28,7 @@ class Footer extends Block * * @var string */ - protected $variableSelector = './/div[contains(@class, "links")]/*[text()="%s"]'; + protected $variableSelector = './/ul[contains(@class, "links")]/*[text()="%s"]'; /** * Store group dropdown selector diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php index 010e87641c305..a5b6b384f4a03 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Category/Tree.php @@ -16,11 +16,11 @@ class Tree extends Block { /** - * Locator value for skip category button + * Locator value for skip category button * * @var string */ - protected $skipCategoryButton = '[data-ui-id="catalog-product-edit-skip-categories"]'; + protected $skipCategoryButton = '[data-ui-id$="skip-categories"]'; /** * Select category by its name diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php index 588aa7d42f74b..69b9f49957a2d 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertPageByUrlRewriteIsNotFound.php @@ -16,18 +16,15 @@ */ class AssertPageByUrlRewriteIsNotFound extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message on the product page 404 */ const NOT_FOUND_MESSAGE = 'Whoops, our bad...'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Checking the server response 404 page on frontend * diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php index 5315fc2c09c26..28575a379d660 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteCategoryInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that url rewrite category in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php index 6fe8eba8ef494..04f485d06c3bd 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteCategoryNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that category url rewrite not in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php index 5209cc0abd783..6c728817a9e71 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCategoryRedirect.php @@ -16,12 +16,9 @@ */ class AssertUrlRewriteCategoryRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert check URL rewrite category redirect diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php index da77f1fad6851..77667006006f5 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php @@ -16,12 +16,9 @@ */ class AssertUrlRewriteCustomRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert check URL rewrite custom redirect diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php index 02b3197d5cc6f..6f5fdaf774d78 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomSearchRedirect.php @@ -16,12 +16,9 @@ */ class AssertUrlRewriteCustomSearchRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created entity was found on search page 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 27c430d7cf97d..eb2a6d4cb5d17 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 @@ -14,18 +14,15 @@ */ class AssertUrlRewriteDeletedMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message that displayed after delete url rewrite */ const SUCCESS_DELETE_MESSAGE = 'The URL Rewrite has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that delete message is displayed * diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php index 7358327177ee1..766b25cf3ec5c 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that url rewrite category in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php index e180fdba27234..d85a146e49b62 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteNotInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that url rewrite not in grid diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php index b4983ca54ce68..51ca53f93fa77 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteProductRedirect.php @@ -17,12 +17,9 @@ */ class AssertUrlRewriteProductRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Check that product available by new URL on the front 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 a9bd5a53a4f33..eb2a8bfcdf1a9 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 @@ -14,14 +14,11 @@ */ class AssertUrlRewriteSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'The URL Rewrite has been saved.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'The URL Rewrite has been saved.'; /** * Assert that url rewrite success message is displayed diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php index 4126a4bf76f40..a8189399e2ac1 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteSuccessOutsideRedirect.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteSuccessOutsideRedirect extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that outside redirect was success diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php index c70641f561501..ac6a36156941b 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteUpdatedProductInGrid.php @@ -15,12 +15,9 @@ */ class AssertUrlRewriteUpdatedProductInGrid extends AbstractConstraint { - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product url in url rewrite grid. diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv index cb82ccd2b4643..dc82f30d3e7d8 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/UpdateCustomUrlRewriteEntityTest/test.csv @@ -1,3 +1,3 @@ -"initialRewrite/dataSet";"urlRewrite/data/store_id";"urlRewrite/data/request_path";"urlRewrite/data/target_path/entity";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint";"issue" -"default";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"http://www.magentocommerce.com/magento-connect/";"Permanent (301)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteSuccessOutsideRedirect";"MAGETWO-29618" -"custom_rewrite_wishlist";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"catalogsearch/result/?q=$%catalogProductSimple::defaul%sku$";"Temporary (302)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomSearchRedirect";"" +"initialRewrite/dataSet";"urlRewrite/data/store_id";"urlRewrite/data/request_path";"urlRewrite/data/target_path/entity";"urlRewrite/data/redirect_type";"urlRewrite/data/description";"constraint" +"default";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"http://www.magentocommerce.com/magento-connect/";"Permanent (301)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteSuccessOutsideRedirect" +"custom_rewrite_wishlist";"Main Website/Main Website Store/Default Store View";"wishlist/%isolation%";"catalogsearch/result/?q=$%catalogProductSimple::defaul%sku$";"Temporary (302)";"test_description_relative path";"assertUrlRewriteSaveMessage, assertUrlRewriteInGrid, assertUrlRewriteCustomSearchRedirect" diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml index 069d8b9a9756a..26dc285fc65c2 100644 --- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/etc/constraint.xml @@ -6,20 +6,20 @@ --> - low + low - low + low - low + low - low + low @@ -28,20 +28,20 @@ - low + low - low + low - low + low @@ -49,17 +49,17 @@ - low + low - low + low - low + low @@ -67,12 +67,12 @@ - low + low - low + low - low + low 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 cc9d7e29e3e74..e064d2e4e7557 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 @@ -14,18 +14,15 @@ */ class AssertAccessTokensErrorRevokeMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * User revoke tokens error message. */ const ERROR_MESSAGE = 'This user has no tokens.'; - /** - * Constraint severeness. - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error message appears after click on 'Force Sing-In' button for user without tokens. * 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 fac61dc3f854d..902dcbd20afea 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 @@ -13,14 +13,11 @@ */ class AssertImpossibleDeleteYourOwnAccount extends AbstractConstraint { - const ERROR_MESSAGE = 'You cannot delete your own account.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'You cannot delete your own account.'; /** * Asserts that error message equals to expected message. 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 29ccbe89b9e40..711fac9363133 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 @@ -13,14 +13,11 @@ */ class AssertImpossibleDeleteYourOwnRole extends AbstractConstraint { - const ERROR_MESSAGE = 'You cannot delete self-assigned roles.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'You cannot delete self-assigned roles.'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php index 217f1334e0ba8..2be0b58aad647 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php @@ -14,12 +14,9 @@ */ class AssertRoleInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that saved role is present in Role Grid. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php index 0c6c2fb70ab59..675cec9ce181b 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertRoleNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that role is not present in Role Grid. 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 d51f5ad4c946b..2f86757392e41 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 @@ -13,14 +13,11 @@ */ class AssertRoleSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_DELETE_MESSAGE = 'You deleted the role.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_DELETE_MESSAGE = 'You deleted the role.'; /** * Asserts that success delete message equals to expected message. 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 4be018c21e315..faccbb2519cec 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 @@ -13,14 +13,11 @@ */ class AssertRoleSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the role.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the role.'; /** * Asserts that success message equals to expected message. 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 1172cc335ee8f..bd0b3d36171c0 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 @@ -13,14 +13,11 @@ */ class AssertUserDuplicateMessage extends AbstractConstraint { - const ERROR_MESSAGE = 'A user with the same user name or email already exists.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'A user with the same user name or email already exists.'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php index c6751758ca15c..048570ff16cc9 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php @@ -14,12 +14,9 @@ */ class AssertUserInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that user is present in User Grid. 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 77885af492af0..19dedcba36908 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 @@ -14,14 +14,11 @@ */ class AssertUserInvalidEmailMessage extends AbstractConstraint { - const ERROR_MESSAGE = 'Please correct this email address: "%s".'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const ERROR_MESSAGE = 'Please correct this email address: "%s".'; /** * Asserts that error message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php index fecddb7e20019..7eeed200a5d32 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserNotInGrid.php @@ -14,12 +14,9 @@ */ class AssertUserNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that User is not present in User Grid. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php index c07bc23bf1ef4..fe26eca385eaf 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php @@ -14,16 +14,13 @@ */ class AssertUserRoleSalesRestrictedAccess extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + const ROLE_RESOURCE = 'sales'; const DENIED_ACCESS = 'Access denied'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Asserts that user has only Sales-related permissions * 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 15ef99d460be0..5584f1b681f0d 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 @@ -13,14 +13,11 @@ */ class AssertUserSuccessDeleteMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You deleted the user.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You deleted the user.'; /** * Asserts that success delete message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php index 65bcde1d0180a..c69e891a1a27f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogOut.php @@ -14,12 +14,9 @@ */ class AssertUserSuccessLogOut extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Asserts that 'You have logged out.' message is present on page diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php index b2a2d7f3b4b4e..c23d34ce4e94f 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php @@ -15,12 +15,9 @@ */ class AssertUserSuccessLogin extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Verify whether customer has logged in to the Backend @@ -38,6 +35,7 @@ public function processAssert( Dashboard $dashboard, User $customAdmin = null ) { + $adminAuth->open(); $adminUser = $customAdmin === null ? $user : $customAdmin; if ($dashboard->getAdminPanelHeader()->isVisible()) { $dashboard->getAdminPanelHeader()->logOut(); 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 7aa97dc66a9fc..2ac8c562eead8 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 @@ -13,14 +13,11 @@ */ class AssertUserSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_MESSAGE = 'You saved the user.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const SUCCESS_MESSAGE = 'You saved the user.'; /** * Asserts that success message equals to expected message. diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php index 1711fcb0abed9..51afc85ef97c2 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserWrongCredentialsMessage.php @@ -14,14 +14,11 @@ */ class AssertUserWrongCredentialsMessage extends AbstractConstraint { - const INVALID_CREDENTIALS_MESSAGE = 'Please correct the user name or password.'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + const INVALID_CREDENTIALS_MESSAGE = 'Please correct the user name or password.'; /** * Verify incorrect credentials message while login to admin diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php index ac4bd263bcebb..c21b6c0aa4ae7 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php +++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php @@ -33,7 +33,7 @@ public function persist(FixtureInterface $fixture = null) if ($fixture->hasData('role_id')) { $data['roles[]'] = $fixture->getDataFieldConfig('role_id')['source']->getRole()->getRoleId(); } - $data['is_active'] = (isset($data['is_active']) && ($data['is_active'] === 'Active')) ? 1 : 0; + $data['is_active'] = (isset($data['is_active']) && ($data['is_active'] === 'Inactive')) ? 0 : 1; $url = $_ENV['app_backend_url'] . 'admin/user/save/active_tab/main_section/'; $curl = new BackendDecorator(new CurlTransport(), new Config()); $curl->addOption(CURLOPT_HEADER, 1); diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv index 7872c32a2612c..178ac7b96f4ca 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest/test.csv @@ -1,7 +1,7 @@ -"user/data/username";"user/data/firstname";"user/data/lastname";"user/data/email";"user/data/password";"user/data/password_confirmation";"user/data/is_active";"user/data/role_id/dataSet";"isDuplicated";"constraint";"user/data/current_password";"issue" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserSuccessLogin"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Inactive";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q";"" -"-";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"username";"assertUserDuplicateMessage"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"-";"123123q";"123123q";"Active";"Administrators";"email";"assertUserDuplicateMessage"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"-";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q";"" -"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.cim";"123123q";"123123q";"Active";"-";"-";"assertUserInvalidEmailMessage"; "123123q";"Bug: MAGETWO-28875" +"user/data/username";"user/data/firstname";"user/data/lastname";"user/data/email";"user/data/password";"user/data/password_confirmation";"user/data/is_active";"user/data/role_id/dataSet";"isDuplicated";"constraint";"user/data/current_password" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserSuccessLogin"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Inactive";"Administrators";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q" +"-";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"Administrators";"username";"assertUserDuplicateMessage"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"-";"123123q";"123123q";"Active";"Administrators";"email";"assertUserDuplicateMessage"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.com";"123123q";"123123q";"Active";"-";"-";"assertUserSuccessSaveMessage, assertUserInGrid, assertUserSuccessLogOut, assertUserWrongCredentialsMessage"; "123123q" +"AdminUser%isolation%";"FirstName%isolation%";"LastName%isolation%";"email%isolation%@example.cim";"123123q";"123123q";"Active";"-";"-";"assertUserInvalidEmailMessage"; "123123q" diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv index 40e2c721a2b66..a90ad495b8a14 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv +++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest/testUpdateAdminUserRolesEntity.csv @@ -1,3 +1,3 @@ -"user/dataSet";"role/data/rolename";"role/data/resource_access";"role/data/roles_resources";"role/data/in_role_users/dataSet";"constraint";"issue" -"custom_admin_with_default_role";"NewAdminRole%isolation%";"-";"-";"-";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin";"" -"default";"-";"Custom";"Sales";"custom_admin";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin, assertUserRoleSalesRestrictedAccess";"Bug: MAGETWO-28587" +"user/dataSet";"role/data/rolename";"role/data/resource_access";"role/data/roles_resources";"role/data/in_role_users/dataSet";"constraint" +"custom_admin_with_default_role";"NewAdminRole%isolation%";"-";"-";"-";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin" +"default";"-";"Custom";"Sales";"custom_admin";"assertRoleSuccessSaveMessage, assertRoleInGrid, assertUserSuccessLogOut, assertUserSuccessLogin, assertUserRoleSalesRestrictedAccess" diff --git a/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml index 5ed3437f673f2..972e9665d4b15 100644 --- a/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/User/Test/etc/constraint.xml @@ -6,7 +6,7 @@ --> - low + low @@ -15,102 +15,102 @@ - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageCurrentlyPublishedRevision.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageCurrentlyPublishedRevision.php index 1972a2ca9be65..305e2a1e1acc7 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageCurrentlyPublishedRevision.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageCurrentlyPublishedRevision.php @@ -17,12 +17,9 @@ */ class AssertCmsPageCurrentlyPublishedRevision extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert that link to Currently Published Revision on CMS Page Information Form is available diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageInitialVersionInGrid.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageInitialVersionInGrid.php index 108aa3c1e2e66..836d562a60754 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageInitialVersionInGrid.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageInitialVersionInGrid.php @@ -16,12 +16,9 @@ */ class AssertCmsPageInitialVersionInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * CmsNew Page diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageNewVersionSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageNewVersionSuccessSaveMessage.php index bb655fec01f99..95b9f7ae7d979 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageNewVersionSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageNewVersionSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageNewVersionSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * New version success save message */ const SUCCESS_SAVE_MESSAGE = 'You have created the new version.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after new CMS page version save successful message appears * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionErrorDeleteMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionErrorDeleteMessage.php index 42097c3a004b8..85830068b9dad 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionErrorDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionErrorDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageRevisionErrorDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const ERROR_DELETE_MESSAGE = 'Revision #%d could not be removed because it is published.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that error delete message is displayed on the page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionInGrid.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionInGrid.php index 4e7a33054a842..b3371444c367b 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionInGrid.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionInGrid.php @@ -17,12 +17,9 @@ */ class AssertCmsPageRevisionInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS page revision can be found in CMS page Version Revisions grid diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionNotInGrid.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionNotInGrid.php index b50a39f6f84c2..b08b229f1848a 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionNotInGrid.php @@ -17,12 +17,9 @@ */ class AssertCmsPageRevisionNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS page revision can not be found in CMS page Version Revisions grid diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionPreview.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionPreview.php index bdbc4fe6fd937..5f82bc484090d 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionPreview.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionPreview.php @@ -20,12 +20,9 @@ */ class AssertCmsPageRevisionPreview extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS page revision content can be found in CMS page revisions preview diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessMassDeleteMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessMassDeleteMessage.php index fc7cb840a79b8..ae94f521de74e 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessMassDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessMassDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageRevisionSuccessMassDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MASS_DELETE_MESSAGE = 'A total of %d record(s) have been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; - /** * Assert that success mass delete message is displayed on the page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessPublishMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessPublishMessage.php index ce8dd9983fc4f..2f06d1c42fc20 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessPublishMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessPublishMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageRevisionSuccessPublishMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_PUBLISH_MESSAGE = 'You have published the revision.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert success publish message is displayed on the page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessSaveMessage.php index 2eaa0fdd72798..b89c6c02cb3fd 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageRevisionSuccessSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageRevisionSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'high'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_SAVE_MESSAGE = 'You have saved the revision.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; - /** * Assert that success save message is displayed on the CmsVersionEdit page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorDeleteMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorDeleteMessage.php index 963298bb5115d..204875ecd2f41 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageVersionErrorDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ + /** * Text value to be checked */ const ERROR_DELETE_MESSAGE = 'Version "%s" cannot be removed because its revision is published.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; - /** * Assert that error delete message is displayed on the page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorSaveMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorSaveMessage.php index 8a06d829065df..f2115885225e8 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionErrorSaveMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageVersionErrorSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Save error message */ const ERROR_SAVE_MESSAGE = 'Cannot change version access level because it is the last public version for its page.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that after change access level of last public version to private error message appears * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionInGrid.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionInGrid.php index ff8dcfe05b79c..400d7f3bd843c 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionInGrid.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionInGrid.php @@ -15,12 +15,9 @@ */ class AssertCmsPageVersionInGrid extends AssertCmsPageInitialVersionInGrid { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ /** * Assert that created CMS page version can be found on CMS page Versions tab in grid via: diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionNotInGrid.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionNotInGrid.php index eee465db2e346..48e05b7276ab5 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionNotInGrid.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionNotInGrid.php @@ -16,12 +16,9 @@ */ class AssertCmsPageVersionNotInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created CMS page version can not be found on CMS page Versions tab in grid diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessDeleteMessage.php index 772c4f08909e7..c35681a7c6201 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageVersionSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'You have deleted the version.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; - /** * Assert that success delete message is displayed on the page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessMassDeleteMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessMassDeleteMessage.php index ccdbc39355a64..cf387dfb67d28 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessMassDeleteMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessMassDeleteMessage.php @@ -14,18 +14,15 @@ */ class AssertCmsPageVersionSuccessMassDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'medium'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_DELETE_MESSAGE = 'A total of %d record(s) have been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'medium'; - /** * Assert that success delete message is displayed on the page * diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessSaveMessage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessSaveMessage.php index 5e1ab506b69c7..baedf33fff68c 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessSaveMessage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertCmsPageVersionSuccessSaveMessage.php @@ -14,14 +14,11 @@ */ class AssertCmsPageVersionSuccessSaveMessage extends AbstractConstraint { - const SUCCESS_SAVE_MESSAGE = 'You have saved the version.'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + const SUCCESS_SAVE_MESSAGE = 'You have saved the version.'; /** * Assert that success save message is displayed on the page diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertWidgetHierarchyNodeLinkOnHomePage.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertWidgetHierarchyNodeLinkOnHomePage.php index 2aa4f612e6d55..44732220dec0c 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertWidgetHierarchyNodeLinkOnHomePage.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/Constraint/AssertWidgetHierarchyNodeLinkOnHomePage.php @@ -16,12 +16,9 @@ */ class AssertWidgetHierarchyNodeLinkOnHomePage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that widget hierarchy node link is present on Home page and after click to link widget redirects to page diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForExistingCmsPageTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForExistingCmsPageTest.php index f8cd8837d1582..6c808644a3ea7 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForExistingCmsPageTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForExistingCmsPageTest.php @@ -64,14 +64,10 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew) * * @param CmsPage $cmsInitial * @param CmsPage $cms - * @param array $results * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function test(CmsPage $cmsInitial, CmsPage $cms, array $results) + public function test(CmsPage $cmsInitial, CmsPage $cms) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Precondition $cmsInitial->persist(); // Steps diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForNewCmsPageTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForNewCmsPageTest.php index 289184ba05f99..2a46720972ead 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForNewCmsPageTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateCmsPageVersionsEntityForNewCmsPageTest.php @@ -58,14 +58,10 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew) * Create CMS Page Version Entity * * @param CmsPage $cms - * @param array $results * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function test(CmsPage $cms, array $results) + public function test(CmsPage $cms) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Steps $this->cmsIndex->open(); $this->cmsIndex->getPageActionsBlock()->addNew(); diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateWidgetHierarchyNodeLinkTest/test.csv b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateWidgetHierarchyNodeLinkTest/test.csv index 5ec3dce43f4b8..2ba8abbd7415f 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateWidgetHierarchyNodeLinkTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/CreateWidgetHierarchyNodeLinkTest/test.csv @@ -1,2 +1,2 @@ -"widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint";"issue" -"hierarchyNodeLink";"CMS Hierarchy Node Link";"Magento Blank";"Title_%isolation%";"All Store Views";"all_pages";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetHierarchyNodeLinkOnHomePage";"Bug: MAGETWO-28346" +"widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint"; +"hierarchyNodeLink";"CMS Hierarchy Node Link";"Magento Blank";"Title_%isolation%";"All Store Views";"all_pages";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetHierarchyNodeLinkOnHomePage"; diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/DeleteCmsPageVersionsEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/DeleteCmsPageVersionsEntityTest.php index dc3a6d66afde2..87a3732ca9869 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/DeleteCmsPageVersionsEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/DeleteCmsPageVersionsEntityTest.php @@ -84,7 +84,6 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew, CmsVersionEdit $cms */ public function test(CmsPage $cms, Version $version, array $results, $initialVersionToDelete) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Precondition $cms->persist(); $filter = ['title' => $cms->getTitle()]; diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsPageRevisionEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsPageRevisionEntityTest.php index 700f6a98e6432..bc0358df61c2c 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsPageRevisionEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsPageRevisionEntityTest.php @@ -115,7 +115,6 @@ public function __inject( */ public function test(CmsPage $cms, Revision $revision, array $results, $initialRevision) { - $this->markTestIncomplete('Bug: MAGETWO-27326, Bug: MAGETWO-28876, Bug: MAGETWO-30362'); // Precondition $filter = ['title' => $cms->getTitle()]; $this->cmsIndex->open(); diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsVersionsEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsVersionsEntityTest.php index 0b95e3a5c06bb..64001669ed0bf 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsVersionsEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/MassDeleteCmsVersionsEntityTest.php @@ -85,7 +85,6 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew, CmsVersionEdit $cms */ public function test(CmsPage $cms, Version $version, array $results, $initialVersionToDelete) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Precondition $cms->persist(); $filter = ['title' => $cms->getTitle()]; diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/PublishCmsPageRevisionEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/PublishCmsPageRevisionEntityTest.php index a583c341f6870..00852a2933a9b 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/PublishCmsPageRevisionEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/PublishCmsPageRevisionEntityTest.php @@ -108,14 +108,10 @@ public function __inject( * @param CmsPage $cms * @param Revision $revision * @param int $initialRevision - * @param array $results * @return void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function test(CmsPage $cms, Revision $revision, $initialRevision, array $results) + public function test(CmsPage $cms, Revision $revision, $initialRevision) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Steps $this->cmsIndex->open(); $title = $cms->getTitle(); diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewRevisionInNewVersionTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewRevisionInNewVersionTest.php index a3bad07aa7c20..105902af69c7f 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewRevisionInNewVersionTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewRevisionInNewVersionTest.php @@ -96,7 +96,6 @@ public function __inject( */ public function test(CmsPage $cms, Revision $revision, array $revisionData, array $results) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Precondition: $cms->persist(); $title = $cms->getTitle(); diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewVersionOfVersionsCmsEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewVersionOfVersionsCmsEntityTest.php index f5716756bbd40..5adf5161c5451 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewVersionOfVersionsCmsEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/SaveNewVersionOfVersionsCmsEntityTest.php @@ -79,7 +79,6 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew, CmsVersionEdit $cms */ public function test(CmsPage $cms, Version $version, $quantity) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Preconditions: $cms->persist(); diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageRevisionEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageRevisionEntityTest.php index dd9efa48cfc2a..f287eaf9e99a4 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageRevisionEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageRevisionEntityTest.php @@ -96,7 +96,6 @@ public function __inject( */ public function test(CmsPage $cms, Revision $revision, array $revisionData, array $results) { - $this->markTestIncomplete('Bug: MAGETWO-28602, Bug: MAGETWO-28876, Bug: MAGETWO-30362'); // Precondition: $cms->persist(); $title = $cms->getTitle(); diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageVersionsEntityTest.php b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageVersionsEntityTest.php index f0871fb70ea8a..ad3d0e8f310bf 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageVersionsEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/TestCase/UpdateCmsPageVersionsEntityTest.php @@ -82,7 +82,6 @@ public function __inject(CmsIndex $cmsIndex, CmsNew $cmsNew, CmsVersionEdit $cms */ public function test(CmsPage $cms, Version $version, $quantity) { - $this->markTestIncomplete("Bug: MAGETWO-30362"); // Precondition $cms->persist(); // Steps diff --git a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/etc/constraint.xml index df9479e71b134..5ed5375efab05 100644 --- a/dev/tests/functional/tests/app/Magento/VersionsCms/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/VersionsCms/Test/etc/constraint.xml @@ -6,7 +6,7 @@ --> - high + high @@ -14,7 +14,7 @@ - medium + medium @@ -22,7 +22,7 @@ - low + low @@ -31,25 +31,25 @@ - high + high - medium + medium - medium + medium - low + low @@ -57,19 +57,19 @@ - medium + medium - medium + medium - low + low @@ -78,13 +78,13 @@ - low + low - low + low @@ -93,19 +93,19 @@ - high + high - high + high - high + high @@ -117,24 +117,24 @@ - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php index 0321f29538d26..260260a4d978e 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/Block/Cart/Totals.php @@ -17,7 +17,7 @@ class Totals extends \Magento\Checkout\Test\Block\Cart\Totals * * @var string */ - protected $fptBlock = './/tr[normalize-space(td)="FPT"]'; + protected $fptBlock = './/tr[normalize-space(th)="FPT"]'; /** * Get block fpt totals diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv index 3d36f615ecbc4..4679509ffa9fb 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/TestCase/CreateTaxWithFptTest/test.csv @@ -1,12 +1,12 @@ -"description";"config/dataSet";"productData";"prices/category_price";"prices/fpt_category";"prices/fpt_total_category";"prices/product_page_price";"prices/product_page_fpt";"prices/product_page_fpt_total";"prices/cart_item_price";"prices/cart_item_fpt";"prices/cart_item_fpt_total";"prices/cart_item_subtotal";"prices/cart_item_subtotal_fpt";"prices/cart_item_subtotal_fpt_total";"prices/grand_total";"prices/total_fpt";"constraint";"issue" -"Check not taxed FPT display set to Excluding, Description and Including FPT on product with custom option catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_excl";"with_custom_option_and_fpt";"70.00";"10.00";"80.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"118.25";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check not taxed FPT display set to Including FPT and Description on product with custom option catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_incl";"with_custom_option_and_fpt";"80.00";"10.00";"";"100.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"118.25";"10.00";"assertFptApplied";"" -"Check not taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_incl";"with_special_price_and_fpt";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"118.25";"10.00";"assertFptApplied";"" -"Check not taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_excl";"with_special_price_and_fpt";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"118.25";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with with custom option catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_excl";"with_custom_option_and_fpt";"70.00";"10.00";"80.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"119.08";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Including FPT and Description on product with with custom option catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_incl";"with_custom_option_and_fpt";"80.00";"10.00";"";"100.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"119.08";"10.00";"assertFptApplied";"" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_incl";"with_special_price_and_fpt";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"119.08";"10.00";"assertFptApplied";"" -"Check taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_excl";"with_special_price_and_fpt";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"119.08";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with with special price and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_excl";"with_special_price_and_fpt";"82.38";"10.00";"92.38";"82.38";"10.00";"92.38";"92.38";"9.24";"101.62";"92.38";"9.24";"101.62";"110.00";"10.00";"assertFptApplied";"MAGETWO-29617" -"Check taxed FPT display set to Including FPT and Description on product with with special price and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_incl";"with_special_price_and_fpt";"92.38";"10.00";"";"92.38";"10.00";"";"101.62";"9.24";"";"101.62";"9.24";"";"110.00";"10.00";"assertFptApplied";"" -"Check taxed FPT display set to Excluding, Description and Including FPT on product with with custom option and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_excl";"with_custom_option_and_fpt";"54.67";"10.00";"64.67";"82.38";"10.00";"92.38";"92.38";"9.24";"101.62";"92.38";"9.24";"101.62";"110.00";"10.00";"assertFptApplied";"MAGETWO-29617" +"description";"config/dataSet";"productData";"prices/category_price";"prices/fpt_category";"prices/fpt_total_category";"prices/product_page_price";"prices/product_page_fpt";"prices/product_page_fpt_total";"prices/cart_item_price";"prices/cart_item_fpt";"prices/cart_item_fpt_total";"prices/cart_item_subtotal";"prices/cart_item_subtotal_fpt";"prices/cart_item_subtotal_fpt_total";"prices/grand_total";"prices/total_fpt";"constraint" +"Check not taxed FPT display set to Excluding, Description and Including FPT on product with custom option catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_excl";"with_custom_option_and_fpt";"70.00";"10.00";"80.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"118.25";"10.00";"assertFptApplied" +"Check not taxed FPT display set to Including FPT and Description on product with custom option catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_incl";"with_custom_option_and_fpt";"80.00";"10.00";"";"100.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"118.25";"10.00";"assertFptApplied" +"Check not taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_incl";"with_special_price_and_fpt";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"118.25";"10.00";"assertFptApplied" +"Check not taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax";"tax_with_fpt_cat_excl_disp_excl";"with_special_price_and_fpt";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"118.25";"10.00";"assertFptApplied" +"Check taxed FPT display set to Excluding, Description and Including FPT on product with with custom option catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_excl";"with_custom_option_and_fpt";"70.00";"10.00";"80.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"119.08";"10.00";"assertFptApplied" +"Check taxed FPT display set to Including FPT and Description on product with with custom option catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_incl";"with_custom_option_and_fpt";"80.00";"10.00";"";"100.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"119.08";"10.00";"assertFptApplied" +"Check taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_incl";"with_special_price_and_fpt";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"110.00";"10.00";"";"119.08";"10.00";"assertFptApplied" +"Check taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax";"tax_with_fpt_taxed_cat_excl_disp_excl";"with_special_price_and_fpt";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"100.00";"10.00";"110.00";"119.08";"10.00";"assertFptApplied" +"Check taxed FPT display set to Excluding, Description and Including FPT on product with with special price and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_excl";"with_special_price_and_fpt";"82.38";"10.00";"92.38";"82.38";"10.00";"92.38";"92.38";"9.24";"101.62";"92.38";"9.24";"101.62";"110.00";"10.00";"assertFptApplied" +"Check taxed FPT display set to Including FPT and Description on product with with special price and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_incl";"with_special_price_and_fpt";"92.38";"10.00";"";"92.38";"10.00";"";"101.62";"9.24";"";"101.62";"9.24";"";"110.00";"10.00";"assertFptApplied" +"Check taxed FPT display set to Excluding, Description and Including FPT on product with with custom option and catalog price Including Tax";"tax_with_fpt_taxed_cat_incl_disp_excl";"with_custom_option_and_fpt";"54.67";"10.00";"64.67";"82.38";"10.00";"92.38";"92.38";"9.24";"101.62";"92.38";"9.24";"101.62";"110.00";"10.00";"assertFptApplied" diff --git a/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml index 2d842994ffe22..a42ea7838bb7a 100644 --- a/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Weee/Test/etc/constraint.xml @@ -6,6 +6,6 @@ --> - high + high diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetAbsentOnFrontendHome.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetAbsentOnFrontendHome.php index 806206bc1959d..405acf41ba9af 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetAbsentOnFrontendHome.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetAbsentOnFrontendHome.php @@ -15,12 +15,9 @@ */ class AssertWidgetAbsentOnFrontendHome extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created widget is absent on frontend on Home page diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCatalogCategoryLink.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCatalogCategoryLink.php index b280c09402c31..f44ef46cc2fa9 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCatalogCategoryLink.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCatalogCategoryLink.php @@ -17,12 +17,9 @@ */ class AssertWidgetCatalogCategoryLink extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created widget displayed on frontend on Home page and on Advanced Search and diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCmsPageLink.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCmsPageLink.php index 2a22d3270090f..9bc9e0ef690e8 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCmsPageLink.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetCmsPageLink.php @@ -16,12 +16,9 @@ */ class AssertWidgetCmsPageLink extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created widget displayed on frontent on Home page and on Advanced Search and diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetInGrid.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetInGrid.php index 380b615200698..a2e790a66c587 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetInGrid.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetInGrid.php @@ -14,12 +14,9 @@ */ class AssertWidgetInGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'high'; + /* tags */ + const SEVERITY = 'high'; + /* end tags */ /** * Assert widget availability in widget grid diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnFrontendInCatalog.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnFrontendInCatalog.php index ae0448fa5e865..df91033ad3954 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnFrontendInCatalog.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnFrontendInCatalog.php @@ -16,12 +16,9 @@ */ class AssertWidgetOnFrontendInCatalog extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created widget displayed on frontent in Catalog diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnProductPage.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnProductPage.php index 2bd23bb219aed..1010268c9d7f5 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnProductPage.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetOnProductPage.php @@ -16,12 +16,9 @@ */ class AssertWidgetOnProductPage extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that created widget displayed on frontend on Product page diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetProductLink.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetProductLink.php index 33b0d44dfbd6d..b0b50f459dc82 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetProductLink.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetProductLink.php @@ -16,12 +16,9 @@ */ class AssertWidgetProductLink extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that after click on widget link on frontend system redirects you to Product page defined in widget diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetRecentlyViewedProducts.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetRecentlyViewedProducts.php index 5c68b4306eef1..690af8cac881f 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetRecentlyViewedProducts.php +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Constraint/AssertWidgetRecentlyViewedProducts.php @@ -19,6 +19,10 @@ */ class AssertWidgetRecentlyViewedProducts extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Browser * @@ -40,13 +44,6 @@ class AssertWidgetRecentlyViewedProducts extends AbstractConstraint */ protected $catalogCategoryView; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that widget with type Recently Viewed Products is present on category page * 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 27736a383bc72..0c5cb327e8ed1 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 @@ -13,18 +13,15 @@ */ class AssertWidgetSuccessDeleteMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Message displayed after delete widget */ const DELETE_MESSAGE = 'The widget instance has been deleted.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that Widget success delete message is present * 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 b03865b5d8349..7c0da8dbfd838 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 @@ -13,18 +13,15 @@ */ class AssertWidgetSuccessSaveMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Text value to be checked */ const SUCCESS_MESSAGE = 'The widget instance has been saved.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after widget saved * diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest/test.csv b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest/test.csv index ca8eb8d1ee3b4..8dae6eddd27d4 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest/test.csv +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/CreateWidgetEntityTest/test.csv @@ -1,6 +1,6 @@ "widget/data/widgetOptions/preset";"widget/data/code";"widget/data/theme_id";"widget/data/title";"widget/data/store_ids/dataSet";"widget/data/layout/preset";"constraint";"issue" "cmsStaticBlock";"CMS Static Block";"Magento Blank";"Title_%isolation%";"All Store Views";"on_category";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetOnFrontendInCatalog";"" -"cmsPageLink";"CMS Page Link";"Magento Blank";"Title_%isolation%";"All Store Views";"for_cms_page_link";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetCmsPageLink";"Bug: MAGETWO-31062" +"cmsPageLink";"CMS Page Link";"Magento Blank";"Title_%isolation%";"All Store Views";"for_cms_page_link";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetCmsPageLink";"" "recentlyViewedProducts";"Recently Viewed Products";"Magento Blank";"Title_%isolation%";"All Store Views";"for_viewed_products";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetRecentlyViewedProducts";"Bug: MAGETWO-17189" "recentlyComparedProducts";"Recently Compared Products";"Magento Blank";"Title_%isolation%";"All Store Views";"for_compared_products";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetRecentlyComparedProducts";"Bug: MAGETWO-17189" "catalogCategoryLink";"Catalog Category Link";"Magento Blank";"Title_%isolation%";"All Store Views";"for_category_link";"assertWidgetSuccessSaveMessage, assertWidgetInGrid, assertWidgetCatalogCategoryLink";"" diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/constraint.xml index 7990881930b57..e9dcb69f567c6 100644 --- a/dev/tests/functional/tests/app/Magento/Widget/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Widget/Test/etc/constraint.xml @@ -6,36 +6,36 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php index 274d23169e349..c2374e20b52ae 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Customer/Edit/Tab/Wishlist/Grid.php @@ -105,9 +105,6 @@ protected function getRow(array $filter, $isSearchable = true, $isStrict = true) } $location = '//div[@class="grid"]//tr['; $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; - if ($isStrict) { - $rowTemplate = 'td[text()[normalize-space()="%s"]]'; - } $rows = []; foreach ($filter as $value) { $rows[] = sprintf($rowTemplate, $value); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml index 6bf8bbb220023..3bca952aecf22 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Block/Adminhtml/Edit/CustomerForm.xml @@ -7,7 +7,7 @@ \Magento\Wishlist\Test\Block\Adminhtml\Customer\Edit\Tab\Wishlist - #customer_info_tabs_wishlist + #tab_wishlist css selector 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 077ab523f5f9a..2d0905f33ddbb 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 @@ -15,18 +15,15 @@ */ class AssertAddProductToWishlistSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success add message */ const SUCCESS_MESSAGE = "%s has been added to your wishlist. Click here to continue shopping."; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears on My Wish List page after adding product to wishlist. * 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 a7b13e8bffb64..cc28d74f53f43 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 @@ -15,18 +15,15 @@ */ class AssertMoveProductToWishlistSuccessMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success add message */ const SUCCESS_MESSAGE = "%s has been moved to wish list Wish List"; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message appears on My Wish List page after moving product to wishlist. * diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php index 64881ef289947..23765d99f718e 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php @@ -17,12 +17,9 @@ */ class AssertProductDetailsInWishlist extends AbstractAssertForm { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that the correct option details are displayed on the "View Details" tool tip @@ -44,7 +41,10 @@ public function processAssert( $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]); $expectedOptions = $cartFixture->getItems()[0]->getData()['options']; - $errors = $this->verifyData($expectedOptions, $actualOptions); + $errors = $this->verifyData( + $this->sortDataByPath($expectedOptions, '::title'), + $this->sortDataByPath($actualOptions, '::title') + ); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php index a210f017074e1..aec67bef8064c 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductInCustomerWishlistOnBackendGrid.php @@ -16,12 +16,9 @@ */ class AssertProductInCustomerWishlistOnBackendGrid extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in grid on customer's wish list tab with configure option and qty diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php index 711732e33f1c8..c664bfbbc42e2 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php @@ -18,12 +18,9 @@ */ class AssertProductIsPresentInCustomerBackendWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that products added to wishlist are present on Customers account on backend. @@ -47,7 +44,7 @@ public function processAssert( $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock(); \PHPUnit_Framework_Assert::assertTrue( - $wishlistGrid->isRowVisible(['product_name' => $product->getName()]), + $wishlistGrid->isRowVisible(['product_name' => $product->getName()], true, false), $product->getName() . " is not visible in customer wishlist on backend." ); } diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php index d4c007777e994..d6c6854ac8604 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php @@ -17,12 +17,9 @@ */ class AssertProductIsPresentInWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is present in default wishlist diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php index cf330dc751a05..b5df2c1b8ef75 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php @@ -20,12 +20,9 @@ */ class AssertProductsIsAbsentInWishlist extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert that product is not present in Wishlist on Frontend diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php index 5ae0070689bb9..ef833626c2015 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php @@ -15,12 +15,9 @@ */ class AssertWishlistIsEmpty extends AbstractConstraint { - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; + /* tags */ + const SEVERITY = 'low'; + /* end tags */ /** * Assert wish list is empty 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 7bf0348b1c77d..a66a7b74c8dad 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 @@ -14,18 +14,15 @@ */ class AssertWishlistShareMessage extends AbstractConstraint { + /* tags */ + const SEVERITY = 'low'; + /* end tags */ + /** * Success wishlist share message */ const SUCCESS_MESSAGE = 'Your wish list has been shared.'; - /** - * Constraint severeness - * - * @var string - */ - protected $severeness = 'low'; - /** * Assert that success message is displayed after wishlist has been shared * diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php index cd11872300b69..522d3c3196a0e 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php @@ -49,7 +49,6 @@ public function __prepare(CustomerInjectable $customer) */ public function test(CustomerInjectable $customer, $product) { - $this->markTestIncomplete('Bug: MAGETWO-27949'); $product = $this->createProducts($product)[0]; // Steps: diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php index 2b20ff511881b..4d6ff6c1cb4fb 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php @@ -48,7 +48,6 @@ class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishli */ public function test(CustomerInjectable $customer, $products, $qty, Browser $browser) { - $this->markTestIncomplete("Bug: MAGETWO-30097"); // Preconditions $this->browser = $browser; $customer->persist(); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php index 1fc45be9613fc..bcc6085617b8a 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php @@ -52,7 +52,6 @@ public function __prepare(CustomerInjectable $customer) */ public function test(CustomerInjectable $customer, $product) { - $this->markTestIncomplete("Bug: MAGETWO-30097"); // Preconditions $product = $this->createProducts($product)[0]; $this->loginCustomer($customer); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php index 9eeef2b4ef674..d0d161d526f3f 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/DeleteProductFromCustomerWishlistOnBackendTest.php @@ -61,7 +61,6 @@ public function test( CustomerIndex $customerIndex, CustomerIndexEdit $customerIndexEdit ) { - $this->markTestIncomplete('MAGETWO-27949'); //Preconditions $product = $this->createProducts($product)[0]; $this->loginCustomer($customer); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php index b4a26725034cf..8c83fe2fff1b8 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php @@ -155,7 +155,6 @@ public function test( CatalogProductSimple $product, array $sharingInfo ) { - $this->markTestIncomplete("Bug: MAGETWO-30105"); //Steps $this->loginCustomer($customer); $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php index 21feb4148be38..6a19b5be336fe 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.php @@ -59,8 +59,6 @@ public function test( CustomerIndex $customerIndex, CustomerIndexEdit $customerIndexEdit ) { - $this->markTestIncomplete('Bug: MAGETWO-27949'); - // Preconditions $product = $this->createProducts($product)[0]; $this->loginCustomer($customer); diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml index 0cf6e50c1a28b..b2437571725eb 100644 --- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml +++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/etc/constraint.xml @@ -6,30 +6,30 @@ --> - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low - low + low diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php index 37512122ab9de..b9b75cf577c2f 100644 --- a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests.php @@ -96,12 +96,12 @@ private function initObjectManager() ? $_ENV['configuration:Mtf/TestSuite/InjectableTests'] : 'basic'; $confFilePath = __DIR__ . '/InjectableTests/' . $configurationFileName . '.xml'; - $testRunnerConfiguration = new Configuration(); + /** @var \Mtf\TestRunner\Configuration $testRunnerConfiguration */ + $testRunnerConfiguration = $objectManagerFactory->getObjectManager()->get('\Mtf\TestRunner\Configuration'); $testRunnerConfiguration->load($confFilePath); + $testRunnerConfiguration->loadEnvConfig(); - $shared = [ - 'Mtf\TestRunner\Configuration' => $testRunnerConfiguration, - ]; + $shared = ['Mtf\TestRunner\Configuration' => $testRunnerConfiguration]; $this->objectManager = $objectManagerFactory->create($shared); } } diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml index 32fb471707c2d..045bf10e7ef22 100644 --- a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/basic.xml @@ -6,10 +6,10 @@ --> - + - Magento - injectable + + - + diff --git a/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/installation.xml b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/installation.xml new file mode 100644 index 0000000000000..e4d2fbca97b05 --- /dev/null +++ b/dev/tests/functional/testsuites/Mtf/TestSuite/InjectableTests/installation.xml @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/Cache.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/Cache.php new file mode 100644 index 0000000000000..d0962a6ba7fef --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/Cache.php @@ -0,0 +1,131 @@ +getAnnotations(); + if (isset($source['method']['magentoCache'])) { + $annotations = $source['method']['magentoCache']; + } elseif (isset($source['class']['magentoCache'])) { + $annotations = $source['class']['magentoCache']; + } else { + return; + } + $this->setValues($this->parseValues($annotations, $test), $test); + } + + /** + * Handler for 'endTest' event + * + * @param \PHPUnit_Framework_TestCase $test + * @return void + */ + public function endTest(\PHPUnit_Framework_TestCase $test) + { + if ($this->origValues) { + $this->setValues($this->origValues, $test); + $this->origValues = []; + } + } + + /** + * Determines from docblock annotations which cache types to set + * + * @param array $annotations + * @param \PHPUnit_Framework_TestCase $test + * @return array + */ + private function parseValues($annotations, \PHPUnit_Framework_TestCase $test) + { + $result = []; + $typeList = self::getTypeList(); + foreach ($annotations as $subject) { + if (!preg_match('/^([a-z_]+)\s(enabled|disabled)$/', $subject, $matches)) { + self::fail("Invalid @magentoCache declaration: '{$subject}'", $test); + } + list(, $requestedType, $isEnabled) = $matches; + $isEnabled = $isEnabled == 'enabled' ? 1 : 0; + if ('all' === $requestedType) { + $result = []; + foreach ($typeList->getTypes() as $type) { + $result[$type['id']] = $isEnabled; + } + } else { + $result[$requestedType] = $isEnabled; + } + } + return $result; + } + + /** + * Sets the values of cache types + * + * @param array $values + * @param \PHPUnit_Framework_TestCase $test + */ + private function setValues($values, \PHPUnit_Framework_TestCase $test) + { + $typeList = self::getTypeList(); + if (!$this->origValues) { + $this->origValues = []; + foreach ($typeList->getTypes() as $type => $row) { + $this->origValues[$type] = $row['status']; + } + } + /** @var \Magento\Framework\App\Cache\StateInterface $states */ + $states = Bootstrap::getInstance()->getObjectManager()->get('Magento\Framework\App\Cache\StateInterface'); + foreach ($values as $type => $isEnabled) { + if (!isset($this->origValues[$type])) { + self::fail("Unknown cache type specified: '{$type}' in @magentoCache", $test); + } + $states->setEnabled($type, $isEnabled); + } + } + + /** + * Getter for cache types list + * + * @return \Magento\Framework\App\Cache\TypeListInterface + */ + private static function getTypeList() + { + return Bootstrap::getInstance()->getObjectManager()->get('Magento\Framework\App\Cache\TypeListInterface'); + } + + /** + * Fails the test with specified error message + * + * @param string $message + * @param \PHPUnit_Framework_TestCase $test + * @throws \Exception + */ + private static function fail($message, \PHPUnit_Framework_TestCase $test) + { + $test->fail("{$message} in the test '{$test->toString()}'"); + throw new \Exception('The above line was supposed to throw an exception.'); + } +} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php index d1cf52c0ad8b6..f5bb55aa9639f 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php @@ -102,7 +102,8 @@ protected function _assignConfigData(\PHPUnit_Framework_TestCase $test) if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) { /* Store-scoped config value */ $storeCode = $matches[0] != 'current' ? $matches[0] : null; - list(, $configPath, $requiredValue) = preg_split('/\s+/', $configPathAndValue, 3); + $parts = preg_split('/\s+/', $configPathAndValue, 3); + list(, $configPath, $requiredValue) = $parts + ['', '', '']; $originalValue = $this->_getConfigValue($configPath, $storeCode); $this->_storeConfigValues[$storeCode][$configPath] = $originalValue; $this->_setConfigValue($configPath, $requiredValue, $storeCode); diff --git a/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php b/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php index 58a551f8d54c1..f6fc10bb3c4d8 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php @@ -50,6 +50,7 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati new \Magento\TestFramework\Workaround\Cleanup\TestCaseProperties(), new \Magento\TestFramework\Workaround\Cleanup\StaticProperties(), new \Magento\TestFramework\Isolation\WorkingDirectory(), + new \Magento\TestFramework\Isolation\DeploymentConfig(), new \Magento\TestFramework\Annotation\AppIsolation($application), new \Magento\TestFramework\Event\Transaction( new \Magento\TestFramework\EventManager( @@ -60,6 +61,7 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati ) ), new \Magento\TestFramework\Annotation\AppArea($application), + new \Magento\TestFramework\Annotation\Cache($application), new \Magento\TestFramework\Annotation\ConfigFixture(), new \Magento\TestFramework\Annotation\AdminConfigFixture() ]; diff --git a/dev/tests/integration/framework/Magento/TestFramework/Isolation/DeploymentConfig.php b/dev/tests/integration/framework/Magento/TestFramework/Isolation/DeploymentConfig.php new file mode 100644 index 0000000000000..fde5833296801 --- /dev/null +++ b/dev/tests/integration/framework/Magento/TestFramework/Isolation/DeploymentConfig.php @@ -0,0 +1,68 @@ +reader) { + $this->reader = Bootstrap::getObjectManager()->get('Magento\Framework\App\DeploymentConfig\Reader'); + $this->config = $this->reader->load(); + } + } + + /** + * Checks if deployment configuration has been changed by a test + * + * Changing deployment configuration violates isolation between tests, so further tests may become broken. + * To fix this issue, find out why this test changes deployment configuration. + * If this is intentional, then it must be reverted to the previous state within the test. + * After that, the application needs to be wiped out and reinstalled. + * + * @param \PHPUnit_Framework_TestCase $test + * @return void + */ + public function endTest(\PHPUnit_Framework_TestCase $test) + { + $config = $this->reader->load(); + if ($this->config != $config) { + $error = "\n\nERROR: deployment configuration is corrupted. The application state is no longer valid.\n" + . 'Further tests may fail.' + . " This test failure may be misleading, if you are re-running it on a corrupted application.\n" + . $test->toString() . "\n"; + $test->fail($error); + } + } +} diff --git a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php index 235601f391c82..a38db0245b70a 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Listener/ExtededTestdox.php @@ -46,6 +46,11 @@ class ExtededTestdox extends \PHPUnit_Util_Printer implements \PHPUnit_Framework */ protected $incomplete = 0; + /** + * @var integer + */ + protected $risky = 0; + /** * @var string */ @@ -89,8 +94,8 @@ public function flush() /** * An error occurred. * - * @param PHPUnit_Framework_Test $test - * @param Exception $e + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -105,12 +110,12 @@ public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) /** * A failure occurred. * - * @param PHPUnit_Framework_Test $test - * @param PHPUnit_Framework_AssertionFailedError $e + * @param \PHPUnit_Framework_Test $test + * @param \PHPUnit_Framework_AssertionFailedError $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function addFailure(\PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) { if ($test instanceof $this->testTypeOfInterest) { $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE; @@ -121,8 +126,8 @@ public function addFailure(\PHPUnit_Framework_Test $test, PHPUnit_Framework_Asse /** * Incomplete test. * - * @param PHPUnit_Framework_Test $test - * @param Exception $e + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e * @param float $time * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -137,8 +142,8 @@ public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, /** * Skipped test. * - * @param PHPUnit_Framework_Test $test - * @param Exception $e + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e * @param float $time * @since Method available since Release 3.0.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) @@ -151,10 +156,27 @@ public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $ti } } + /** + * Risky test. + * + * @param \PHPUnit_Framework_Test $test + * @param \Exception $e + * @param float $time + * @since Method available since Release 4.0.0 + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + if ($test instanceof $this->testTypeOfInterest) { + $this->testStatus = \PHPUnit_Runner_BaseTestRunner::STATUS_RISKY; + $this->risky++; + } + } + /** * A testsuite started. * - * @param PHPUnit_Framework_TestSuite $suite + * @param \PHPUnit_Framework_TestSuite $suite * @since Method available since Release 2.2.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -165,7 +187,7 @@ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) /** * A testsuite ended. * - * @param PHPUnit_Framework_TestSuite $suite + * @param \PHPUnit_Framework_TestSuite $suite * @since Method available since Release 2.2.0 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ @@ -176,7 +198,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) /** * A test started. * - * @param PHPUnit_Framework_Test $test + * @param \PHPUnit_Framework_Test $test */ public function startTest(\PHPUnit_Framework_Test $test) { @@ -204,7 +226,7 @@ public function startTest(\PHPUnit_Framework_Test $test) /** * A test ended. * - * @param PHPUnit_Framework_Test $test + * @param \PHPUnit_Framework_Test $test * @param float $time */ public function endTest(\PHPUnit_Framework_Test $test, $time) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php b/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php index 2d91bf268269f..cc8a08612d22d 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Mail/Template/TransportBuilderMock.php @@ -24,7 +24,7 @@ protected function reset() } /** - * Returns message object with prepared data + * Return message object with prepared data * * @return \Magento\Framework\Mail\Message|null */ @@ -32,4 +32,16 @@ public function getSentMessage() { return $this->_sentMessage; } + + /** + * Return transport mock. + * + * @return \Magento\TestFramework\Mail\TransportInterfaceMock + */ + public function getTransport() + { + $this->prepareMessage(); + $this->reset(); + return new \Magento\TestFramework\Mail\TransportInterfaceMock(); + } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php index fc1518c6e12ba..8660b2fa13202 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Config.php @@ -4,14 +4,17 @@ */ namespace Magento\TestFramework\ObjectManager; -class Config extends \Magento\Framework\Interception\ObjectManager\Config +class Config extends \Magento\Framework\Interception\ObjectManager\Config\Developer { /** - * Clean configuration by recreating subject for proxy config + * Clean configuration */ public function clean() { - $className = get_class($this->subjectConfig); - $this->subjectConfig = new $className(); + $this->_preferences = []; + $this->_virtualTypes = []; + $this->_arguments = []; + $this->_nonShared = []; + $this->_mergedArguments = []; } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php index 553e00bb87fc4..829515a373cca 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Environment/Developer.php @@ -10,10 +10,8 @@ public function getDiConfig() { if (!$this->config) { $this->config = new \Magento\TestFramework\ObjectManager\Config( - new \Magento\Framework\ObjectManager\Config\Config( - $this->envFactory->getRelations(), - $this->envFactory->getDefinitions() - ) + $this->envFactory->getRelations(), + $this->envFactory->getDefinitions() ); } diff --git a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php index e0e3654c36931..3a4d0cd0eef4e 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Workaround/Cleanup/StaticProperties.php @@ -15,7 +15,9 @@ class StaticProperties * * @var array */ - protected static $_cleanableFolders = ['/app/code/', '/dev/tests/', '/lib/internal/']; + protected static $_cleanableFolders = ['/app/code/', '/dev/tests/integration/framework', '/lib/internal/']; + + protected static $backupStaticVariables = []; /** * Classes to exclude from static variables cleaning @@ -29,6 +31,7 @@ class StaticProperties 'Magento\TestFramework\Event\Magento', 'Magento\TestFramework\Event\PhpUnit', 'Magento\TestFramework\Annotation\AppIsolation', + 'Magento\TestFramework\Workaround\Cleanup\StaticProperties', 'Magento\Framework\Phrase', ]; @@ -40,12 +43,7 @@ class StaticProperties */ protected static function _isClassCleanable(\ReflectionClass $reflectionClass) { - // 1. do not process php internal classes - if ($reflectionClass->isInternal()) { - return false; - } - - // 2. do not process blacklisted classes from integration framework + // do not process blacklisted classes from integration framework foreach (self::$_classesToSkip as $notCleanableClass) { if ($reflectionClass->getName() == $notCleanableClass || is_subclass_of( $reflectionClass->getName(), @@ -55,45 +53,97 @@ protected static function _isClassCleanable(\ReflectionClass $reflectionClass) return false; } } + return true; + } - // 3. process only files from specific folders - $fileName = $reflectionClass->getFileName(); - - if ($fileName) { - $fileName = str_replace('\\', '/', $fileName); - foreach (self::$_cleanableFolders as $directory) { - if (stripos($fileName, $directory) !== false) { - return true; - } + /** + * Check if class has to be backed up + * + * @param string $classFile + * @return bool + */ + protected static function _isClassInCleanableFolders($classFile) + { + $classFile = str_replace('\\', '/', $classFile); + foreach (self::$_cleanableFolders as $directory) { + if (stripos($classFile, $directory) !== false) { + return true; } } return false; } + /** - * Clear static variables (after running controller test case) + * Restore static variables (after running controller test case) * @TODO: refactor all code where objects are stored to static variables to use object manager instead */ - public static function clearStaticVariables() + public static function restoreStaticVariables() + { + foreach (array_keys(self::$backupStaticVariables) as $class) { + $reflectionClass = new \ReflectionClass($class); + $staticProperties = $reflectionClass->getProperties(\ReflectionProperty::IS_STATIC); + foreach ($staticProperties as $staticProperty) { + $staticProperty->setAccessible(true); + $staticProperty->setValue(self::$backupStaticVariables[$class][$staticProperty->getName()]); + } + } + } + + /** + * Backup static variables + * + */ + public static function backupStaticVariables() { - $classes = get_declared_classes(); + $classFiles = \Magento\Framework\Test\Utility\Files::init()->getClassFiles(true, true, false, true, false); + $namespacePattern = '/namespace [a-zA-Z0-9\\\\]+;/'; + $classPattern = '/\nclass [a-zA-Z0-9_]+/'; + foreach ($classFiles as $classFile) { + if (self::_isClassInCleanableFolders($classFile)) { + $file = @fopen($classFile, 'r'); + $code = fread($file, 4096); + preg_match($namespacePattern, $code, $namespace); + preg_match($classPattern, $code, $class); + if (!isset($namespace[0]) || !isset($class[0])) { + fclose($file); + continue; + } + // trim namespace and class name + $namespace = substr($namespace[0], 10, strlen($namespace[0]) - 11); + $class = substr($class[0], 7, strlen($class[0]) - 7); + $className = $namespace . '\\' . $class; - foreach ($classes as $class) { - $reflectionCLass = new \ReflectionClass($class); - if (self::_isClassCleanable($reflectionCLass)) { - $staticProperties = $reflectionCLass->getProperties(\ReflectionProperty::IS_STATIC); - foreach ($staticProperties as $staticProperty) { - $staticProperty->setAccessible(true); - $value = $staticProperty->getValue(); - if (is_object($value) || is_array($value) && is_object(current($value))) { - $staticProperty->setValue(null); + try { + $reflectionClass = new \ReflectionClass($className); + } catch (\Exception $e) { + fclose($file); + continue; + } + if (self::_isClassCleanable($reflectionClass)) { + $staticProperties = $reflectionClass->getProperties(\ReflectionProperty::IS_STATIC); + foreach ($staticProperties as $staticProperty) { + $staticProperty->setAccessible(true); + $value = $staticProperty->getValue(); + self::$backupStaticVariables[$className][$staticProperty->getName()] = $value; } - unset($value); } + fclose($file); } } } + /** + * Handler for 'startTestSuite' event + * + */ + public function startTestSuite() + { + if (empty(self::$backupStaticVariables)) { + self::backupStaticVariables(); + } + } + /** * Handler for 'endTestSuite' event * @@ -109,7 +159,7 @@ public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) } } if ($clearStatics) { - self::clearStaticVariables(); + self::restoreStaticVariables(); } } } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php index 19d772d34ccfd..2d60675519cf4 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/RequestTest.php @@ -17,7 +17,7 @@ protected function setUp() $this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false), $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', [], [], '', false), $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'), - $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface') + $this->getMock('Magento\Framework\ObjectManagerInterface') ); } diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php index 145ce5f3e62ed..cf46839d580dc 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/TestCase/ControllerAbstractTest.php @@ -21,7 +21,7 @@ protected function setUp() $this->getMock('Magento\Framework\App\Route\ConfigInterface\Proxy', [], [], '', false), $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface', [], [], '', false), $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'), - $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface') + $this->getMock('Magento\Framework\ObjectManagerInterface') ); $response = new \Magento\TestFramework\Response( $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'), diff --git a/dev/tests/integration/testsuite/Magento/AdminGws/Model/BlocksTest.php b/dev/tests/integration/testsuite/Magento/AdminGws/Model/BlocksTest.php index c791799b2ba7b..93edda1aae439 100644 --- a/dev/tests/integration/testsuite/Magento/AdminGws/Model/BlocksTest.php +++ b/dev/tests/integration/testsuite/Magento/AdminGws/Model/BlocksTest.php @@ -50,7 +50,7 @@ public function testValidateCatalogPermissionsStoreGroups() $this->dispatch('backend/catalog/category/edit/id/3'); $this->assertRegExp( '/title\="New Permission"\s+type\="button"\s+' . - 'class="action-\w*\s+scalable\s+delete\s+disabled\s+disabled"/', + 'class="action-\w*\s+scalable\s+delete(\s+disabled){2,}"/', $this->getResponse()->getBody() ); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Cache/MassActionTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Cache/MassActionTest.php new file mode 100644 index 0000000000000..205aeaaea81e2 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Cache/MassActionTest.php @@ -0,0 +1,142 @@ +get('Magento\Framework\App\DeploymentConfig'); + $data = $config->getSegment(ConfigSegment::SEGMENT_KEY); + self::$typesSegment = new ConfigSegment($data); + } + + protected function tearDown() + { + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ + $cacheState = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\StateInterface'); + foreach (self::$typesSegment->getData() as $type => $value) { + $cacheState->setEnabled($type, $value); + $cacheState->persist(); + } + parent::tearDown(); + } + + /** + * @dataProvider massActionsDataProvider + * @param array $typesToEnable + */ + public function testMassEnableAction($typesToEnable = []) + { + $this->setAll(false); + + $this->getRequest()->setParams(['types' => $typesToEnable]); + $this->dispatch('backend/admin/cache/massEnable'); + + Bootstrap::getInstance()->reinitialize(); + + /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ + $cacheTypeList = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\TypeListInterface'); + $types = array_keys($cacheTypeList->getTypes()); + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ + $cacheState = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\StateInterface'); + foreach ($types as $type) { + if (in_array($type, $typesToEnable)) { + $this->assertTrue($cacheState->isEnabled($type), "Type '{$type}' has not been enabled"); + } else { + $this->assertFalse($cacheState->isEnabled($type), "Type '{$type}' must remain disabled"); + } + } + } + + /** + * @dataProvider massActionsDataProvider + * @param array $typesToDisable + */ + public function testMassDisableAction($typesToDisable = []) + { + $this->setAll(true); + + $this->getRequest()->setParams(['types' => $typesToDisable]); + $this->dispatch('backend/admin/cache/massDisable'); + + Bootstrap::getInstance()->reinitialize(); + + /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ + $cacheTypeList = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\TypeListInterface'); + $types = array_keys($cacheTypeList->getTypes()); + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ + $cacheState = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\StateInterface'); + foreach ($types as $type) { + if (in_array($type, $typesToDisable)) { + $this->assertFalse($cacheState->isEnabled($type), "Type '{$type}' has not been disabled"); + } else { + $this->assertTrue($cacheState->isEnabled($type), "Type '{$type}' must remain enabled"); + } + } + } + + /** + * Sets all cache types to enabled or disabled state + * + * @param bool $isEnabled + * @return void + */ + private function setAll($isEnabled) + { + /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ + $cacheState = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\StateInterface'); + foreach (array_keys(self::$typesSegment->getData()) as $type) { + $cacheState->setEnabled($type, $isEnabled); + } + $cacheState->persist(); + } + + /** + * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_invalidated.php + * @dataProvider massActionsDataProvider + * @param array $typesToRefresh + */ + public function testMassRefreshAction($typesToRefresh = []) + { + $this->getRequest()->setParams(['types' => $typesToRefresh]); + $this->dispatch('backend/admin/cache/massRefresh'); + + /** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ + $cacheTypeList = Bootstrap::getObjectManager()->get('Magento\Framework\App\Cache\TypeListInterface'); + $invalidatedTypes = array_keys($cacheTypeList->getInvalidated()); + $failed = array_intersect($typesToRefresh, $invalidatedTypes); + $this->assertEmpty($failed, 'Could not refresh following cache types: ' . join(', ', $failed)); + } + + /** + * @return array + */ + public function massActionsDataProvider() + { + return [ + 'no types' => [[]], + 'existing types' => [ + [ + \Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER + ] + ] + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php index 9b3111a21cfca..c9cad685d772e 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php @@ -15,10 +15,12 @@ class CacheTest extends \Magento\Backend\Utility\Controller */ public function testFlushAllAction() { - $this->dispatch('backend/admin/cache/flushAll'); - /** @var $cache \Magento\Framework\App\Cache */ $cache = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Framework\App\Cache'); + $this->assertNotEmpty($cache->load('APPLICATION_FIXTURE')); + + $this->dispatch('backend/admin/cache/flushAll'); + /** @var $cachePool \Magento\Framework\App\Cache\Frontend\Pool */ $this->assertFalse($cache->load('APPLICATION_FIXTURE')); @@ -56,98 +58,6 @@ public function testFlushSystemAction() } } - /** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_disabled.php - * @dataProvider massActionsDataProvider - * @param array $typesToEnable - */ - public function testMassEnableAction($typesToEnable = []) - { - $this->getRequest()->setParams(['types' => $typesToEnable]); - $this->dispatch('backend/admin/cache/massEnable'); - - /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ - $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\TypeListInterface' - ); - $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ - $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\StateInterface' - ); - foreach ($types as $type) { - if (in_array($type, $typesToEnable)) { - $this->assertTrue($cacheState->isEnabled($type), "Type '{$type}' has not been enabled"); - } else { - $this->assertFalse($cacheState->isEnabled($type), "Type '{$type}' must remain disabled"); - } - } - } - - /** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_enabled.php - * @dataProvider massActionsDataProvider - * @param array $typesToDisable - */ - public function testMassDisableAction($typesToDisable = []) - { - $this->getRequest()->setParams(['types' => $typesToDisable]); - $this->dispatch('backend/admin/cache/massDisable'); - - /** @var \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList */ - $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\TypeListInterface' - ); - $types = array_keys($cacheTypeList->getTypes()); - /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ - $cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\StateInterface' - ); - foreach ($types as $type) { - if (in_array($type, $typesToDisable)) { - $this->assertFalse($cacheState->isEnabled($type), "Type '{$type}' has not been disabled"); - } else { - $this->assertTrue($cacheState->isEnabled($type), "Type '{$type}' must remain enabled"); - } - } - } - - /** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_invalidated.php - * @dataProvider massActionsDataProvider - * @param array $typesToRefresh - */ - public function testMassRefreshAction($typesToRefresh = []) - { - $this->getRequest()->setParams(['types' => $typesToRefresh]); - $this->dispatch('backend/admin/cache/massRefresh'); - - /** @var $cacheTypeList \Magento\Framework\App\Cache\TypeListInterface */ - $cacheTypeList = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\TypeListInterface' - ); - $invalidatedTypes = array_keys($cacheTypeList->getInvalidated()); - $failed = array_intersect($typesToRefresh, $invalidatedTypes); - $this->assertEmpty($failed, 'Could not refresh following cache types: ' . join(', ', $failed)); - } - - /** - * @return array - */ - public function massActionsDataProvider() - { - return [ - 'no types' => [[]], - 'existing types' => [ - [ - \Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, - \Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, - \Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER, - ], - ] - ]; - } - /** * @dataProvider massActionsInvalidTypesDataProvider * @param $action diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php deleted file mode 100644 index 32598d81153a1..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled.php +++ /dev/null @@ -1,18 +0,0 @@ -create( - 'Magento\Framework\App\Cache\TypeListInterface' -); -$types = array_keys($cacheTypeList->getTypes()); - -/** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ -$cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\App\Cache\StateInterface'); -foreach ($types as $type) { - $cacheState->setEnabled($type, false); -} -$cacheState->persist(); diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php b/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php deleted file mode 100644 index f0e246d5e9422..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled.php +++ /dev/null @@ -1,18 +0,0 @@ -create( - 'Magento\Framework\App\Cache\TypeListInterface' -); -$types = array_keys($cacheTypeList->getTypes()); - -/** @var $cacheState \Magento\Framework\App\Cache\StateInterface */ -$cacheState = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Framework\App\Cache\StateInterface'); -foreach ($types as $type) { - $cacheState->setEnabled($type, true); -} -$cacheState->persist(); 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 c3a11018dfdec..c00942a7253b1 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 @@ -204,7 +204,6 @@ public function testSaveActionApplyToData() /** * @magentoDataFixture Magento/Translation/_files/db_translate_admin_store.php - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_enabled.php * @magentoDataFixture Magento/Catalog/controllers/_files/attribute_user_defined.php * @magentoAppIsolation enabled */ diff --git a/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php b/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php index f72544f76c94a..8ff3169659bb9 100644 --- a/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php +++ b/dev/tests/integration/testsuite/Magento/Cms/Controller/PageTest.php @@ -28,4 +28,27 @@ public function testAddBreadcrumbs() $breadcrumbsBlock = $layout->getBlock('breadcrumbs'); $this->assertContains($breadcrumbsBlock->toHtml(), $this->getResponse()->getBody()); } + + /** + * @magentoDataFixture cmsPageWithSystemRouteFixture + */ + public function testCreatePageWithSameModuleName() + { + $this->dispatch('/shipping/'); + $content = $this->getResponse()->getBody(); + $this->assertContains('Shipping Test Page', $content); + } + + public static function cmsPageWithSystemRouteFixture() + { + /** @var $page \Magento\Cms\Model\Page */ + $page = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Cms\Model\Page'); + $page->setTitle('Test title') + ->setIdentifier('shipping') + ->setStores([0]) + ->setIsActive(1) + ->setContent('

    Shipping Test Page

    ') + ->setPageLayout('1column') + ->save(); + } } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php index 46597aa476201..b8ebcadc82b56 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Layout/UpdateTest.php @@ -39,7 +39,6 @@ public function testFetchUpdatesByHandle() } /** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_enabled.php * @magentoDataFixture Magento/Backend/controllers/_files/cache/application_cache.php * @magentoDataFixture Magento/Core/_files/layout_cache.php */ diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/Cache/State/OptionsTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/Cache/State/OptionsTest.php deleted file mode 100644 index 16a470d3a01fc..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Framework/App/Cache/State/OptionsTest.php +++ /dev/null @@ -1,72 +0,0 @@ -_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\State\Options' - ); - } - - public function testGetTable() - { - $this->_resourceMock = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Resource', - ['tablePrefix' => 'prefix_'] - ); - - $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\App\Cache\State\Options', - ['resource' => $this->_resourceMock] - ); - $this->assertEquals('prefix_core_cache_option', $this->_model->getTable('core_cache_option')); - $this->assertEquals('prefix_core_cache_option', $this->_model->getTable(['core_cache', 'option'])); - } - - public function testUniqueFields() - { - $fields = ['field' => 'text']; - $this->_model->addUniqueField($fields); - $this->assertEquals([$fields], $this->_model->getUniqueFields()); - $this->_model->resetUniqueField(); - $this->assertEquals([], $this->_model->getUniqueFields()); - } - - public function testHasDataChanged() - { - $object = new \Magento\Framework\Object(['code' => 'value1', 'value' => 'value2']); - $this->assertTrue($this->_model->hasDataChanged($object)); - - $object->setOrigData(); - $this->assertFalse($this->_model->hasDataChanged($object)); - $object->setData('code', 'v1'); - $this->assertTrue($this->_model->hasDataChanged($object)); - } - - /** - * @magentoDbIsolation enabled - */ - public function testGetSaveAllOptions() - { - $options = $this->_model->getAllOptions(); - $this->assertArrayNotHasKey('test_option', $options); - $options['test_option'] = 1; - $this->_model->saveAllOptions($options); - $this->assertEquals($options, $this->_model->getAllOptions()); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Pci/Model/EncryptionTest.php b/dev/tests/integration/testsuite/Magento/Framework/Encryption/EncryptorTest.php similarity index 72% rename from dev/tests/integration/testsuite/Magento/Pci/Model/EncryptionTest.php rename to dev/tests/integration/testsuite/Magento/Framework/Encryption/EncryptorTest.php index 01be0b62ddb3f..afbe342a96f26 100644 --- a/dev/tests/integration/testsuite/Magento/Pci/Model/EncryptionTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Encryption/EncryptorTest.php @@ -2,19 +2,19 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Pci\Model; +namespace Magento\Framework\Encryption; -class EncryptionTest extends \PHPUnit_Framework_TestCase +class EncryptorTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Pci\Model\Encryption + * @var \Magento\Framework\Encryption\Encryptor */ protected $_model; protected function setUp() { $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Pci\Model\Encryption' + 'Magento\Framework\Encryption\Encryptor' ); } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php index 4a64ef68421b4..bd54fecae3c2f 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/GeneralTest.php @@ -25,7 +25,7 @@ class GeneralTest extends \PHPUnit_Framework_TestCase public function setUp() { - $config = new \Magento\Framework\Interception\ObjectManager\Config(new ObjectManagerConfig()); + $config = new \Magento\Framework\Interception\ObjectManager\Config\Developer(); $factory = new \Magento\Framework\ObjectManager\Factory\Dynamic\Developer($config, null); $this->_configReader = $this->getMock('Magento\Framework\Config\ReaderInterface'); @@ -81,7 +81,7 @@ public function setUp() 'Magento\Framework\Config\ReaderInterface' => $this->_configReader, 'Magento\Framework\ObjectManager\RelationsInterface' => $relations, 'Magento\Framework\ObjectManager\ConfigInterface' => $config, - 'Magento\Framework\Interception\ObjectManager\Config' => $config, + 'Magento\Framework\Interception\ObjectManager\ConfigInterface' => $config, 'Magento\Framework\ObjectManager\DefinitionInterface' => $definitions, 'Magento\Framework\Interception\DefinitionInterface' => $interceptionDefinitions ] diff --git a/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php b/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php index 434ad3113c740..c4fad76c42d8e 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php @@ -11,41 +11,40 @@ public function testValidationUpToDateDb() $this->dispatch('index/index'); } + /** + * @magentoDbIsolation enabled + * @expectedException \Magento\Framework\Module\Exception + * @expectedExceptionMessage Please update your database + */ public function testValidationOutdatedDb() { - $resourceName = 'adminnotification_setup'; - /*reset versions*/ - /** @var \Magento\Framework\Module\ResourceInterface $resource */ - $resource = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Framework\Module\ResourceInterface' - ); - $dbVersion = $resource->getDbVersion($resourceName); - $dbDataVersion = $resource->getDataVersion($resourceName); - try { - $resource->setDbVersion($resourceName, '0.1'); - $resource->setDataVersion($resourceName, '0.1'); - /** @var \Magento\Framework\Cache\FrontendInterface $cache */ - $cache = $this->_objectManager->get('Magento\Framework\App\Cache\Type\Config'); - $cache->clean(); - - try { - /* This triggers plugin to be executed */ - $this->dispatch('index/index'); - } catch (\Magento\Framework\Module\Exception $e) { - if ($e->getMessage() != 'Looks like database is outdated. Please, use setup tool to perform update') { - $failureMessage = "DB status validation doesn't work properly. Caught exception message is '" - . $e->getMessage() . "'"; - } + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var \Magento\Framework\Module\ModuleListInterface $moduleList */ + $moduleList = $objectManager->get('Magento\Framework\Module\ModuleListInterface'); + + /** @var \Magento\Framework\Module\ResourceResolverInterface $resourceResolver */ + $resourceResolver = $objectManager->get('\Magento\Framework\Module\ResourceResolverInterface'); + + // get first resource, we don't care which one it is. + foreach ($moduleList->getNames() as $moduleName) { + if ($resourceList = $resourceResolver->getResourceList($moduleName)) { + $resourceName = $resourceList[0]; + break; } - } catch (\Exception $e) { - $failureMessage = "Impossible to continue other tests, because database is broken: {$e}"; } - $resource->setDbVersion($resourceName, $dbVersion); - $resource->setDataVersion($resourceName, $dbDataVersion); + // Prepend '0.' to DB Version, to cause it to be an older version + /** @var \Magento\Framework\Module\ResourceInterface $resource */ + $resource = $objectManager->create('Magento\Framework\Module\ResourceInterface'); + $currentDbVersion = $resource->getDbVersion($resourceName); + $resource->setDbVersion($resourceName, '0.' . $currentDbVersion); - if (isset($failureMessage)) { - $this->fail($failureMessage); - } + /** @var \Magento\Framework\Cache\FrontendInterface $cache */ + $cache = $this->_objectManager->get('Magento\Framework\App\Cache\Type\Config'); + $cache->clean(); + + /* This triggers plugin to be executed */ + $this->dispatch('index/index'); } } diff --git a/dev/tests/integration/testsuite/Magento/Framework/Object/Copy/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/Object/Copy/Config/ReaderTest.php index 532804069a944..776560af4f891 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Object/Copy/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Object/Copy/Config/ReaderTest.php @@ -6,10 +6,8 @@ */ namespace Magento\Framework\Object\Copy\Config; +use Magento\TestFramework\Helper\Bootstrap; -/** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_disabled.php - */ class ReaderTest extends \PHPUnit_Framework_TestCase { /** @@ -25,7 +23,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->fileResolver = $this->getMockForAbstractClass('Magento\Framework\Config\FileResolverInterface'); - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager = Bootstrap::getObjectManager(); $this->model = $objectManager->create( 'Magento\Framework\Object\Copy\Config\Reader', ['fileResolver' => $this->fileResolver] diff --git a/dev/tests/integration/testsuite/Magento/Framework/TranslateCachingTest.php b/dev/tests/integration/testsuite/Magento/Framework/TranslateCachingTest.php new file mode 100644 index 0000000000000..dbb19ab123310 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/TranslateCachingTest.php @@ -0,0 +1,40 @@ +get('Magento\Framework\App\Cache\Type\Translate'); + $cache->clean(); + } + + /** + * @magentoDataFixture Magento/Translation/_files/db_translate.php + */ + public function testLoadDataCaching() + { + $objectManager = Bootstrap::getObjectManager(); + /** @var \Magento\Framework\Translate $model */ + $model = $objectManager->get('Magento\Framework\Translate'); + + $model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND); // this is supposed to cache the fixture + $this->assertEquals('Fixture Db Translation', __('Fixture String')); + + /** @var \Magento\Translation\Model\Resource\String $translateString */ + $translateString = $objectManager->create('Magento\Translation\Model\Resource\String'); + $translateString->saveTranslate('Fixture String', 'New Db Translation'); + + $this->assertEquals('Fixture Db Translation', __('Fixture String'), 'Translation is expected to be cached'); + + $model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND, true); + $this->assertEquals('New Db Translation', __('Fixture String'), 'Forced load should not use cache'); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php b/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php index 854ad86e93208..2a5ee17745f0a 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/TranslateTest.php @@ -4,29 +4,17 @@ */ namespace Magento\Framework; +use Magento\TestFramework\Helper\Bootstrap; + /** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_disabled.php + * @magentoCache all disabled */ class TranslateTest extends \PHPUnit_Framework_TestCase { - /** - * @var \Magento\Framework\Translate - */ - protected $_model; - - /** - * @var \Magento\Framework\View\DesignInterface - */ - protected $_designModel; - - /** - * @var \Magento\Framework\View\FileSystem - */ - protected $_viewFileSystem; - protected function setUp() { - $this->_viewFileSystem = $this->getMock( + /** @var \Magento\Framework\View\FileSystem $viewFileSystem */ + $viewFileSystem = $this->getMock( 'Magento\Framework\View\FileSystem', ['getLocaleFileName', 'getDesignTheme'], [], @@ -34,20 +22,20 @@ protected function setUp() false ); - $this->_viewFileSystem->expects($this->any()) - ->method( - 'getLocaleFileName' - )->will( + $viewFileSystem->expects($this->any()) + ->method('getLocaleFileName') + ->will( $this->returnValue(dirname(__DIR__) . '/Core/Model/_files/design/frontend/Test/default/i18n/en_US.csv') ); - $theme = $this->getMock('\Magento\Framework\View\Design\ThemeInterface', []); + /** @var \Magento\Framework\View\Design\ThemeInterface $theme */ + $theme = $this->getMock('Magento\Framework\View\Design\ThemeInterface', []); $theme->expects($this->any())->method('getId')->will($this->returnValue(10)); - $this->_viewFileSystem->expects($this->any())->method('getDesignTheme')->will($this->returnValue($theme)); + $viewFileSystem->expects($this->any())->method('getDesignTheme')->will($this->returnValue($theme)); - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $objectManager->addSharedInstance($this->_viewFileSystem, 'Magento\Framework\View\FileSystem'); + $objectManager = Bootstrap::getObjectManager(); + $objectManager->addSharedInstance($viewFileSystem, 'Magento\Framework\View\FileSystem'); /** @var $moduleReader \Magento\Framework\Module\Dir\Reader */ $moduleReader = $objectManager->get('Magento\Framework\Module\Dir\Reader'); @@ -58,8 +46,8 @@ protected function setUp() dirname(__DIR__) . '/Core/Model/_files/Magento/Catalog/i18n' ); - /** @var \Magento\Core\Model\View\Design _designModel */ - $this->_designModel = $this->getMock( + /** @var \Magento\Core\Model\View\Design $designModel */ + $designModel = $this->getMock( 'Magento\Core\Model\View\Design', ['getDesignTheme'], [ @@ -73,49 +61,19 @@ protected function setUp() ] ); - $this->_designModel->expects($this->any())->method('getDesignTheme')->will($this->returnValue($theme)); + $designModel->expects($this->any())->method('getDesignTheme')->will($this->returnValue($theme)); - $objectManager->addSharedInstance($this->_designModel, 'Magento\Core\Model\View\Design\Proxy'); + $objectManager->addSharedInstance($designModel, 'Magento\Core\Model\View\Design\Proxy'); - $this->_model = $objectManager->create('Magento\Framework\Translate'); - $objectManager->addSharedInstance($this->_model, 'Magento\Framework\Translate'); + $model = $objectManager->create('Magento\Framework\Translate'); + $objectManager->addSharedInstance($model, 'Magento\Framework\Translate'); $objectManager->removeSharedInstance('Magento\Framework\Phrase\Renderer\Composite'); $objectManager->removeSharedInstance('Magento\Framework\Phrase\Renderer\Translate'); \Magento\Framework\Phrase::setRenderer($objectManager->get('Magento\Framework\Phrase\RendererInterface')); - $this->_model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND); - } - - /** - * @magentoDataFixture Magento/Translation/_files/db_translate.php - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_enabled.php - * @covers \Magento\Translation\Model\Resource\Translate::getStoreId - * @covers \Magento\Translation\Model\Resource\String::getStoreId - */ - public function testLoadDataCaching() - { - /** @var \Magento\Translation\Model\Resource\String $translateString */ - $translateString = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Translation\Model\Resource\String' - ); - $translateString->saveTranslate('Fixture String', 'New Db Translation'); - - $this->_model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND); - $this->assertEquals( - 'Fixture Db Translation', - __('Fixture String'), - 'Translation is expected to be cached' - ); - - $this->_model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND, true); - $this->assertEquals( - 'New Db Translation', - __('Fixture String'), - 'Forced load should not use cache' - ); + $model->loadData(\Magento\Framework\App\Area::AREA_FRONTEND); } /** - * @magentoAppIsolation enabled * @dataProvider translateDataProvider */ public function testTranslate($inputText, $expectedTranslation) diff --git a/dev/tests/integration/testsuite/Magento/Logging/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Logging/Model/Config/ReaderTest.php index 6ac03f3ed81e3..fa21711eef7ae 100644 --- a/dev/tests/integration/testsuite/Magento/Logging/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Logging/Model/Config/ReaderTest.php @@ -4,9 +4,8 @@ */ namespace Magento\Logging\Model\Config; -/** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_disabled.php - */ +use Magento\TestFramework\Helper\Bootstrap; + class ReaderTest extends \PHPUnit_Framework_TestCase { /** @@ -22,7 +21,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->fileResolver = $this->getMockForAbstractClass('Magento\Framework\Config\FileResolverInterface'); - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager = Bootstrap::getObjectManager(); $this->model = $objectManager->create( 'Magento\Logging\Model\Config\Reader', ['fileResolver' => $this->fileResolver] diff --git a/dev/tests/integration/testsuite/Magento/Pbridge/Block/Checkout/Payment/Review/IframeTest.php b/dev/tests/integration/testsuite/Magento/Pbridge/Block/Checkout/Payment/Review/IframeTest.php index e780d82028c71..406500eba0043 100644 --- a/dev/tests/integration/testsuite/Magento/Pbridge/Block/Checkout/Payment/Review/IframeTest.php +++ b/dev/tests/integration/testsuite/Magento/Pbridge/Block/Checkout/Payment/Review/IframeTest.php @@ -11,7 +11,7 @@ public function testGetSourceUrl() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $encryption = $this->getMock('Magento\Pci\Model\Encryption', [], [], '', false); + $encryption = $this->getMock('Magento\Framework\Encryption\Encryptor', [], [], '', false); $encryption->expects($this->any()) ->method('encrypt') ->will($this->returnArgument(0)); diff --git a/dev/tests/integration/testsuite/Magento/Pbridge/Block/Payment/Form/AbstractFormTest.php b/dev/tests/integration/testsuite/Magento/Pbridge/Block/Payment/Form/AbstractFormTest.php index f68bb01912253..dec5f2c3df1f2 100644 --- a/dev/tests/integration/testsuite/Magento/Pbridge/Block/Payment/Form/AbstractFormTest.php +++ b/dev/tests/integration/testsuite/Magento/Pbridge/Block/Payment/Form/AbstractFormTest.php @@ -11,7 +11,7 @@ public function testGetSourceUrl() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $encryption = $this->getMock('Magento\Pci\Model\Encryption', [], [], '', false); + $encryption = $this->getMock('Magento\Framework\Encryption\Encryptor', [], [], '', false); $encryption->expects($this->any()) ->method('encrypt') ->will($this->returnArgument(0)); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php new file mode 100644 index 0000000000000..9638ee4a86691 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/InvoiceTest.php @@ -0,0 +1,34 @@ +_collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Sales\Model\Resource\Order\Collection' + ); + } + + /** + * @magentoDataFixture Magento/Sales/_files/invoice.php + */ + public function testOrderTotalItemCount() + { + $expectedResult = [['total_item_count' => 1]]; + $actualResult = []; + /** @var \Magento\Sales\Model\Order $order */ + foreach ($this->_collection->getItems() as $order) { + $actualResult[] = ['total_item_count' => $order->getData('total_item_count')]; + } + $this->assertEquals($expectedResult, $actualResult); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/OrderTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/OrderTest.php new file mode 100644 index 0000000000000..f9da905c795cc --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Resource/OrderTest.php @@ -0,0 +1,101 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->resourceModel = $this->objectManager->create('\Magento\Sales\Model\Resource\Order'); + $this->orderIncrementId = '100000001'; + } + + protected function tearDown() + { + $registry = $this->objectManager->get('Magento\Framework\Registry'); + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', true); + + /** @var \Magento\Sales\Model\Order $order */ + $order = $this->objectManager->create('Magento\Sales\Model\Order'); + $order->loadByIncrementId($this->orderIncrementId); + $order->delete(); + + $registry->unregister('isSecureArea'); + $registry->register('isSecureArea', false); + + parent::tearDown(); + } + + /** + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + */ + public function testSaveOrder() + { + $addressData = [ + 'region' => 'CA', + 'postcode' => '11111', + 'lastname' => 'lastname', + 'firstname' => 'firstname', + 'street' => 'street', + 'city' => 'Los Angeles', + 'email' => 'admin@example.com', + 'telephone' => '11111111', + 'country_id' => 'US' + ]; + + $billingAddress = $this->objectManager->create('Magento\Sales\Model\Order\Address', ['data' => $addressData]); + $billingAddress->setAddressType('billing'); + + $shippingAddress = clone $billingAddress; + $shippingAddress->setId(null)->setAddressType('shipping'); + + $payment = $this->objectManager->create('Magento\Sales\Model\Order\Payment'); + $payment->setMethod('checkmo'); + + /** @var \Magento\Sales\Model\Order\Item $orderItem */ + $orderItem = $this->objectManager->create('Magento\Sales\Model\Order\Item'); + $orderItem->setProductId(1) + ->setQtyOrdered(2) + ->setBasePrice(10) + ->setPrice(10) + ->setRowTotal(10); + + /** @var \Magento\Sales\Model\Order $order */ + $order = $this->objectManager->create('Magento\Sales\Model\Order'); + $order->setIncrementId($this->orderIncrementId) + ->setState(\Magento\Sales\Model\Order::STATE_PROCESSING, true) + ->setSubtotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->setStoreId($this->objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore()->getId()) + ->addItem($orderItem) + ->setPayment($payment); + + $this->resourceModel->save($order); + $this->assertNotNull($order->getCreatedAt()); + $this->assertNotNull($order->getUpdatedAt()); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php index 7876fdaed2707..73c61a5af1029 100644 --- a/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Store/Model/StoreTest.php @@ -68,10 +68,14 @@ protected function tearDown() public function testSetCookie() { + $model = $this->getMock('Magento\Store\Model\Store', ['getStorePath'], $this->modelParams); + $model->expects($this->once()) + ->method('getStorePath') + ->will($this->returnValue('/')); $storeCode = 'store code'; $this->assertArrayNotHasKey(Store::COOKIE_NAME, $_COOKIE); - $this->model->setCode($storeCode); - $this->model->setCookie(); + $model->setCode($storeCode); + $model->setCookie(); $this->assertEquals($storeCode, $_COOKIE[Store::COOKIE_NAME]); } @@ -452,7 +456,7 @@ public function isCurrentlySecureDataProvider() /** * @magentoConfigFixture current_store web/secure/offloader_header SSL_OFFLOADED - * @magentoConfigFixture current_store web/secure/base_url + * @magentoConfigFixture current_store web/secure/base_url */ public function testIsCurrentlySecureNoSecureBaseUrl() { diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/InstallerTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/InstallerTest.php index 50c3fb3f80c38..e285de3747a81 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/InstallerTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/InstallerTest.php @@ -27,7 +27,10 @@ public function testLaunch() /** @var \Magento\Tools\SampleData\Installer $installer */ $installer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Tools\SampleData\Installer', - ['data' => ['admin_username' => 'adminUser']] + [ + 'data' => ['admin_username' => 'adminUser'], + 'logger' => TestLogger::factory(), + ] ); ob_start(); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Catalog/Setup/ProductTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Catalog/Setup/ProductTest.php index 9c4b31007afaa..94f5de2c9ecd5 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Catalog/Setup/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Catalog/Setup/ProductTest.php @@ -5,6 +5,8 @@ namespace Magento\Tools\SampleData\Module\Catalog\Setup; +use Magento\Tools\SampleData\TestLogger; + /** * Class ProductTest */ @@ -34,22 +36,24 @@ public function installAttributes() $attributes = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( 'Magento\Tools\SampleData\Module\Catalog\Setup\Attribute', [ - 'fixtureHelper' => $fixtureHelper + 'fixtureHelper' => $fixtureHelper, + 'logger' => TestLogger::factory(), ] ); ob_start(); $attributes->run(); $result = ob_get_clean(); - $this->assertContains('Installing catalog attributes' . PHP_EOL, $result); - $this->assertContains('.................' . PHP_EOL, $result); + $this->assertContains('Installing catalog attributes', $result); + $this->assertContains('.................', $result); } public function installCategories() { /** @var \Magento\Tools\SampleData\Module\Catalog\Setup\Category $categories */ $categories = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Tools\SampleData\Module\Catalog\Setup\Category' + 'Magento\Tools\SampleData\Module\Catalog\Setup\Category', + ['logger' => TestLogger::factory()] ); ob_start(); @@ -72,7 +76,8 @@ public function installProducts() 'Magento\Tools\SampleData\Module\Catalog\Setup\Product', [ 'fixtureHelper' => $fixtureHelper, - 'fixtures' => $fixtures + 'fixtures' => $fixtures, + 'logger' => TestLogger::factory(), ] ); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Cms/Setup/PageTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Cms/Setup/PageTest.php index f10c24ce2e334..e174ae33a6ea4 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Cms/Setup/PageTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Cms/Setup/PageTest.php @@ -5,6 +5,8 @@ namespace Magento\Tools\SampleData\Module\Cms\Setup; +use Magento\Tools\SampleData\TestLogger; + /** * Class PageTest */ @@ -17,7 +19,8 @@ public function testRun() { /** @var \Magento\Tools\SampleData\Module\Cms\Setup\Page $model */ $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Tools\SampleData\Module\Cms\Setup\Page' + 'Magento\Tools\SampleData\Module\Cms\Setup\Page', + ['logger' => TestLogger::factory()] ); ob_start(); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Customer/Setup/CustomerTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Customer/Setup/CustomerTest.php index a1ce21e649adc..ba322eaf39f62 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Customer/Setup/CustomerTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Customer/Setup/CustomerTest.php @@ -5,6 +5,8 @@ namespace Magento\Tools\SampleData\Module\Customer\Setup; +use Magento\Tools\SampleData\TestLogger; + /** * Class CustomerTest */ @@ -17,7 +19,8 @@ public function testRun() { /** @var \Magento\Tools\SampleData\Module\Customer\Setup\Customer $customer */ $customer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Tools\SampleData\Module\Customer\Setup\Customer' + 'Magento\Tools\SampleData\Module\Customer\Setup\Customer', + ['logger' => TestLogger::factory()] ); ob_start(); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/OfflineShipping/Setup/TablerateTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/OfflineShipping/Setup/TablerateTest.php index 2c782f3152fb0..a47e490c9b024 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/OfflineShipping/Setup/TablerateTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/OfflineShipping/Setup/TablerateTest.php @@ -4,6 +4,7 @@ */ namespace Magento\Tools\SampleData\Module\OfflineShipping\Setup; +use Magento\Tools\SampleData\TestLogger; /** * Class TablerateTest @@ -17,7 +18,8 @@ public function testRun() { /** @var \Magento\Tools\SampleData\Module\OfflineShipping\Setup\Tablerate $rate */ $rate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Tools\SampleData\Module\OfflineShipping\Setup\Tablerate' + 'Magento\Tools\SampleData\Module\OfflineShipping\Setup\Tablerate', + ['logger' => TestLogger::factory()] ); ob_start(); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Tax/Setup/TaxTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Tax/Setup/TaxTest.php index 95cc730cf1905..3fbd8782f6def 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Tax/Setup/TaxTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Tax/Setup/TaxTest.php @@ -5,6 +5,8 @@ namespace Magento\Tools\SampleData\Module\Tax\Setup; +use Magento\Tools\SampleData\TestLogger; + /** * Class TaxTest */ @@ -17,7 +19,8 @@ public function testRun() { /** @var \Magento\Tools\SampleData\Module\Tax\Setup\Tax $tax */ $tax = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Tools\SampleData\Module\Tax\Setup\Tax' + 'Magento\Tools\SampleData\Module\Tax\Setup\Tax', + ['logger' => TestLogger::factory()] ); ob_start(); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Theme/SetupTest.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Theme/SetupTest.php index 4051e043188bd..442881dd3bb46 100644 --- a/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Theme/SetupTest.php +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/Module/Theme/SetupTest.php @@ -5,6 +5,8 @@ namespace Magento\Tools\SampleData\Module\Theme; +use Magento\Tools\SampleData\TestLogger; + /** * Class ThemeTest */ @@ -17,7 +19,8 @@ public function testRun() { /** @var \Magento\Tools\SampleData\Module\Theme\Setup $model */ $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Tools\SampleData\Module\Theme\Setup' + 'Magento\Tools\SampleData\Module\Theme\Setup', + ['logger' => TestLogger::factory()] ); ob_start(); diff --git a/dev/tests/integration/testsuite/Magento/Tools/SampleData/TestLogger.php b/dev/tests/integration/testsuite/Magento/Tools/SampleData/TestLogger.php new file mode 100644 index 0000000000000..6e12e594a8aa8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Tools/SampleData/TestLogger.php @@ -0,0 +1,73 @@ +setSubject(new TestLogger); + return $logger; + } + + /** + * {@inheritdoc} + */ + public function log($message) + { + $this->writeLn($message); + } + + /** + * {@inheritdoc} + */ + public function logError(\Exception $e) + { + $this->writeLn($e); + } + + /** + * {@inheritdoc} + */ + public function logInline($message) + { + echo $message; + } + + /** + * {@inheritdoc} + */ + public function logMeta($message) + { + $this->writeLn($message); + } + + /** + * {@inheritdoc} + */ + public function logSuccess($message) + { + $this->writeLn($message); + } + + /** + * Write line + * + * @param string $message + */ + private function writeLn($message) + { + echo $message . PHP_EOL; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php index 149ed9df4fc42..e45d1cf370c49 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/DataTest.php @@ -6,11 +6,13 @@ namespace Magento\Widget\Model\Config; /** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_disabled.php * @magentoAppArea adminhtml */ class DataTest extends \PHPUnit_Framework_TestCase { + /** + * @magentoCache config disabled + */ public function testGet() { $fileResolver = $this->getMockForAbstractClass('Magento\Framework\Config\FileResolverInterface'); diff --git a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php index 15666a80c59c6..0965b51e8d699 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Model/Config/ReaderTest.php @@ -4,9 +4,8 @@ */ namespace Magento\Widget\Model\Config; -/** - * @magentoDataFixture Magento/Backend/controllers/_files/cache/all_types_disabled.php - */ +use Magento\TestFramework\Helper\Bootstrap; + class ReaderTest extends \PHPUnit_Framework_TestCase { /** @@ -22,7 +21,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->fileResolver = $this->getMockForAbstractClass('Magento\Framework\Config\FileResolverInterface'); - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $objectManager = Bootstrap::getObjectManager(); $this->model = $objectManager->create( 'Magento\Widget\Model\Config\Reader', ['fileResolver' => $this->fileResolver] ); diff --git a/dev/tests/js/run_js_tests.php b/dev/tests/js/run_js_tests.php index 96732ef7ba5e4..fb7a85c4c2cc7 100644 --- a/dev/tests/js/run_js_tests.php +++ b/dev/tests/js/run_js_tests.php @@ -138,7 +138,12 @@ kill -9 $LSOF fi - pkill Xvfb + DISPLAY_NUM=99 + ps -ef | egrep "[X]vfb.*:$DISPLAY_NUM" + if [ $? -eq 0 ] ; then + pkill Xvfb + fi + XVFB=`which Xvfb` if [ "$?" -eq 1 ]; then @@ -146,9 +151,9 @@ exit 1 fi - $XVFB :99 -nolisten inet6 -ac & + $XVFB :$DISPLAY_NUM -nolisten inet6 -ac & PID_XVFB="$!" # take the process ID - export DISPLAY=:99 # set display to use that of the Xvfb + export DISPLAY=:$DISPLAY_NUM # set display to use that of the Xvfb USER=`whoami` SUDO=`which sudo` diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index d391b377a1cd7..4e37641687895 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -53,7 +53,7 @@ public static function setUpBeforeClass() self::$shell = self::createShell(); self::$isComposerAvailable = self::isComposerAvailable(); self::$root = Files::init()->getPathToSource(); - self::$rootJson = json_decode(file_get_contents(self::$root . '/composer.json')); + self::$rootJson = json_decode(file_get_contents(self::$root . '/composer.json'), true); self::$dependencies = []; } @@ -146,27 +146,31 @@ private function assertMagentoConventions($dir, $packageType, \StdClass $json) $this->assertDependsOnPhp($json->require); $this->assertDependsOnFramework($json->require); $this->assertDependsOnInstaller($json->require); + $this->assertRequireInSync($json); break; case 'magento2-language': $this->assertRegExp('/^magento\/language\-[a-z]{2}_[a-z]{2}$/', $json->name); $this->assertDependsOnFramework($json->require); $this->assertDependsOnInstaller($json->require); + $this->assertRequireInSync($json); break; case 'magento2-theme': $this->assertRegExp('/^magento\/theme-(?:adminhtml|frontend)(\-[a-z0-9_]+)+$/', $json->name); $this->assertDependsOnPhp($json->require); $this->assertDependsOnFramework($json->require); $this->assertDependsOnInstaller($json->require); + $this->assertRequireInSync($json); break; case 'magento2-library': $this->assertDependsOnPhp($json->require); $this->assertRegExp('/^magento\/framework$/', $json->name); $this->assertDependsOnInstaller($json->require); + $this->assertRequireInSync($json); break; case 'project': sort(self::$dependencies); $dependenciesListed = []; - foreach (array_keys((array)self::$rootJson->replace) as $key) { + foreach (array_keys((array)self::$rootJson['replace']) as $key) { if (ReplaceFilter::isMagentoComponent($key)) { $dependenciesListed[] = $key; } @@ -286,13 +290,46 @@ private function assertDependsOnInstaller(\StdClass $json) private function assertVersionInSync($name, $version) { $this->assertEquals( - self::$rootJson->version, + self::$rootJson['version'], $version, "Version {$version} in component {$name} is inconsistent with version " - . self::$rootJson->version . ' in root composer.json' + . self::$rootJson['version'] . ' in root composer.json' ); } + /** + * Make sure requirements of components are reflected in root composer.json + * + * @param \StdClass $json + */ + private function assertRequireInSync(\StdClass $json) + { + $name = $json->name; + if (isset($json->require)) { + $errors = []; + foreach (array_keys((array)$json->require) as $depName) { + if ($depName == 'magento/magento-composer-installer') { + // Magento Composer Installer is not needed for already existing components + continue; + } + if (!isset(self::$rootJson['require-dev'][$depName]) && !isset(self::$rootJson['require'][$depName]) + && !isset(self::$rootJson['replace'][$depName])) { + $errors[] = "'$name' depends on '$depName'"; + } + } + if (!empty($errors)) { + $this->fail( + "The following dependencies are missing in root 'composer.json'," + . " while declared in child components.\n" + . "Consider adding them to 'require-dev' section (if needed for child components only)," + . " to 'replace' section (if they are present in the project)," + . " to 'require' section (if needed for the skeleton).\n" + . join("\n", $errors) + ); + } + } + } + /** * Convert a fully qualified module name to a composer package name according to conventions * @@ -346,16 +383,16 @@ private function assertComposerAvailable() public function testComponentPathsInRoot() { - if (!isset(self::$rootJson->extra) || !isset(self::$rootJson->extra->component_paths)) { + if (!isset(self::$rootJson['extra']) || !isset(self::$rootJson['extra']['component_paths'])) { $this->markTestSkipped("The root composer.json file doesn't mention any extra component paths information"); } - $this->assertObjectHasAttribute( + $this->assertArrayHasKey( 'replace', self::$rootJson, "If there are any component paths specified, then they must be reflected in 'replace' section" ); $flat = []; - foreach (self::$rootJson->extra->component_paths as $key => $element) { + foreach (self::$rootJson['extra']['component_paths'] as $key => $element) { if (is_string($element)) { $flat[] = [$key, $element]; } elseif (is_array($element)) { @@ -371,9 +408,9 @@ public function testComponentPathsInRoot() self::$root . '/' . $path, "Missing or invalid component path: {$component} -> {$path}" ); - $this->assertObjectHasAttribute( + $this->assertArrayHasKey( $component, - self::$rootJson->replace, + self::$rootJson['replace'], "The {$component} is specified in 'extra->component_paths', but missing in 'replace' section" ); } diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml index 00d17f0ef2aae..6f492a6bad34b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/fieldset.xml @@ -362,7 +362,7 @@ - + @@ -693,7 +693,7 @@ - + diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml index c5500cc5aceb5..5aa5f124d96e4 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Core/Model/Fieldset/_files/invalid_fieldset.xml @@ -362,9 +362,9 @@ * - + * - + * @@ -693,9 +693,9 @@ * - + * - + * diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php index c2dfbd76a1026..fb76a64799d13 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/_files/dependency_test/tables_ce.php @@ -106,7 +106,6 @@ 'cms_page' => 'Magento_Cms', 'cms_page_store' => 'Magento_Cms', 'core_cache' => 'Magento_Core', - 'core_cache_option' => 'Magento_Core', 'core_cache_tag' => 'Magento_Core', 'core_config_data' => 'Magento_Core', 'core_config_field' => 'Magento_Core', diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php index f2d54291f6173..ddf6d23984089 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/FilesystemTest.php @@ -34,7 +34,6 @@ public function relocationsDataProvider() return [ 'Relocated to pub/errors' => ['errors'], 'Eliminated with Magento_Compiler' => ['includes'], - 'Eliminated with Magento_GoogleCheckout' => ['lib/googlecheckout'], 'Relocated to lib/web' => ['js'], 'Relocated to pub/media' => ['media'], 'Eliminated as not needed' => ['pkginfo'], @@ -42,17 +41,15 @@ public function relocationsDataProvider() 'Dissolved into different modules\' view/frontend' => ['app/design/frontend/base'], 'Dissolved into different modules\' view/email/*.html' => ['app/locale/en_US/template'], 'The "core" code pool no longer exists. Use root namespace as specified in PSR-0 standard' => [ - 'app/code/core', + 'app/code/core' ], 'The "local" code pool no longer exists. Use root namespace as specified in PSR-0 standard' => [ - 'app/code/local', + 'app/code/local' ], 'The "community" code pool no longer exists. Use root namespace as specified in PSR-0 standard' => [ - 'app/code/community', + 'app/code/community' ], - 'Eliminated Magento/luma theme' => ['app/design/frontend/Magento/luma'], - 'Eliminated local.xml - use config.php instead' => ['app/etc/local.xml'], - 'Eliminated app/etc/module.xml - use config.php instead' => ['app/etc/module.xml'], + 'Eliminated Magento/plushe theme' => ['app/design/frontend/Magento/plushe'], ]; } @@ -83,33 +80,33 @@ public function testObsoleteDirectories() public function testObsoleteViewPaths() { + $allowedFiles = ['requirejs-config.js', 'layouts.xml']; + $allowedThemeFiles = array_merge($allowedFiles, ['composer.json', 'theme.xml']); + $areas = '{frontend,adminhtml,base}'; + $ns = '*'; + $mod = '*'; $pathsToCheck = [ - 'app/code/*/*/view/frontend/*' => [ - 'allowed_files' => ['requirejs-config.js'], - 'allowed_dirs' => ['layout', 'templates', 'web'], + "app/code/{$ns}/{$mod}/view/{$areas}/*" => [ + 'allowed_files' => $allowedFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'], ], - 'app/code/*/*/view/adminhtml/*' => [ - 'allowed_files' => ['requirejs-config.js'], - 'allowed_dirs' => ['layout', 'templates', 'web'], + "app/design/{$areas}/{$ns}/{$mod}/*" => [ + 'allowed_files' => $allowedThemeFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web', 'etc', 'i18n', 'media', '\w+_\w+'], ], - 'app/code/*/*/view/base/*' => [ - 'allowed_files' => ['requirejs-config.js'], - 'allowed_dirs' => ['layout', 'templates', 'web'], - ], - 'app/design/*/*/*/*' => [ - 'allowed_files' => ['requirejs-config.js', 'theme.xml'], - 'allowed_dirs' => ['layout', 'templates', 'web', 'etc', 'i18n', 'media', '\w+_\w+'], - ], - 'app/design/*/*/*/*_*/*' => [ - 'allowed_files' => ['requirejs-config.js'], - 'allowed_dirs' => ['layout', 'templates', 'web'], + "app/design/{$areas}/{$ns}/{$mod}/{$ns}_{$mod}/*" => [ + 'allowed_files' => $allowedThemeFiles, + 'allowed_dirs' => ['layout', 'page_layout', 'templates', 'web'], ], ]; $errors = []; foreach ($pathsToCheck as $path => $allowed) { $allowedFiles = $allowed['allowed_files']; $allowedDirs = $allowed['allowed_dirs']; - $foundFiles = glob(BP . '/' . $path); + $foundFiles = glob(BP . '/' . $path, GLOB_BRACE); + if (!$foundFiles) { + $this->fail("Glob pattern returned empty result: {$path}"); + } foreach ($foundFiles as $file) { $baseName = basename($file); if (is_dir($file)) { @@ -122,13 +119,14 @@ public function testObsoleteViewPaths() if (in_array($baseName, $allowedFiles)) { continue; } - $errors[] = "Wrong location of view file/dir: '$file'. " - . "Please, put template files inside 'templates' sub-dir, " - . "static view files inside 'web' sub-dir and layout updates inside 'layout' sub-dir"; + $errors[] = $file; } } if (!empty($errors)) { - $this->fail(implode(PHP_EOL, $errors)); + $this->fail( + 'Unexpected files or directories found. Make sure they are not at obsolete locations:' + . PHP_EOL . implode(PHP_EOL, $errors) + ); } } } 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 99fe899b12935..f89a0ded5448b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -2819,6 +2819,15 @@ ['Magento\Customer\Model\Converter'], ['Magento\CatalogRule\Plugin\Indexer\Product\PriceIndexer'], ['Magento\CatalogRule\Plugin\Indexer\Product\PriceIndexerTest'], + [ + 'Magento\Framework\Interception\ObjectManager\Compiled\Config', + 'Magento\Framework\Interception\ObjectManager\Config\Compiled' + ], + [ + 'Magento\Framework\Interception\ObjectManager\Config', + 'Magento\Framework\Interception\ObjectManager\Config\Developer' + ], + ['Magento\Framework\ObjectManager\Config\ProxyConfig'], ['Magento\Catalog\Block\Product\Send'], ['Magento\Catalog\Helper\Product\Options'], ['Magento\Cms\Model\Resource\Page\Service'], @@ -2826,5 +2835,11 @@ ['Magento\GiftMessage\Helper\Url'], ['Magento\Rss\Helper\Data'], ['Magento\Sales\Model\ConverterInterface'], + ['Magento\Paypal\Block\System\Config\Fieldset\Location'], + ['Magento\Paypal\Block\Payflow\Advanced\Review'], + ['Magento\Paypal\Block\Payflow\Link\Review'], + ['Magento\Paypal\Model\System\Config\Source\AuthorizationAmounts'], ['Magento\Rule\Model\Rule', 'Magento\Rule\Model\AbstractModel'], + ['Magento\Framework\App\Cache\State\Options', 'Magento\Framework\App\Cache\State'], + ['Magento\Framework\App\Cache\State\OptionsInterface', 'Magento\Framework\App\Cache\State'], ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes_ee.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes_ee.php index ee42513e1522c..301f33227b988 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes_ee.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes_ee.php @@ -145,4 +145,5 @@ 'Magento\CatalogRule\Block\Adminhtml\Promo\Widget\Chooser\Daterange', 'Magento\CustomerSegment\Block\Adminhtml\Widget\Chooser\Daterange' ], + ['Magento\Pci\Model\Encryption', 'Magento\Framework\Encryption\Encryptor'], ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index 0cf40dfda54a1..97baa914473ed 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -671,4 +671,19 @@ 'Magento\Framework\Module\Declaration\Reader\Filesystem', 'Magento\Framework\App\ObjectManagerFactory::INIT_PARAM_DEPLOYMENT_CONFIG' ], + [ + 'NOT_INSTALLED_URL_PATH_PARAM', + 'Magento\Framework\App\Http', + 'Magento\Framework\App\SetupInfo::PARAM_NOT_INSTALLED_URL_PATH' + ], + [ + 'NOT_INSTALLED_URL_PARAM', + 'Magento\Framework\App\Http', + 'Magento\Framework\App\SetupInfo::PARAM_NOT_INSTALLED_URL' + ], + [ + 'NOT_INSTALLED_URL_PATH', + 'Magento\Framework\App\Http', + 'Magento\Framework\App\SetupInfo::DEFAULT_PATH' + ], ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 4ffcca5607537..5b3c80f4e523a 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -1664,6 +1664,8 @@ ['_detectTheme', 'Magento\Core\Helper\Theme'], ['_detectGroup', 'Magento\Core\Helper\Theme'], ['_sortThemesByHierarchy', 'Magento\Core\Helper\Theme'], + ['set', 'Magento\Framework\Api\ExtensibleObjectBuilder'], + ['toFlatArrayStatic', 'Magento\Framework\Api\ExtensibleDataObjectConverter'], ['_sortArrayByArray', 'Magento\Core\Helper\Theme'], ['_getGroupLabels', 'Magento\Core\Helper\Theme'], ['_sortGroupFilesCallback', 'Magento\Core\Helper\Theme'], @@ -1967,7 +1969,6 @@ ['urlDecode', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Url\DecoderInterface::decode'], ['isModuleEnabled', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Module\Manager::isEnabled()'], ['isModuleOutputEnabled', 'Magento\Framework\App\Helper\AbstractHelper', 'Magento\Framework\Module\Manager::isOutputEnabled()'], - ['toFlatArrayStatic', 'Magento\Framework\Api\ExtensibleDataObjectConverter'], ['_packToTar', 'Magento\Framework\Archive\Tar'], ['_parseHeader', 'Magento\Framework\Archive\Tar'], ['getIdentities', 'Magento\Wishlist\Block\Link'], @@ -1987,7 +1988,6 @@ ['getEnv', 'Magento\Rule\Model\Resource\Rule\Collection\AbstractCollection'], ['setActiveFilter', 'Magento\Rule\Model\Resource\Rule\Collection\AbstractCollection'], ['process', 'Magento\Rule\Model\Resource\Rule\Collection\AbstractCollection'], - ['set', 'Magento\Framework\Api\ExtensibleObjectBuilder'], [ 'isAutomaticCleaningAvailable', 'Magento\Framework\Cache\Backend\Decorator\AbstractDecorator', @@ -2001,4 +2001,7 @@ ['getScriptTranslation', 'Magento\Framework\LocaleInterface'], ['getCountryTranslation', 'Magento\Framework\LocaleInterface'], ['getTerritoryTranslation', 'Magento\Framework\LocaleInterface'], + ['getLinksConfig', 'Magento\Downloadable\Block\Catalog\Product\Links'], + ['getAuthorizationAmounts', 'Magento\Paypal\Model\Config'], + ['cleanTransactions', 'Magento\Paypal\Model\Observer'] ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt index 8a2b7390edf42..8b0e96b4500ba 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt @@ -116,4 +116,3 @@ lib/internal/Magento/Framework/System lib/internal/Magento/Framework/Util.php lib/internal/Magento/Framework/Xml vendor -setup/vendor diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index dec32114b11cc..89690a5dd6300 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -135,7 +135,6 @@ Magento/Sales/Api Magento/Sales/Spi Magento/Shipping/Controller/Adminhtml/Order/Shipment vendor -setup/vendor Magento/CatalogSearch/Model/Resource/Fulltext Magento/CatalogSearch/Model/Indexer lib/internal/Magento/Framework/Data @@ -144,3 +143,4 @@ app/code/Magento/CatalogInventory/Api/Data app/code/Magento/Sales/Model/Spi Magento/Catalog/Model/ProductLink Magento/GroupedProduct/Model/Resource/Product/Type/Grouped +lib/internal/Magento/Framework/Interception/ObjectManager/Config diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt index 7e026c8f79932..b08055eedb4f7 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt @@ -39,4 +39,3 @@ dev/tests/unit/testsuite/Magento # Newer version of phpcs does not complain about spacing issue. This appears to be a bug in the phpcs version that is currently run in bamboo. app/code/Magento/Sales/Model/Order/Payment/Transaction.php vendor -setup/vendor diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index c0e44ce809bc9..1d53a63755720 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -41,7 +41,6 @@ app/code/Magento/Core/Model/Resource/Theme.php app/code/Magento/Core/Model/Theme app/code/Magento/Core/Model/Theme.php app/code/Magento/Core/Model/Url/SecurityInfo.php -app/code/Magento/Core/sql/core_setup/upgrade-1.6.0.3-1.6.0.4.php app/code/Magento/Cron/Model/Config/Converter app/code/Magento/Cron/Model/Config/Reader app/code/Magento/Cron/Model/Config/Data.php diff --git a/dev/tests/unit/testsuite/Magento/AdminGws/Model/ControllersTest.php b/dev/tests/unit/testsuite/Magento/AdminGws/Model/ControllersTest.php index a96c365a0ee96..30501ff5ac7ad 100644 --- a/dev/tests/unit/testsuite/Magento/AdminGws/Model/ControllersTest.php +++ b/dev/tests/unit/testsuite/Magento/AdminGws/Model/ControllersTest.php @@ -16,6 +16,11 @@ class ControllersTest extends \PHPUnit_Framework_TestCase */ protected $_roleMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $_storeManagerMock; + /** * Controller request object * @@ -38,7 +43,7 @@ protected function setUp() $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_roleMock = $this->getMock('Magento\AdminGws\Model\Role', [], [], '', false); $this->_objectFactory = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $storeManager = $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false); + $this->_storeManagerMock = $this->getMock('Magento\Store\Model\StoreManager', [], [], '', false); $response = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); $this->_controllerMock = $this->getMock('\Magento\Backend\App\Action', [], [], '', false); @@ -52,7 +57,7 @@ protected function setUp() 'role' => $this->_roleMock, 'registry' => $coreRegistry, 'objectManager' => $this->_objectFactory, - 'storeManager' => $storeManager, + 'storeManager' => $this->_storeManagerMock, 'response' => $response, 'request' => $this->_ctrlRequestMock ] @@ -344,6 +349,80 @@ public function testValidateRuleEntityActionDenyActionIfRoleHasNoAccessToAssigne $this->assertEmpty($this->_model->validateRuleEntityAction()); } + /** + * @param array $post + * @param boolean $result + * @param boolean $isAll + * + * @dataProvider validateCmsHierarchyActionDataProvider + */ + public function testValidateCmsHierarchyAction(array $post, $isAll, $result) + { + $this->_ctrlRequestMock->expects($this->any()) + ->method('getPost') + ->will($this->returnValue($post)); + $this->_ctrlRequestMock->expects($this->any()) + ->method('setActionName') + ->will($this->returnSelf()); + $websiteId = (isset($post['website']))? $post['website'] : 1; + $websiteMock = $this->getMockBuilder('\Magento\Store\Model\Website') + ->disableOriginalConstructor() + ->setMethods(['getId']) + ->getMock(); + $websiteMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue($websiteId)); + + $storeId = (isset($post['store']))? $post['store'] : 1; + $storeMock = $this->getMockBuilder('\Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->setMethods(['getId', 'getWebsite']) + ->getMock(); + $storeMock->expects($this->any()) + ->method('getId') + ->will($this->returnValue($storeId)); + $storeMock->expects($this->any()) + ->method('getWebsite') + ->will($this->returnValue($websiteMock)); + + $this->_storeManagerMock->expects($this->any()) + ->method('getStore') + ->will($this->returnValue($storeMock)); + + $hasExclusiveAccess = in_array($websiteMock->getId(), [1]); + $hasExclusiveStoreAccess = in_array($storeMock->getId(), [2]); + + $this->_roleMock->expects($this->any()) + ->method('hasExclusiveAccess') + ->will($this->returnValue($hasExclusiveAccess)); + + $this->_roleMock->expects($this->any()) + ->method('hasExclusiveStoreAccess') + ->will($this->returnValue($hasExclusiveStoreAccess)); + + $this->_roleMock->expects($this->any()) + ->method('getIsAll') + ->will($this->returnValue($isAll)); + + $this->assertEquals($result, $this->_model->validateCmsHierarchyAction()); + } + + /** + * Data provider for testValidateCmsHierarchyAction() + * + * @return array + */ + public function validateCmsHierarchyActionDataProvider() + { + return [ + [[], true, true], + [[], false, false], + [['website' => 1, 'store' => 1], false, false], + [['store' => 2], false, true], + [['store' => 1], false, false], + ]; + } + /* * Test validate rule entity action with valid params */ diff --git a/dev/tests/unit/testsuite/Magento/AdvancedCheckout/Controller/Adminhtml/IndexTest.php b/dev/tests/unit/testsuite/Magento/AdvancedCheckout/Controller/Adminhtml/IndexTest.php new file mode 100644 index 0000000000000..7bc2c0032f016 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/AdvancedCheckout/Controller/Adminhtml/IndexTest.php @@ -0,0 +1,150 @@ +objectManager = $this->getMock('Magento\Framework\ObjectManager\ObjectManager', [], [], '', false); + $this->customerBuilder = $this->getMock( + 'Magento\Customer\Api\Data\CustomerDataBuilder', + ['populateWithArray', 'create'], + [], + '', + false + ); + + $this->request = $this->getMock('Magento\Framework\App\Request\Http', ['getPost', 'getParam'], [], '', false); + $response = $this->getMock('Magento\Framework\App\ResponseInterface'); + + $context = $this->getMock('Magento\Backend\App\Action\Context', [], [], '', false); + $context->expects($this->once()) + ->method('getRequest') + ->willReturn($this->request); + $context->expects($this->once()) + ->method('getResponse') + ->willReturn($response); + $context->expects($this->once()) + ->method('getObjectManager') + ->willReturn($this->objectManager); + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->controller = $objectManager->getObject( + 'Magento\AdvancedCheckout\Controller\Adminhtml\Stub\Child', + ['context' => $context, 'customerBuilder' => $this->customerBuilder] + ); + } + + public function testInitData() + { + $this->request->expects($this->any()) + ->method('getParam') + ->willReturn(true); + + $customerModel = $this->getMock( + 'Magento\Customer\Model\Customer', + ['getWebsiteId', 'load', 'getId'], + [], + '', + false + ); + $customerModel->expects($this->once()) + ->method('load') + ->willReturnSelf(); + $customerModel->expects($this->once()) + ->method('getId') + ->willReturn(true); + $customerModel->expects($this->once()) + ->method('getWebsiteId') + ->willReturn(true); + + $store = $this->getMock('Magento\Store\Model\Store', [], [], '', false); + + $storeManager = $this->getMock('Magento\Store\Model\StoreManager', ['getWebsiteId', 'getStore'], [], '', false); + $storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($store); + + $quote = $this->getMock('Magento\Sales\Model\Quote', [], [], '', false); + $quote->expects($this->once()) + ->method('getId') + ->willReturn(false); + + $cart = $this->getMock('Magento\AdvancedCheckout\Model\Cart', [], [], '', false); + $cart->expects($this->once()) + ->method('setSession') + ->willReturnSelf(); + $cart->expects($this->once()) + ->method('setContext') + ->willReturnSelf(); + $cart->expects($this->once()) + ->method('setCurrentStore') + ->willReturnSelf(); + $cart->expects($this->once()) + ->method('getQuote') + ->willReturn($quote); + + $session = $this->getMock('Magento\Backend\Model\Session', [], [], '', false); + $quoteRepository = $this->getMock('Magento\Sales\Model\QuoteRepository', [], [], '', false); + + $this->objectManager->expects($this->at(0)) + ->method('create') + ->with('Magento\Customer\Model\Customer') + ->willReturn($customerModel); + $this->objectManager->expects($this->at(1)) + ->method('get') + ->with('Magento\Store\Model\StoreManager') + ->willReturn($storeManager); + $this->objectManager->expects($this->at(2)) + ->method('get') + ->with('Magento\AdvancedCheckout\Model\Cart') + ->willReturn($cart); + $this->objectManager->expects($this->at(3)) + ->method('get') + ->with('Magento\Backend\Model\Session') + ->willReturn($session); + $this->objectManager->expects($this->at(4)) + ->method('get') + ->with('Magento\Sales\Model\QuoteRepository') + ->willReturn($quoteRepository); + + $customerData = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + + $this->customerBuilder->expects($this->once()) + ->method('populateWithArray') + ->willReturnSelf(); + $this->customerBuilder->expects($this->once()) + ->method('create') + ->willReturn($customerData); + $quote->expects($this->once()) + ->method('setStore') + ->willReturnSelf(); + $quote->expects($this->once()) + ->method('setCustomer') + ->with($customerData); + + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/AdvancedCheckout/Controller/Adminhtml/Stub/Child.php b/dev/tests/unit/testsuite/Magento/AdvancedCheckout/Controller/Adminhtml/Stub/Child.php new file mode 100644 index 0000000000000..ec14302ba08e2 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/AdvancedCheckout/Controller/Adminhtml/Stub/Child.php @@ -0,0 +1,13 @@ +_initData(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php index 71b75f6b2ae7f..4580350a94ef9 100644 --- a/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Authorizenet/Helper/DataTest.php @@ -49,7 +49,7 @@ public function testGetTransactionMessage($type, $amount, $exception, $additiona $payment->expects($this->any()) ->method('getOrder') ->will($this->returnValue($order)); - $card = new \Magento\Framework\Object(['cc_last4' => self::LAST4]); + $card = new \Magento\Framework\Object(['cc_last_4' => self::LAST4]); $message = $this->_model->getTransactionMessage( $payment, $type, diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php index f830d732e948c..68adb8e241a21 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/BundleSelectionPriceTest.php @@ -168,9 +168,10 @@ public function testGetValueTypeDynamic($useRegularPrice) { $this->setupSelectionPrice($useRegularPrice); $priceCode = $useRegularPrice ? RegularPrice::PRICE_CODE : FinalPrice::PRICE_CODE; - $regularPrice = 100; - $discountedPrice = 70; - $expectedPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $regularPrice = 100.125; + $discountedPrice = 70.453; + $actualPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $expectedPrice = $useRegularPrice ? round($regularPrice, 2) : round($discountedPrice, 2); $this->bundleMock->expects($this->once()) ->method('getPriceType') @@ -181,18 +182,23 @@ public function testGetValueTypeDynamic($useRegularPrice) ->will($this->returnValue($this->finalPriceMock)); $this->finalPriceMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($regularPrice)); + ->will($this->returnValue($actualPrice)); if (!$useRegularPrice) { $this->discountCalculatorMock->expects($this->once()) ->method('calculateDiscount') ->with( $this->equalTo($this->bundleMock), - $this->equalTo($regularPrice) + $this->equalTo($actualPrice) ) ->will($this->returnValue($discountedPrice)); } - $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); + + $this->priceCurrencyMock->expects($this->once()) + ->method('round') + ->with($actualPrice) + ->will($this->returnValue($expectedPrice)); + $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); } @@ -205,9 +211,10 @@ public function testGetValueTypeDynamic($useRegularPrice) public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) { $this->setupSelectionPrice($useRegularPrice); - $regularPrice = 100; - $discountedPrice = 70; - $expectedPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $regularPrice = 100.125; + $discountedPrice = 70.453; + $actualPrice = $useRegularPrice ? $regularPrice : $discountedPrice; + $expectedPrice = $useRegularPrice ? round($regularPrice, 2) : round($discountedPrice, 2); $this->bundleMock->expects($this->once()) ->method('getPriceType') @@ -221,7 +228,7 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) ->will($this->returnValue($this->regularPriceMock)); $this->regularPriceMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($regularPrice)); + ->will($this->returnValue($actualPrice)); $this->bundleMock->expects($this->once()) ->method('setFinalPrice') ->will($this->returnSelf()); @@ -229,7 +236,8 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) ->method('dispatch'); $this->bundleMock->expects($this->exactly(2)) ->method('getData') - ->will($this->returnValueMap( + ->will( + $this->returnValueMap( [ ['qty', null, 1], ['final_price', null, 100], @@ -241,17 +249,23 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) ->will($this->returnValue(true)); $this->productMock->expects($this->any()) ->method('getSelectionPriceValue') - ->will($this->returnValue($regularPrice)); + ->will($this->returnValue($actualPrice)); if (!$useRegularPrice) { $this->discountCalculatorMock->expects($this->once()) ->method('calculateDiscount') ->with( $this->equalTo($this->bundleMock), - $this->equalTo($regularPrice) + $this->equalTo($actualPrice) ) ->will($this->returnValue($discountedPrice)); } + + $this->priceCurrencyMock->expects($this->once()) + ->method('round') + ->with($actualPrice) + ->will($this->returnValue($expectedPrice)); + $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); } @@ -264,10 +278,11 @@ public function testGetValueTypeFixedWithSelectionPriceType($useRegularPrice) public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) { $this->setupSelectionPrice($useRegularPrice); - $regularPrice = 100; - $discountedPrice = 70; - $convertedValue = 100.02; - $expectedPrice = $useRegularPrice ? $convertedValue : $discountedPrice; + $regularPrice = 100.125; + $discountedPrice = 70.453; + $convertedValue = 100.247; + $actualPrice = $useRegularPrice ? $convertedValue : $discountedPrice; + $expectedPrice = $useRegularPrice ? round($convertedValue, 2) : round($discountedPrice, 2); $this->bundleMock->expects($this->once()) ->method('getPriceType') @@ -280,7 +295,7 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) ->will($this->returnValue($regularPrice)); $this->priceCurrencyMock->expects($this->once()) - ->method('convertAndRound') + ->method('convert') ->with($regularPrice) ->will($this->returnValue($convertedValue)); @@ -293,6 +308,12 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice) ) ->will($this->returnValue($discountedPrice)); } + + $this->priceCurrencyMock->expects($this->once()) + ->method('round') + ->with($actualPrice) + ->will($this->returnValue($expectedPrice)); + $this->assertEquals($expectedPrice, $this->selectionPrice->getValue()); } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Category/AbstractCategoryTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Category/AbstractCategoryTest.php new file mode 100644 index 0000000000000..be0554b982b1f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Category/AbstractCategoryTest.php @@ -0,0 +1,118 @@ +objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + + $this->contextMock = $this->getMock( + 'Magento\Backend\Block\Template\Context', + [], + [], + '', + false + ); + + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->contextMock->expects($this->any()) + ->method('getRequest') + ->will($this->returnValue($this->requestMock)); + + $this->urlBuilderMock = $this->getMockBuilder('Magento\Framework\UrlInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->storeManagerMock = $this->getMockBuilder('\Magento\Store\Model\StoreManagerInterface') + ->disableOriginalConstructor() + ->getMock(); + + $this->contextMock->expects($this->any()) + ->method('getStoreManager') + ->will($this->returnValue($this->storeManagerMock)); + + $this->storeMock = $this->getMockBuilder('Magento\Store\Model\Store') + ->disableOriginalConstructor() + ->getMock(); + + $this->contextMock->expects($this->any()) + ->method('getUrlBuilder') + ->will($this->returnValue($this->urlBuilderMock)); + + $this->category = $this->objectManager->getObject( + 'Magento\Catalog\Block\Adminhtml\Category\AbstractCategory', + [ + 'context' => $this->contextMock, + ] + ); + } + + /** + * @covers \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory::getStore + * @covers \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory::getSaveUrl + */ + public function testGetSaveUrl() + { + $storeId = 23; + $saveUrl = 'save URL'; + $params = ['_current' => false, '_query' => false, 'store' => $storeId]; + + + $this->requestMock->expects($this->once())->method('getParam')->with('store')->willReturn($storeId); + $this->storeManagerMock->expects($this->once()) + ->method('getStore') + ->with($storeId) + ->willReturn($this->storeMock); + $this->storeMock->expects($this->once())->method('getId')->willReturn($storeId); + + $this->urlBuilderMock->expects($this->once()) + ->method('getUrl') + ->with('catalog/*/save', $params) + ->willReturn($saveUrl); + + $this->assertEquals($saveUrl, $this->category->getSaveUrl()); + } + +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Controller/Product/Compare/IndexTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Product/Compare/IndexTest.php new file mode 100644 index 0000000000000..a46b5a2806a0c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Controller/Product/Compare/IndexTest.php @@ -0,0 +1,164 @@ +contextMock = $this->getMock('Magento\Framework\App\Action\Context', + ['getRequest', 'getResponse'], + [], + '', + false + ); + $this->request = $this->getMock('Magento\Framework\App\RequestInterface', [], [], '', false); + $this->response = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); + $this->contextMock->expects($this->any()) + ->method('getRequest') + ->willReturn($this->request); + $this->contextMock->expects($this->any()) + ->method('getResponse') + ->willReturn($this->response); + + $this->itemFactoryMock = $this->getMock('Magento\Catalog\Model\Product\Compare\ItemFactory', [], [], '', false); + $this->collectionFactoryMock = $this->getMock( + 'Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory', + [], + [], + '', + false + ); + $this->sessionMock = $this->getMock('Magento\Customer\Model\Session', [], [], '', false); + $this->visitorMock = $this->getMock('Magento\Customer\Model\Visitor', [], [], '', false); + $this->listCompareMock = $this->getMock('Magento\Catalog\Model\Product\Compare\ListCompare', [], [], '', false); + $this->catalogSession = $this->getMock('Magento\Catalog\Model\Session', ['setBeforeCompareUrl'], [], '', false); + $this->storeManagerMock = $this->getMock('Magento\Store\Model\StoreManagerInterface'); + $this->formKeyValidatorMock = $this->getMock('Magento\Core\App\Action\FormKeyValidator', [], [], '', false); + $this->redirectFactoryMock = $this->getMock( + 'Magento\Framework\Controller\Result\RedirectFactory', + ['create'], + [], + '', + false + ); + $this->pageFactoryMock = $this->getMock('Magento\Framework\View\Result\PageFactory', [], [], '', false); + $this->productRepositoryMock = $this->getMock('Magento\Catalog\Api\ProductRepositoryInterface'); + $this->decoderMock = $this->getMock('Magento\Framework\Url\DecoderInterface'); + + $this->index = new Index( + $this->contextMock, + $this->itemFactoryMock, + $this->collectionFactoryMock, + $this->sessionMock, + $this->visitorMock, + $this->listCompareMock, + $this->catalogSession, + $this->storeManagerMock, + $this->formKeyValidatorMock, + $this->redirectFactoryMock, + $this->pageFactoryMock, + $this->productRepositoryMock, + $this->decoderMock + ); + } + + public function testExecute() + { + $beforeUrl = 'test_url'; + $this->request->expects($this->any()) + ->method('getParam') + ->willReturnMap([ + ['items', null, null], + ['uenc', null, $beforeUrl], + ]); + $this->decoderMock->expects($this->once()) + ->method('decode') + ->with($beforeUrl) + ->willReturn($beforeUrl . '1'); + $this->catalogSession->expects($this->once()) + ->method('setBeforeCompareUrl') + ->with($beforeUrl . '1') + ->willReturnSelf(); + $this->listCompareMock->expects($this->never())->method('addProducts'); + $this->redirectFactoryMock->expects($this->never())->method('create'); + $this->index->execute(); + } + + public function testExecuteWithItems() + { + $this->request->expects($this->any()) + ->method('getParam') + ->willReturnMap([ + ['items', null, '1,2,3'], + ['uenc', null, null], + ]); + $this->decoderMock->expects($this->never())->method('decode'); + $this->catalogSession->expects($this->never())->method('setBeforeCompareUrl'); + + $this->listCompareMock->expects($this->once()) + ->method('addProducts') + ->with([1, 2, 3]); + $redirect = $this->getMock('Magento\Framework\Controller\Result\Redirect', ['setPath'], [], '', false); + $redirect->expects($this->once()) + ->method('setPath') + ->with('*/*/*'); + $this->redirectFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($redirect); + $this->index->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php index 07abdac6da914..a918e7be095e2 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/CategoryTest.php @@ -90,16 +90,27 @@ protected function setUp() $this->registry = $this->getMock('Magento\Framework\Registry'); $this->storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); $this->categoryTreeResource = $this->getMock('Magento\Catalog\Model\Resource\Category\Tree', [], [], '', false); - $this->categoryTreeFactory = $this->getMock('Magento\Catalog\Model\Resource\Category\TreeFactory', ['create']); + $this->categoryTreeFactory = $this->getMock( + 'Magento\Catalog\Model\Resource\Category\TreeFactory', + ['create'], + [], + '', + false); $this->categoryRepository = $this->getMock('Magento\Catalog\Api\CategoryRepositoryInterface'); $this->storeCollectionFactory = $this->getMock( 'Magento\Store\Model\Resource\Store\CollectionFactory', - ['create'] + ['create'], + [], + '', + false ); $this->url = $this->getMock('Magento\Framework\UrlInterface'); $this->productCollectionFactory = $this->getMock( 'Magento\Catalog\Model\Resource\Product\CollectionFactory', - ['create'] + ['create'], + [], + '', + false ); $this->catalogConfig = $this->getMock('Magento\Catalog\Model\Config', [], [], '', false); $this->filterManager = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Indexer/Category/Product/ExecuteTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Indexer/Category/Product/ExecuteTest.php new file mode 100644 index 0000000000000..ed548429e9b65 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Catalog/Plugin/Model/Indexer/Category/Product/ExecuteTest.php @@ -0,0 +1,77 @@ +config = $this->getMockBuilder('Magento\PageCache\Model\Config') + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMock(); + $this->typeList = $this->getMockBuilder('Magento\Framework\App\Cache\TypeListInterface') + ->disableOriginalConstructor() + ->setMethods(['invalidate']) + ->getMockForAbstractClass(); + + $this->execute = new Execute($this->config, $this->typeList); + } + + public function testAfterExecute() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $result = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->config->expects($this->once()) + ->method('isEnabled') + ->willReturn(false); + $this->typeList->expects($this->never()) + ->method('invalidate'); + + $this->assertEquals( + $result, + $this->execute->afterExecute($subject, $result) + ); + } + + public function testAfterExecuteInvalidate() + { + $subject = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $result = $this->getMockBuilder('Magento\Catalog\Model\Indexer\Category\Product\AbstractAction') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->config->expects($this->once()) + ->method('isEnabled') + ->willReturn(true); + $this->typeList->expects($this->once()) + ->method('invalidate') + ->with('full_page'); + + $this->assertEquals( + $result, + $this->execute->afterExecute($subject, $result) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php index 7454a4a0a2c84..85de9a5d76886 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Layer/Filter/AttributeTest.php @@ -243,10 +243,16 @@ public function testGetItemsWithoutApply() 'value' => 'selectedOptionValue2', 'count' => 13, ], + [ + 'label' => 'selectedOptionLabel3', + 'value' => 'selectedOptionValue3', + 'count' => 10, + ], ]; $facetedData = [ 'selectedOptionValue1' => ['count' => 10], 'selectedOptionValue2' => ['count' => 45], + 'selectedOptionValue3' => ['count' => 50], ]; $builtData = [ @@ -260,14 +266,25 @@ public function testGetItemsWithoutApply() 'value' => $selectedOptions[1]['value'], 'count' => $facetedData[$selectedOptions[1]['value']]['count'], ], + [ + 'label' => $selectedOptions[2]['label'], + 'value' => $selectedOptions[2]['value'], + 'count' => $facetedData[$selectedOptions[2]['value']]['count'], + ], ]; $this->attribute->expects($this->exactly(2)) ->method('getAttributeCode') ->will($this->returnValue($attributeCode)); - $this->attribute->expects($this->exactly(count($selectedOptions))) + $this->attribute->expects($this->at(3)) + ->method('getIsFilterable') + ->will($this->returnValue(1)); + $this->attribute->expects($this->at(4)) + ->method('getIsFilterable') + ->will($this->returnValue(2)); + $this->attribute->expects($this->at(5)) ->method('getIsFilterable') - ->will($this->returnValue(true)); + ->will($this->returnValue(1)); $this->target->setAttributeModel($this->attribute); @@ -306,6 +323,7 @@ public function testGetItemsWithoutApply() $expectedFilterItems = [ $this->createFilterItem(0, $builtData[0]['label'], $builtData[0]['value'], $builtData[0]['count']), $this->createFilterItem(1, $builtData[1]['label'], $builtData[1]['value'], $builtData[1]['count']), + $this->createFilterItem(2, $builtData[2]['label'], $builtData[2]['value'], $builtData[2]['count']), ]; $result = $this->target->getItems(); diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/Fulltext/CollectionTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/Fulltext/CollectionTest.php new file mode 100644 index 0000000000000..d1010e60398ae --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/Fulltext/CollectionTest.php @@ -0,0 +1,146 @@ +getStoreManager(); + $universalFactory = $this->getUniversalFactory(); + $scopeConfig = $this->getScopeConfig(); + $requestBuilder = $this->getRequestBuilder(); + + $this->model = $helper->getObject( + 'Magento\CatalogSearch\Model\Resource\Fulltext\Collection', + [ + 'storeManager' => $storeManager, + 'universalFactory' => $universalFactory, + 'scopeConfig' => $scopeConfig, + 'requestBuilder' => $requestBuilder + ] + ); + } + + /** + * @expectedException \Exception + * @expectedExceptionCode 333 + * @expectedExceptionMessage setRequestName + */ + public function testGetFacetedData() + { + $this->model->getFacetedData('field'); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getStoreManager() + { + $store = $this->getMockBuilder('Magento\Store\Model\Store') + ->setMethods(['getId']) + ->disableOriginalConstructor() + ->getMock(); + $store->expects($this->once()) + ->method('getId') + ->willReturn(1); + + $storeManager = $this->getMockBuilder('Magento\Store\Model\StoreManagerInterface') + ->setMethods(['getStore']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $storeManager->expects($this->once()) + ->method('getStore') + ->willReturn($store); + + return $storeManager; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getUniversalFactory() + { + $connection = $this->getMockBuilder('Zend_Db_Adapter_Abstract') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $entity = $this->getMockBuilder('Magento\Eav\Model\Entity\AbstractEntity') + ->setMethods(['getReadConnection', 'getTable', 'getDefaultAttributes', 'getEntityTable']) + ->disableOriginalConstructor() + ->getMock(); + $entity->expects($this->once()) + ->method('getReadConnection') + ->willReturn($connection); + $entity->expects($this->exactly(2)) + ->method('getTable') + ->willReturnArgument(0); + $entity->expects($this->once()) + ->method('getDefaultAttributes') + ->willReturn(['attr1', 'attr2']); + $entity->expects($this->once()) + ->method('getEntityTable') + ->willReturn('table'); + + $universalFactory = $this->getMockBuilder('Magento\Framework\Validator\UniversalFactory') + ->setMethods(['create']) + ->disableOriginalConstructor() + ->getMock(); + $universalFactory->expects($this->once()) + ->method('create') + ->willReturn($entity); + + return $universalFactory; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getScopeConfig() + { + $scopeConfig = $this->getMockBuilder('Magento\Framework\App\Config\ScopeConfigInterface') + ->setMethods(['getValue']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $scopeConfig->expects($this->once()) + ->method('getValue') + ->willReturn(1); + + return $scopeConfig; + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getRequestBuilder() + { + $requestBuilder = $this->getMockBuilder('Magento\Framework\Search\Request\Builder') + ->setMethods(['bind', 'setRequestName']) + ->disableOriginalConstructor() + ->getMock(); + $requestBuilder->expects($this->once()) + ->method('bind') + ->withConsecutive(['price_dynamic_algorithm', 1]); + $requestBuilder->expects($this->once()) + ->method('setRequestName') + ->withConsecutive(['quick_search_container']) + ->willThrowException(new \Exception('setRequestName', 333)); + + return $requestBuilder; + } +} diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php index a493371230794..eeda495eee7b4 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Search/RequestGeneratorTest.php @@ -68,6 +68,11 @@ public function testGenerate($countResult, $code, $type, $visibleInAdvanced = tr ] ) ); + $collection->expects($this->any()) + ->method('addFieldToFilter') + ->with(['is_searchable', 'is_visible_in_advanced_search', 'is_filterable'], [1, 1, [1, 2]]) + ->will($this->returnSelf()); + $this->productAttributeCollectionFactory->expects($this->any()) ->method('create') ->willReturn($collection); diff --git a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php index 309b812ce89b9..07dddcb05df0e 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGeneratorTest.php @@ -54,22 +54,6 @@ protected function setUp() ); } - /** - * @return array - */ - public function getUrlPathDataProvider() - { - $noGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING - 1; - $requireGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING; - return [ - [Category::TREE_ROOT_ID, 'url-path', $noGenerationLevel, '', false, false, ''], - ['parent_id', 'url-path', $noGenerationLevel, '', false, false, 'url-path'], - ['parent_id', 'url-path', $noGenerationLevel, 'url-key', true, false, 'url-key'], - ['parent_id', 'url-path', $noGenerationLevel, 'url-key', false, true, 'url-key'], - [null, 'url-path', $requireGenerationLevel, 'url-key', false, true, 'url-key'], - ]; - } - /** * @dataProvider getUrlPathDataProvider * @param int $parentId @@ -99,6 +83,23 @@ public function testGetUrlPath( $this->assertEquals($result, $this->categoryUrlPathGenerator->getUrlPath($this->category)); } + /** + * @return array + */ + public function getUrlPathDataProvider() + { + $noGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING - 1; + $requireGenerationLevel = CategoryUrlPathGenerator::MINIMAL_CATEGORY_LEVEL_FOR_PROCESSING; + return [ + [Category::TREE_ROOT_ID, 'url-path', $noGenerationLevel, '', false, false, ''], + ['parent_id', 'url-path', $noGenerationLevel, '', false, false, 'url-path'], + ['parent_id', 'url-path', $noGenerationLevel, 'url-key', true, false, 'url-key'], + ['parent_id', 'url-path', $noGenerationLevel, 'url-key', false, true, 'url-key'], + [null, 'url-path', $requireGenerationLevel, 'url-key', false, true, 'url-key'], + ['parent_id', 'url-path', $noGenerationLevel, false, true, true, 'url-path'], + ]; + } + /** * @return array */ diff --git a/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorTest.php b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorTest.php new file mode 100644 index 0000000000000..08cd061150df5 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CatalogUrlRewrite/Observer/CategoryUrlPathAutogeneratorTest.php @@ -0,0 +1,67 @@ +observer = $this->getMock( + 'Magento\Framework\Event\Observer', + ['getEvent', 'getCategory'], + [], + '', + false + ); + $this->category = $this->getMock( + 'Magento\Catalog\Model\Category', + ['getUrlKey', 'setUrlKey', 'setUrlPath'], + [], + '', + false + ); + $this->observer->expects($this->any())->method('getEvent')->willReturnSelf(); + $this->observer->expects($this->any())->method('getCategory')->willReturn($this->category); + $this->categoryUrlPathGenerator = $this->getMock( + 'Magento\CatalogUrlRewrite\Model\CategoryUrlPathGenerator', + [], + [], + '', + false + ); + + $this->unit = (new ObjectManagerHelper($this))->getObject( + 'Magento\CatalogUrlRewrite\Observer\CategoryUrlPathAutogenerator', + ['categoryUrlPathGenerator' => $this->categoryUrlPathGenerator] + ); + } + + public function testInvokeWithGeneration() + { + $this->category->expects($this->once())->method('getUrlKey')->willReturn('category'); + $this->category->expects($this->once())->method('setUrlKey')->willReturnSelf(); + $this->category->expects($this->once())->method('setUrlPath')->willReturnSelf(); + $this->unit->invoke($this->observer); + } + + public function testInvokeWithoutGeneration() + { + $this->category->expects($this->once())->method('getUrlKey')->willReturn(false); + $this->category->expects($this->never())->method('setUrlKey')->willReturnSelf(); + $this->category->expects($this->never())->method('setUrlPath')->willReturnSelf(); + $this->unit->invoke($this->observer); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php index 9fae33ea29383..8a9b8f188a6f2 100644 --- a/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Centinel/Model/ObserverTest.php @@ -10,7 +10,7 @@ public function testPaymentFormBlockToHtmlBefore() { $method = $this->getMock( 'Magento\Paypal\Model\Payflowpro', - ['getIsCentinelValidationEnabled'], + ['getIsCentinelValidationEnabled', 'getCode'], [], '', false @@ -19,6 +19,10 @@ public function testPaymentFormBlockToHtmlBefore() ->method('getIsCentinelValidationEnabled') ->will($this->returnValue(true)); + $method->expects($this->once()) + ->method('getCode') + ->willReturn('payflowpro'); + $blockLogo = $this->getMock( 'Magento\Centinel\Block\Logo', ['setMethod'], diff --git a/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php b/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php index 0ff086f160630..e5b7eb3968374 100644 --- a/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php +++ b/dev/tests/unit/testsuite/Magento/Cron/Model/ScheduleTest.php @@ -157,22 +157,35 @@ public function setCronExprExceptionDataProvider() public function testTrySchedule($scheduledAt, $cronExprArr, $expected) { // 1. Create mocks - $date = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateTime') + $timezoneMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\TimezoneInterface') ->disableOriginalConstructor() - ->getMock(); + ->setMethods(['date']) + ->getMockForAbstractClass(); + $dateMock = $this->getMockBuilder('Magento\Framework\Stdlib\DateTime\DateInterface') + ->disableOriginalConstructor() + ->setMethods(['get']) + ->getMockForAbstractClass(); /** @var \Magento\Cron\Model\Schedule $model */ $model = $this->helper->getObject( 'Magento\Cron\Model\Schedule', [ - 'date' => $date + 'timezone' => $timezoneMock ] ); // 2. Set fixtures $model->setScheduledAt($scheduledAt); $model->setCronExprArr($cronExprArr); - $date->expects($this->any())->method('timestamp')->will($this->returnArgument(0)); + if ($scheduledAt && $cronExprArr) { + $timezoneMock->expects($this->once())->method('date')->willReturn($dateMock); + $date = getdate(is_numeric($scheduledAt) ? $scheduledAt : strtotime($scheduledAt)); + $dateMock->expects($this->at(0))->method('get')->with(\Zend_Date::MINUTE)->willReturn($date['minutes']); + $dateMock->expects($this->at(1))->method('get')->with(\Zend_Date::HOUR)->willReturn($date['hours']); + $dateMock->expects($this->at(2))->method('get')->with(\Zend_Date::DAY)->willReturn($date['mday']); + $dateMock->expects($this->at(3))->method('get')->with(\Zend_Date::MONTH)->willReturn($date['mon']); + $dateMock->expects($this->at(4))->method('get')->with(\Zend_Date::WEEKDAY)->willReturn($date['wday']); + } // 3. Run tested method $result = $model->trySchedule(); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/NewsletterTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/NewsletterTest.php new file mode 100644 index 0000000000000..4ddb6f8c5c7ba --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/NewsletterTest.php @@ -0,0 +1,35 @@ +urlBuilder = $this->getMock('\Magento\Framework\UrlInterface'); + $helper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->block = $helper->getObject('\Magento\Customer\Block\Newsletter', ['urlBuilder' => $this->urlBuilder]); + } + + public function testGetAction() + { + $this->urlBuilder->expects($this->once()) + ->method('getUrl') + ->with('newsletter/manage/save', []) + ->willReturn('newsletter/manage/save'); + + $this->assertEquals('newsletter/manage/save', $this->block->getAction()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Backend/BooleanTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Backend/BooleanTest.php new file mode 100644 index 0000000000000..be8d90c25021d --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Attribute/Backend/BooleanTest.php @@ -0,0 +1,78 @@ +model = new \Magento\Customer\Model\Attribute\Backend\Data\Boolean(); + } + + /** + * @param mixed $value + * @param mixed $defaultValue + * @param string|mixed $result + * + * @dataProvider beforeSaveDataProvider + */ + public function testBeforeSave($value, $defaultValue, $result) + { + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\AbstractAttribute') + ->setMethods(['getName', 'getDefaultValue']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $customerMock = $this->getMockBuilder('Magento\Customer\Model\Customer') + ->disableOriginalConstructor() + ->getMock(); + + $this->model->setAttribute($attributeMock); + + $attributeMock->expects($this->once()) + ->method('getName') + ->willReturn('attribute_name'); + $attributeMock->expects($this->any()) + ->method('getDefaultValue') + ->willReturn($defaultValue); + + $customerMock->expects($this->once()) + ->method('getData') + ->with('attribute_name', null) + ->willReturn($value); + $customerMock->expects($this->once()) + ->method('setData') + ->with('attribute_name', $result) + ->willReturnSelf(); + + $this->assertEquals($this->model, $this->model->beforeSave($customerMock)); + } + + /** + * @return array + */ + public function beforeSaveDataProvider() + { + return [ + [null, null, '0'], + [null, '', '0'], + [null, '0', '0'], + [null, '1', '1'], + [null, 'Yes', '1'], + ['', null, '0'], + ['0', null, '0'], + ['0', '1', '0'], + ['1', null, '1'], + ['1', 'Yes', '1'], + ['Yes', null, '1'], + ['Yes', 'Yes', '1'], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php b/dev/tests/unit/testsuite/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php new file mode 100644 index 0000000000000..023c81ab5c107 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Customer/Model/Config/Backend/CreateAccount/DisableAutoGroupAssignDefaultTest.php @@ -0,0 +1,58 @@ +eavConfigMock = $this->getMockBuilder('Magento\Eav\Model\Config') + ->disableOriginalConstructor() + ->getMock(); + + $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectManager->getObject( + 'Magento\Customer\Model\Config\Backend\CreateAccount\DisableAutoGroupAssignDefault', + [ + 'eavConfig' => $this->eavConfigMock, + ] + ); + } + + public function testAfterSave() + { + $value = true; + + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Entity\Attribute\AbstractAttribute') + ->setMethods(['save', 'setData']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->eavConfigMock->expects($this->once()) + ->method('getAttribute') + ->with('customer', 'disable_auto_group_change') + ->willReturn($attributeMock); + + $attributeMock->expects($this->once()) + ->method('setData') + ->with('default_value', $value); + $attributeMock->expects($this->once()) + ->method('save'); + + $this->model->setValue($value); + + $this->assertEquals($this->model, $this->model->afterSave()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/CustomerBalance/Model/Balance/HistoryTest.php b/dev/tests/unit/testsuite/Magento/CustomerBalance/Model/Balance/HistoryTest.php new file mode 100644 index 0000000000000..b76ae786668c6 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/CustomerBalance/Model/Balance/HistoryTest.php @@ -0,0 +1,161 @@ +balanceModelMock = $this->getMock( + '\Magento\CustomerBalance\Model\Balance', + ['getNotifyByEmail', 'getStoreId', 'getCustomer', 'getWebsiteId', 'getAmount'], + [], + '', + false + ); + $this->scopeConfigMock = $this->getMock( + '\Magento\Framework\App\Config\ScopeConfigInterface', + [], + [], + '', + false + ); + $this->transportBuilderMock = $this->getMock( + '\Magento\Framework\Mail\Template\TransportBuilder', + [], + [], + '', + false + ); + $this->resourceMock = $this->getMockForAbstractClass( + '\Magento\Framework\Model\Resource\AbstractResource', + [], + '', + false, + false, + true, + ['getIdFieldName', 'markAsSent'] + ); + $this->customerRegistryMock = $this->getMock('\Magento\Customer\Model\CustomerRegistry', [], [], '', false); + $this->storeManagerMock = $this->getMock('\Magento\Store\Model\StoreManagerInterface'); + $this->designMock = $this->getMock('\Magento\Framework\View\DesignInterface'); + $objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->model = $objectHelper->getObject( + '\Magento\CustomerBalance\Model\Balance\History', + [ + 'customerRegistry' => $this->customerRegistryMock, + 'transportBuilder' => $this->transportBuilderMock, + 'scopeConfig' => $this->scopeConfigMock, + 'design' => $this->designMock, + 'storeManager' => $this->storeManagerMock, + 'resource' => $this->resourceMock + ] + ); + } + + public function testAfterSave() + { + $this->model->setBalanceModel($this->balanceModelMock); + $customerId = 1; + $storeId = 2; + $websiteId = 3; + $templateIdentifier = 'tpl'; + $area = 'area'; + $format = 'format'; + $amount = 10; + $customerName = 'John Doe'; + $customerEmail = 'johndoe@example.com'; + + $customerDataMock = $this->getMock('\Magento\Customer\Model\Data\Customer', ['getId'], [], '', false); + $customerMock = $this->getMock('\Magento\Customer\Model\Customer', ['getEmail', 'getName'], [], '', false); + $storeMock = $this->getMock('\Magento\Store\Model\Store', [], [], '', false); + $transportMock = $this->getMock('\Magento\Framework\Mail\TransportInterface'); + $websiteMock = $this->getMock('\Magento\Store\Model\Website', [], [], '', false); + $currencyMock = $this->getMock('\Magento\Directory\Model\Currency', [], [], '', false); + $this->balanceModelMock->expects($this->once())->method('getNotifyByEmail')->willReturn(true); + $this->balanceModelMock->expects($this->once())->method('getStoreId')->willReturn($storeId); + $this->balanceModelMock->expects($this->once())->method('getCustomer')->willReturn($customerDataMock); + $customerDataMock->expects($this->once())->method('getId')->willReturn($customerId); + $this->customerRegistryMock->expects($this->once())->method('retrieve')->with($customerId) + ->willReturn($customerMock); + $this->scopeConfigMock->expects($this->exactly(2))->method('getValue')->withConsecutive( + [ + 'customer/magento_customerbalance/email_template', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $storeId + ], + [ + 'customer/magento_customerbalance/email_identity', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE, + $storeId + ] + )->willReturn($templateIdentifier); + $this->transportBuilderMock->expects($this->once())->method('setTemplateIdentifier')->with($templateIdentifier) + ->willReturnSelf(); + $this->designMock->expects($this->once())->method('getArea')->willReturn($area); + $this->transportBuilderMock->expects($this->once())->method('setTemplateOptions')->with( + ['area' => $area, 'store' => $storeId] + )->willReturnSelf(); + $this->balanceModelMock->expects($this->once())->method('getWebsiteId')->willReturn($websiteId); + $this->storeManagerMock->expects($this->once())->method('getWebsite')->with($websiteId) + ->willReturn($websiteMock); + $websiteMock->expects($this->once())->method('getBaseCurrency')->willReturn($currencyMock); + $this->balanceModelMock->expects($this->once())->method('getAmount')->willReturn($amount); + $currencyMock->expects($this->once())->method('format')->with($amount, [], false)->willReturn($format); + $customerMock->expects($this->exactly(2))->method('getName')->willReturn($customerName); + $this->storeManagerMock->expects($this->once())->method('getStore')->willReturn($storeMock); + $this->transportBuilderMock->expects($this->once())->method('setTemplateVars')->with( + ['balance' => $format, 'name' => $customerName, 'store' => $storeMock] + )->willReturnSelf(); + $this->transportBuilderMock->expects($this->once())->method('setFrom')->with($templateIdentifier) + ->willReturnSelf(); + $customerMock->expects($this->once())->method('getEmail')->willReturn($customerEmail); + $this->transportBuilderMock->expects($this->once())->method('addTo')->with($customerEmail, $customerName) + ->willReturnSelf(); + $this->transportBuilderMock->expects($this->once())->method('getTransport')->willReturn($transportMock); + $transportMock->expects($this->once())->method('sendMessage'); + $this->assertEquals($this->model, $this->model->afterSave()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php index bc4b30a03a8b7..165e730f0af39 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Varien/Router/StandardTest.php @@ -74,7 +74,7 @@ public function testMatch( */ public function matchDataProvider() { - $configMock = $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface'); + $objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); $this->_cookieReaderMock = $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'); $uri = self::TEST_HOST . '/' . self::VDE_FRONT_NAME . self::TEST_PATH; $notVdeUrl = self::TEST_HOST . self::TEST_PATH; @@ -96,7 +96,7 @@ public function matchDataProvider() $matchedRequest = $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], - [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $uri] + [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $objectManagerMock, $uri] ); $matchedController = $this->getMockForAbstractClass( @@ -135,7 +135,11 @@ public function matchDataProvider() 'not vde request' => [ '$request' => $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], [ - $routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $notVdeUrl + $routerListMock, + $infoProcessorMock, + $this->_cookieReaderMock, + $objectManagerMock, + $notVdeUrl ] ), '$isVde' => false, @@ -145,7 +149,7 @@ public function matchDataProvider() '$request' => $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], - [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $uri] + [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $objectManagerMock, $uri] ), '$isVde' => true, '$isLoggedIn' => false, @@ -154,7 +158,7 @@ public function matchDataProvider() '$request' => $this->getMock( 'Magento\Framework\App\Request\Http', ['_isFrontArea'], - [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $configMock, $uri] + [$routerListMock, $infoProcessorMock, $this->_cookieReaderMock, $objectManagerMock, $uri] ), '$isVde' => true, '$isLoggedIn' => true, diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php index dfdab0bce8b78..4f3c2ce59bd77 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Block/Catalog/Product/LinksTest.php @@ -6,7 +6,6 @@ namespace Magento\Downloadable\Block\Catalog\Product; use Magento\Catalog\Pricing\Price\FinalPrice; -use Magento\Catalog\Pricing\Price\RegularPrice; /** * Tests Magento\Downloadable\Block\Catalog\Product\Links @@ -38,6 +37,11 @@ class LinksTest extends \PHPUnit_Framework_TestCase */ protected $coreHelper; + /** + * @var \Magento\Framework\Json\EncoderInterface | \PHPUnit_Framework_MockObject_MockObject + */ + protected $jsonEncoder; + public function setUp() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -52,12 +56,14 @@ public function setUp() ->method('getPriceInfo') ->will($this->returnValue($this->priceInfoMock)); $this->coreHelper = $this->getMock('Magento\Core\Helper\Data', [], [], '', false); + $this->jsonEncoder = $this->getMock('Magento\Framework\Json\EncoderInterface', [], [], '', false); $this->linksBlock = $objectManager->getObject( 'Magento\Downloadable\Block\Catalog\Product\Links', [ 'context' => $contextMock, 'coreData' => $this->coreHelper, + 'encoder' => $this->jsonEncoder, 'data' => [ 'product' => $this->productMock, ] @@ -104,42 +110,21 @@ public function testGetLinkPrice() public function testGetJsonConfig() { - $regularPrice = 11.; - $finalPrice = 10.; - $price = 10.; - $oldPrice = 11.; - $linkPrice = 3.; - $linkIncludeTaxPrice = 4.; - $linkExcludeTaxPrice = 3.; - $linkId = 42; $config = [ - 'price' => $price, - 'oldPrice' => $oldPrice, 'links' => [ $linkId => [ - 'price' => $linkPrice, - 'oldPrice' => $linkPrice, - 'inclTaxPrice' => $linkIncludeTaxPrice, - 'exclTaxPrice' => $linkExcludeTaxPrice, + 'finalPrice' => $linkPrice, ], ], ]; - $linkAmountMock = $this->getMock('Magento\Framework\Pricing\Amount\Base', [], [], '', false); + $linkAmountMock = $this->getMock('Magento\Framework\Pricing\Amount\AmountInterface', [], [], '', false); $linkAmountMock->expects($this->once()) ->method('getValue') - ->will($this->returnValue($linkIncludeTaxPrice)); - $linkAmountMock->expects($this->once()) - ->method('getBaseAmount') - ->will($this->returnValue($linkExcludeTaxPrice)); - - $amountMock = $this->getMock('Magento\Framework\Pricing\Amount\Base', [], [], '', false); - $amountMock->expects($this->once()) - ->method('getValue') - ->will($this->returnValue($finalPrice)); + ->will($this->returnValue($linkPrice)); $typeInstanceMock = $this->getMock('Magento\Catalog\Model\Product\Type\Simple', ['getLinks'], [], '', false); $typeInstanceMock->expects($this->once()) @@ -149,38 +134,23 @@ public function testGetJsonConfig() ->method('getTypeInstance') ->will($this->returnValue($typeInstanceMock)); - $regularPriceMock = $this->getMock('Magento\Catalog\Pricing\Price\RegularPrice', [], [], '', false); - $regularPriceMock->expects($this->once()) - ->method('getValue') - ->will($this->returnValue($regularPrice)); - $finalPriceMock = $this->getMock('Magento\Catalog\Pricing\Price\FinalPrice', [], [], '', false); - $finalPriceMock->expects($this->at(0)) - ->method('getAmount') - ->will($this->returnValue($amountMock)); - $finalPriceMock->expects($this->at(1)) + $finalPriceMock->expects($this->once()) ->method('getCustomAmount') ->with($linkPrice) ->will($this->returnValue($linkAmountMock)); - $this->coreHelper->expects($this->at(0)) - ->method('currency') - ->with($linkPrice, false, false) - ->will($this->returnValue($linkPrice)); - - $this->priceInfoMock->expects($this->at(0)) - ->method('getPrice') - ->with(FinalPrice::PRICE_CODE) - ->will($this->returnValue($finalPriceMock)); - $this->priceInfoMock->expects($this->at(1)) - ->method('getPrice') - ->with(RegularPrice::PRICE_CODE) - ->will($this->returnValue($regularPriceMock)); - $this->priceInfoMock->expects($this->at(2)) + $this->priceInfoMock->expects($this->once()) ->method('getPrice') ->with(FinalPrice::PRICE_CODE) ->will($this->returnValue($finalPriceMock)); + $json = json_encode($config); + $this->jsonEncoder->expects($this->once()) + ->method('encode') + ->with($config) + ->will($this->returnValue($json)); + $encodedJsonConfig = $this->linksBlock->getJsonConfig(); $this->assertEquals(json_encode($config), $encodedJsonConfig); } diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php index 98d5618440529..03959f7ef8fae 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/AttributeManagementTest.php @@ -125,6 +125,40 @@ public function testAssignInputException() $this->model->assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder); } + /** + * + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Attribute group does not belong to attribute set + */ + public function testAssignInputExceptionGroupInSet() + { + $entityTypeCode = 1; + $attributeSetId = 2; + $attributeGroupId = 3; + $attributeCode = 4; + $sortOrder = 5; + $attributeSetMock = $this->getMock('Magento\Eav\Api\Data\AttributeSetInterface', [], [], '', false); + $this->setRepositoryMock->expects($this->once()) + ->method('get') + ->with($attributeSetId) + ->willReturn($attributeSetMock); + $this->entityTypeFactoryMock->expects($this->once())->method('create')->willReturn($this->eavConfigMock); + $attributeSetMock->expects($this->once())->method('getEntityTypeId')->willReturn(66); + $entityTypeMock = $this->getMock('Magento\Eav\Model\Entity\Type', [], [], '', false); + $this->eavConfigMock->expects($this->once())->method('getEntityType')->with(66)->willReturn($entityTypeMock); + $entityTypeMock->expects($this->once())->method('getEntityTypeCode')->willReturn($entityTypeCode); + + $attributeGroup = $this->getMockBuilder('Magento\Eav\Api\Data\AttributeGroupInterface') + ->setMethods(['getAttributeSetId']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->groupRepositoryMock->expects($this->once())->method('get')->willReturn($attributeGroup); + $attributeGroup->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId + 1); + + $this->model->assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder); + } + public function testAssign() { $entityTypeCode = 1; @@ -142,7 +176,6 @@ public function testAssign() $entityTypeMock = $this->getMock('Magento\Eav\Model\Entity\Type', [], [], '', false); $this->eavConfigMock->expects($this->once())->method('getEntityType')->with(66)->willReturn($entityTypeMock); $entityTypeMock->expects($this->once())->method('getEntityTypeCode')->willReturn($entityTypeCode); - $this->groupRepositoryMock->expects($this->once())->method('get')->with($attributeGroupId); $attributeMock = $this->getMock('Magento\Eav\Model\Attribute', [], [], '', false); $this->attributeRepositoryMock->expects($this->once()) ->method('get') @@ -162,6 +195,14 @@ public function testAssign() $attributeMock->expects($this->once())->method('loadEntityAttributeIdBySet')->willReturnSelf(); $attributeMock->expects($this->once())->method('getData')->with('entity_attribute_id')->willReturnSelf(); + $attributeGroup = $this->getMockBuilder('Magento\Eav\Api\Data\AttributeGroupInterface') + ->setMethods(['getAttributeSetId']) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->groupRepositoryMock->expects($this->once())->method('get')->willReturn($attributeGroup); + $attributeGroup->expects($this->once())->method('getAttributeSetId')->willReturn($attributeSetId); + $this->assertEquals( $attributeMock, $this->model->assign($entityTypeCode, $attributeSetId, $attributeGroupId, $attributeCode, $sortOrder) diff --git a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php index 1ed68fb871b59..c770c8f10b3a7 100644 --- a/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php +++ b/dev/tests/unit/testsuite/Magento/Fedex/Model/CarrierTest.php @@ -33,7 +33,7 @@ public function setUp() $scopeConfig->expects($this->any())->method('getValue')->will($this->returnValue('ServiceType')); $country = $this->getMock( 'Magento\Directory\Model\Country', - ['load', 'getIso2Code', '__wakeup'], + ['load', 'getData', '__wakeup'], [], '', false diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerAppTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerAppTest.php index 532c41e6d64a3..8ab5f43b9a294 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerAppTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerAppTest.php @@ -8,173 +8,214 @@ class ManagerAppTest extends \PHPUnit_Framework_TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Cache\Manager|\PHPUnit_Framework_MockObject_MockObject */ - private $cacheTypeList; + private $cacheManager; /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $cacheState; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\App\Console\Response|\PHPUnit_Framework_MockObject_MockObject */ private $response; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $frontendPool; - protected function setUp() { - $this->cacheTypeList = $this->getMockForAbstractClass('Magento\Framework\App\Cache\TypeListInterface'); - $this->cacheState = $this->getMockForAbstractClass('Magento\Framework\App\Cache\StateInterface'); + $this->cacheManager = $this->getMock('Magento\Framework\App\Cache\Manager', [], [], '', false); + $this->cacheManager->expects($this->any()) + ->method('getAvailableTypes') + ->will($this->returnValue(['foo', 'bar', 'baz'])); + $this->cacheManager->expects($this->any()) + ->method('getStatus') + ->will($this->returnValue(['foo' => true, 'bar' => true, 'baz' => false])); $this->response = $this->getMock('Magento\Framework\App\Console\Response', [], [], '', false); - $this->frontendPool = $this->getMock('Magento\Framework\App\Cache\Type\FrontendPool', [], [], '', false); } - public function testEmptyRequest() + public function testLaunchStatus() { - $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn(['foo' => '', 'bar' => '']); - $this->cacheState->expects($this->never())->method('setEnabled'); - $this->cacheState->expects($this->never())->method('persist'); - $this->frontendPool->expects($this->never())->method('get'); - $model = $this->createModel([]); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Current status:%afoo: 1%abar: 1%abaz: 0") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, []); $model->launch(); } - /** - * Test setting all cache types to true - * - * In this fixture, there are 2 of 3 cache types disabled, but will be enabled - * so persist() should be invoked once, then clean() for each of those which changed - */ - public function testSetAllTrue() + public function testLaunchEnable() { - $this->prepareCachesFixture(); - $this->cacheState->expects($this->exactly(2)) + $requestArgs = [ + ManagerApp::KEY_SET => true, + ManagerApp::KEY_TYPES => 'foo,,bar, baz,', + ]; + $this->cacheManager->expects($this->once()) ->method('setEnabled') - ->will($this->returnValueMap([['bar', true], ['baz', true]])); - $this->cacheState->expects($this->once())->method('persist'); - // pretend that all cache types use the same frontend - $frontend = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); - $this->frontendPool->expects($this->exactly(2))->method('get')->will($this->returnValueMap([ - ['bar', $frontend], - ['baz', $frontend], - ])); - $frontend->expects($this->exactly(2))->method('clean'); - $model = $this->createModel([ManagerApp::KEY_SET => '1']); - $this->assertSame($this->response, $model->launch()); + ->with(['foo', 'bar', 'baz'], true) + ->will($this->returnValue(['baz'])); + $this->cacheManager->expects($this->once()) + ->method('clean') + ->with(['baz']); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Changed cache status:%abaz: 0 -> 1%aCleaned cache types: baz%a") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, $requestArgs); + $model->launch(); } - /** - * Test setting all cache types to true - * - * Fixture is the same as in previous test, but here the intent to disable all of them. - * Since only one of them is enabled, the setter should be invoked only once. - * Also the operation of deactivating cache does not need cleanup (it is relevant when you enable it). - */ - public function testSetAllFalse() + public function testLaunchDisable() { - $this->prepareCachesFixture(); - $this->cacheState->expects($this->once())->method('setEnabled')->with('foo', false); - $this->cacheState->expects($this->once())->method('persist'); - $this->frontendPool->expects($this->never())->method('get'); - $model = $this->createModel([ManagerApp::KEY_SET => '0']); + $requestArgs = [ + ManagerApp::KEY_SET => false, + ManagerApp::KEY_TYPES => 'foo,,bar, baz,', + ]; + $this->cacheManager->expects($this->once()) + ->method('setEnabled') + ->with(['foo', 'bar', 'baz'], false) + ->will($this->returnValue(['baz'])); + $this->cacheManager->expects($this->never()) + ->method('clean'); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Changed cache status:%abaz: 1 -> 0%a%a") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, $requestArgs); $model->launch(); } - /** - * Test setting certain cache types to true - * - * In the fixture, one of them is currently true and another false - * So only one of them will be changed (and cleaned up) - */ - public function testSetTwoTrue() + public function testLaunchFlush() { - $this->prepareCachesFixture(2, [['foo', true], ['baz', false]]); - $this->cacheState->expects($this->once())->method('setEnabled')->with('baz', true); - $this->cacheState->expects($this->once())->method('persist'); - $frontend = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); - $this->frontendPool->expects($this->once())->method('get')->with('baz')->willReturn($frontend); - $frontend->expects($this->once())->method('clean'); - $model = $this->createModel([ManagerApp::KEY_SET => '1', ManagerApp::KEY_TYPES => 'foo,baz']); + $requestArgs = [ + ManagerApp::KEY_FLUSH => true, + ManagerApp::KEY_TYPES => 'foo,bar', + ]; + $this->cacheManager->expects($this->never()) + ->method('setEnabled'); + $this->cacheManager->expects($this->once()) + ->method('flush') + ->with(['foo', 'bar']); + $this->cacheManager->expects($this->never()) + ->method('clean'); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Flushed cache types: foo, bar%a") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, $requestArgs); $model->launch(); } - /** - * A fixture for testing setting enabled/disabled - * - * @param int $qty - * @param array $map - * @return void - */ - private function prepareCachesFixture($qty = 3, $map = [['foo', true], ['bar', false], ['baz', false]]) + public function testLaunchClean() { - $typeList = ['foo' => '', 'bar' => '', 'baz' => '']; - $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn($typeList); - $this->cacheState->expects($this->exactly($qty))->method('isEnabled')->will($this->returnValueMap($map)); + $requestArgs = [ + ManagerApp::KEY_CLEAN => true, + ManagerApp::KEY_TYPES => 'foo,bar', + ]; + $this->cacheManager->expects($this->never()) + ->method('setEnabled'); + $this->cacheManager->expects($this->never()) + ->method('flush'); + $this->cacheManager->expects($this->once()) + ->method('clean') + ->with(['foo', 'bar']); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Cleaned cache types: foo, bar%a") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, $requestArgs); + $model->launch(); } - /** - * Test flushing all cache types - * - * Emulates situation when some cache frontends reuse the same backend - * Asserts that the flush is invoked is only once per affected storage - */ - public function testFlushAll() + public function testLaunchSetAndClean() { - $typeList = ['foo' => '', 'bar' => '', 'baz' => '']; - $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn($typeList); - $frontendFoo = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); - $frontendBar = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); - $frontendBaz = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); - $this->frontendPool->expects($this->exactly(3))->method('get')->will($this->returnValueMap([ - ['foo', $frontendFoo], - ['bar', $frontendBar], - ['baz', $frontendBaz], - ])); - $backendOne = $this->getMockForAbstractClass('Zend_Cache_Backend_Interface'); - $backendTwo = $this->getMockForAbstractClass('Zend_Cache_Backend_Interface'); - $frontendFoo->expects($this->once())->method('getBackend')->willReturn($backendOne); - $frontendBar->expects($this->once())->method('getBackend')->willReturn($backendOne); - $frontendBaz->expects($this->once())->method('getBackend')->willReturn($backendTwo); - $backendOne->expects($this->once())->method('clean'); - $backendTwo->expects($this->once())->method('clean'); - $model = $this->createModel([ManagerApp::KEY_FLUSH => '']); + $requestArgs = [ + ManagerApp::KEY_SET => true, + ManagerApp::KEY_CLEAN => true, + ManagerApp::KEY_TYPES => 'foo,bar', + ]; + $this->cacheManager->expects($this->once()) + ->method('setEnabled') + ->with(['foo', 'bar'], true) + ->will($this->returnValue(['foo'])); + $this->cacheManager->expects($this->never()) + ->method('flush'); + $this->cacheManager->expects($this->once()) + ->method('clean') + ->with(['foo', 'bar']); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Changed cache status:%afoo: 0 -> 1%aCleaned cache types: foo, bar%a") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, $requestArgs); $model->launch(); } - public function testGetStatusSummary() + public function testLaunchAll() { - $types = [ - ['id' => 'foo', 'status' => true], - ['id' => 'bar', 'status' => false], + $requestArgs = [ + ManagerApp::KEY_SET => true, + ManagerApp::KEY_FLUSH => true, + ManagerApp::KEY_CLEAN => true, + ManagerApp::KEY_TYPES => 'foo,baz', ]; - $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn($types); - $model = $this->createModel([]); - $this->assertSame(['foo' => true, 'bar' => false], $model->getStatusSummary()); + $this->cacheManager->expects($this->once()) + ->method('setEnabled') + ->with(['foo', 'baz'], true) + ->will($this->returnValue(['baz'])); + $this->cacheManager->expects($this->once()) + ->method('flush') + ->with(['foo', 'baz']); + $this->cacheManager->expects($this->never()) + ->method('clean'); + $this->response->expects($this->once()) + ->method('setBody') + ->with( + $this->matches("Changed cache status:%abaz: 0 -> 1%aFlushed cache types: foo, baz%a") + ); + + $model = new ManagerApp($this->cacheManager, $this->response, $requestArgs); + $model->launch(); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The following requested cache types are not supported: 'unsupported', 'wrong' + */ + public function testLaunchWithUnsupportedCacheTypes() + { + $requestArgs = [ + ManagerApp::KEY_SET => true, + ManagerApp::KEY_TYPES => 'foo,unsupported,wrong,bar', + ]; + $cacheManager = $this->getMock('Magento\Framework\App\Cache\Manager', [], [], '', false); + $cacheManager->expects($this->any()) + ->method('getAvailableTypes') + ->will($this->returnValue(['foo', 'bar', 'baz'])); + $cacheManager->expects($this->never()) + ->method('setEnabled'); + + $model = new ManagerApp($cacheManager, $this->response, $requestArgs); + $model->launch(); } public function testCatchException() { - $model = $this->createModel([]); + $exceptionMessage = 'Exception message'; + $model = new ManagerApp($this->cacheManager, $this->response, []); + $this->response->expects($this->once()) + ->method('setBody') + ->with($exceptionMessage); $this->assertFalse($model->catchException( $this->getMock('Magento\Framework\App\Bootstrap', [], [], '', false), - new \Exception() + new \Exception($exceptionMessage) )); } - - /** - * Creates the model with mocked dependencies - * - * @param array $request - * @return ManagerApp - */ - private function createModel($request) - { - return new ManagerApp($this->cacheTypeList, $this->cacheState, $this->response, $this->frontendPool, $request); - } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerTest.php new file mode 100644 index 0000000000000..50c4849b40b15 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerTest.php @@ -0,0 +1,138 @@ +cacheTypeList = $this->getMockForAbstractClass('Magento\Framework\App\Cache\TypeListInterface'); + $this->cacheState = $this->getMockForAbstractClass('Magento\Framework\App\Cache\StateInterface'); + $this->response = $this->getMock('Magento\Framework\App\Console\Response', [], [], '', false); + $this->frontendPool = $this->getMock('Magento\Framework\App\Cache\Type\FrontendPool', [], [], '', false); + $this->model = new Manager($this->cacheTypeList, $this->cacheState, $this->frontendPool); + } + + public function testEmptyRequest() + { + $this->cacheState->expects($this->never())->method('setEnabled'); + $this->cacheState->expects($this->never())->method('persist'); + $this->frontendPool->expects($this->never())->method('get'); + $this->model->setEnabled([], true); + } + + /** + * Test setting all cache types to true + * + * In this fixture, there are 2 of 3 cache types disabled, but will be enabled + * so persist() should be invoked once, then clean() for each of those which changed + */ + public function testSetEnabledTrueAll() + { + $caches = ['foo', 'bar', 'baz']; + $cacheStatusMap = [['foo', true], ['bar', false], ['baz', false]]; + $this->cacheState->expects($this->exactly(3)) + ->method('isEnabled') + ->will($this->returnValueMap($cacheStatusMap)); + $this->cacheState->expects($this->exactly(2)) + ->method('setEnabled') + ->will($this->returnValueMap([['bar', true], ['baz', true]])); + $this->cacheState->expects($this->once())->method('persist'); + $this->assertEquals(['bar', 'baz'], $this->model->setEnabled($caches, true)); + } + + /** + * Test setting all cache types to true + * + * Fixture is the same as in previous test, but here the intent to disable all of them. + * Since only one of them is enabled, the setter should be invoked only once. + * Also the operation of deactivating cache does not need cleanup (it is relevant when you enable it). + */ + public function testSetEnabledFalseAll() + { + $caches = ['foo', 'bar', 'baz']; + $cacheStatusMap = [['foo', true], ['bar', false], ['baz', false]]; + $this->cacheState->expects($this->exactly(3)) + ->method('isEnabled') + ->will($this->returnValueMap($cacheStatusMap)); + $this->cacheState->expects($this->once())->method('setEnabled')->with('foo', false); + $this->cacheState->expects($this->once())->method('persist'); + $this->frontendPool->expects($this->never())->method('get'); + $this->assertEquals(['foo'], $this->model->setEnabled($caches, false)); + } + + /** + * Test flushing all cache types + * + * Emulates situation when some cache frontends reuse the same backend + * Asserts that the flush is invoked only once per affected storage + */ + public function testFlushAll() + { + $cacheTypes = ['foo', 'bar', 'baz']; + $frontendFoo = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); + $frontendBar = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); + $frontendBaz = $this->getMockForAbstractClass('Magento\Framework\Cache\FrontendInterface'); + $this->frontendPool->expects($this->exactly(3))->method('get')->will($this->returnValueMap([ + ['foo', $frontendFoo], + ['bar', $frontendBar], + ['baz', $frontendBaz], + ])); + $backendOne = $this->getMockForAbstractClass('Zend_Cache_Backend_Interface'); + $backendTwo = $this->getMockForAbstractClass('Zend_Cache_Backend_Interface'); + $frontendFoo->expects($this->once())->method('getBackend')->willReturn($backendOne); + $frontendBar->expects($this->once())->method('getBackend')->willReturn($backendOne); + $frontendBaz->expects($this->once())->method('getBackend')->willReturn($backendTwo); + $backendOne->expects($this->once())->method('clean'); + $backendTwo->expects($this->once())->method('clean'); + $this->model->flush($cacheTypes); + } + + public function testGetStatus() + { + $types = [ + ['id' => 'foo', 'status' => true], + ['id' => 'bar', 'status' => false], + ]; + $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn($types); + $this->assertSame(['foo' => true, 'bar' => false], $this->model->getStatus()); + } + + public function testGetAvailableTypes() + { + $types = [ + ['id' => 'foo', 'status' => true], + ['id' => 'bar', 'status' => false], + ]; + $this->cacheTypeList->expects($this->once())->method('getTypes')->willReturn($types); + $this->assertSame(['foo', 'bar'], $this->model->getAvailableTypes()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php index ce67464fbf019..66a6ad0337d4c 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/StateTest.php @@ -7,30 +7,37 @@ class StateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Framework\App\Cache\StateInterface + * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_model; + private $config; /** - * @var \Magento\Framework\App\Cache\State\Options|\PHPUnit_Framework_MockObject_MockObject + * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_resource; + private $writer; - /** - * @var \Magento\Framework\Cache\FrontendInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_cacheFrontend; + protected function setUp() + { + $this->config = $this->getMock('Magento\Framework\App\DeploymentConfig', [], [], '', false); + $this->writer = $this->getMock('Magento\Framework\App\DeploymentConfig\Writer', [], [], '', false); + } /** * @param string $cacheType - * @param array $typeOptions + * @param array $config * @param bool $banAll * @param bool $expectedIsEnabled * @dataProvider isEnabledDataProvider */ - public function testIsEnabled($cacheType, $typeOptions, $banAll, $expectedIsEnabled) + public function testIsEnabled($cacheType, $config, $banAll, $expectedIsEnabled) { - $model = $this->_buildModel($typeOptions, [], $banAll); + $model = new State($this->config, $this->writer, $banAll); + if ($banAll) { + $this->config->expects($this->never())->method('getSegment'); + } else { + $this->config->expects($this->once())->method('getSegment')->willReturn($config); + } + $this->writer->expects($this->never())->method('update'); $actualIsEnabled = $model->isEnabled($cacheType); $this->assertEquals($expectedIsEnabled, $actualIsEnabled); } @@ -43,116 +50,46 @@ public static function isEnabledDataProvider() return [ 'enabled' => [ 'cacheType' => 'cache_type', - 'typeOptions' => ['some_type' => false, 'cache_type' => true], + 'config' => ['some_type' => false, 'cache_type' => true], 'banAll' => false, 'expectedIsEnabled' => true, ], 'disabled' => [ 'cacheType' => 'cache_type', - 'typeOptions' => ['some_type' => true, 'cache_type' => false], + 'config' => ['some_type' => true, 'cache_type' => false], 'banAll' => false, 'expectedIsEnabled' => false, ], 'unknown is disabled' => [ 'cacheType' => 'unknown_cache_type', - 'typeOptions' => ['some_type' => true], + 'config' => ['some_type' => true], 'banAll' => false, 'expectedIsEnabled' => false, ], 'disabled, when all caches are banned' => [ 'cacheType' => 'cache_type', - 'typeOptions' => ['cache_type' => true], + 'config' => ['cache_type' => true], 'banAll' => true, 'expectedIsEnabled' => false, ] ]; } - /** - * Builds model to be tested - * - * @param array|false $cacheTypeOptions - * @param array|false $resourceTypeOptions - * @param bool $banAll - * @return \Magento\Framework\App\Cache\StateInterface - */ - protected function _buildModel( - $cacheTypeOptions, - $resourceTypeOptions = false, - $banAll = false - ) { - $this->_cacheFrontend = $this->getMock('Magento\Framework\Cache\FrontendInterface'); - $this->_cacheFrontend->expects( - $this->any() - )->method( - 'load' - )->with( - \Magento\Framework\App\Cache\State::CACHE_ID - )->will( - $this->returnValue($cacheTypeOptions === false ? false : serialize($cacheTypeOptions)) - ); - $cacheFrontendPool = $this->getMock('Magento\Framework\App\Cache\Frontend\Pool', [], [], '', false); - $cacheFrontendPool->expects( - $this->any() - )->method( - 'get' - )->with( - \Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID - )->will( - $this->returnValue($this->_cacheFrontend) - ); - - $this->_resource = $this->getMock('Magento\Framework\App\Cache\State\Options', [], [], '', false); - $this->_resource->expects( - $this->any() - )->method( - 'getAllOptions' - )->will( - $this->returnValue($resourceTypeOptions) - ); - - $this->_model = new \Magento\Framework\App\Cache\State( - $this->_resource, - $cacheFrontendPool, - $banAll - ); - - return $this->_model; - } - - /** - * The model must fetch data via its resource, if the cache type list is not cached - * (e.g. cache load result is FALSE) - */ - public function testIsEnabledFallbackToResource() + public function testSetEnabled() { - $model = $this->_buildModel([], ['cache_type' => true]); + $model = new State($this->config, $this->writer); $this->assertFalse($model->isEnabled('cache_type')); - - $model = $this->_buildModel(false, ['cache_type' => true]); - $this->assertTrue($model->isEnabled('cache_type')); - } - - public function testSetEnabledIsEnabled() - { - $model = $this->_buildModel(['cache_type' => false]); $model->setEnabled('cache_type', true); $this->assertTrue($model->isEnabled('cache_type')); - $model->setEnabled('cache_type', false); $this->assertFalse($model->isEnabled('cache_type')); } public function testPersist() { - $cacheTypes = ['cache_type' => false]; - $model = $this->_buildModel($cacheTypes); - - $this->_resource->expects($this->once())->method('saveAllOptions')->with($cacheTypes); - $this->_cacheFrontend->expects($this->once()) - ->method('remove') - ->with(\Magento\Framework\App\Cache\State::CACHE_ID); - + $model = new State($this->config, $this->writer); + $constraint = new \PHPUnit_Framework_Constraint_IsInstanceOf('Magento\Framework\App\Cache\Type\ConfigSegment'); + $this->writer->expects($this->once())->method('update')->with($constraint); $model->persist(); } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/ConfigSegmentTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/ConfigSegmentTest.php new file mode 100644 index 0000000000000..0faf133d77fc5 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Cache/Type/ConfigSegmentTest.php @@ -0,0 +1,60 @@ +assertSame($expected, $object->getData()); + } + + /** + * @return array + */ + public function getDataDataProvider() + { + return [ + [[], []], + [['FoO' => '1'], ['FoO' => 1]], + [['foo' => false, 'bar' => true], ['foo' => 0, 'bar' => 1]], + [['foo' => 'bar', 'baz' => '0'], ['foo' => 0, 'baz' => 0]], + [['foo' => []], ['foo' => 0]], + [['foo' => [0]], ['foo' => 1]], + [['foo' => [1, 2]], ['foo' => 1]], + ]; + } + + /** + * @param array $data + * @dataProvider getDataInvalidKeysDataProvider + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Invalid cache type key: + */ + public function testGetDataInvalidKeys($data) + { + new ConfigSegment($data); + } + + /** + * @return array + */ + public function getDataInvalidKeysDataProvider() + { + return [ + [[1]], + [['0' => 1]], + [['in/valid' => 1]], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php index 97299c8bb8329..45b9f871f52c8 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Console/ResponseTest.php @@ -15,11 +15,11 @@ class ResponseTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->model = new \Magento\Framework\App\Console\Response(); + $this->model->terminateOnSend(false); } public function testSendResponseDefaultBehaviour() { - $this->model->terminateOnSend(false); $this->assertEquals(0, $this->model->sendResponse()); } @@ -28,7 +28,6 @@ public function testSendResponseDefaultBehaviour() */ public function testSetCode($code, $expectedCode) { - $this->model->terminateOnSend(false); $this->model->setCode($code); $result = $this->model->sendResponse(); $this->assertEquals($expectedCode, $result); @@ -41,4 +40,18 @@ public static function setCodeProvider() $lowestCode = -255; return [[$largeCode, 255], [$lowCode, $lowCode], [$lowestCode, $lowestCode]]; } + + public function testSetBody() + { + $output = 'output'; + $this->expectOutputString($output); + $this->model->setBody($output); + $this->model->sendResponse(); + } + + public function testSetBodyNoOutput() + { + $this->expectOutputString(''); + $this->model->sendResponse(); + } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfigTest.php index a7f5af9c2e47a..0a10fb5ed9d08 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/DeploymentConfigTest.php @@ -92,6 +92,15 @@ public function testNotAvailable() $this->assertFalse($object->isAvailable()); } + public function testNotAvailableThenAvailable() + { + $this->reader->expects($this->at(0))->method('load')->willReturn([]); + $this->reader->expects($this->at(1))->method('load')->willReturn(['a' => 1]); + $object = new DeploymentConfig($this->reader); + $this->assertFalse($object->isAvailable()); + $this->assertTrue($object->isAvailable()); + } + /** * @param array $data * @expectedException \Exception diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php index 45a6f405e1bd1..34fab7b34c4aa 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/HttpTest.php @@ -5,6 +5,8 @@ namespace Magento\Framework\App; +use Magento\Framework\App\Filesystem\DirectoryList; + class HttpTest extends \PHPUnit_Framework_TestCase { /** @@ -52,6 +54,11 @@ class HttpTest extends \PHPUnit_Framework_TestCase */ protected $configLoaderMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $filesystemMock; + public function setUp() { $this->objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -68,10 +75,7 @@ public function setUp() ->setMethods(['load']) ->getMock(); $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $this->responseMock = $this->getMockBuilder('Magento\Framework\App\Response\Http') - ->disableOriginalConstructor() - ->setMethods(['setBody', '__wakeup', 'sendHeaders', 'sendResponse', 'setRedirect']) - ->getMock(); + $this->responseMock = $this->getMock('Magento\Framework\App\Response\Http', [], [], '', false); $this->frontControllerMock = $this->getMockBuilder('Magento\Framework\App\FrontControllerInterface') ->disableOriginalConstructor() ->setMethods(['dispatch']) @@ -80,6 +84,7 @@ public function setUp() ->disableOriginalConstructor() ->setMethods(['dispatch']) ->getMock(); + $this->filesystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false); $this->http = $this->objectManager->getObject( 'Magento\Framework\App\Http', @@ -90,7 +95,7 @@ public function setUp() 'request' => $this->requestMock, 'response' => $this->responseMock, 'configLoader' => $this->configLoaderMock, - 'filesystem' => $this->getMock('Magento\Framework\Filesystem', [], [], '', false), + 'filesystem' => $this->filesystemMock, ] ); } @@ -148,16 +153,62 @@ function () { $this->http->launch(); } - public function testNotInstalledException() + public function testHandleDeveloperModeNotInstalled() + { + $dir = $this->getMockForAbstractClass('Magento\Framework\Filesystem\Directory\ReadInterface'); + $dir->expects($this->once())->method('getAbsolutePath')->willReturn(__DIR__); + $this->filesystemMock->expects($this->once()) + ->method('getDirectoryRead') + ->with(DirectoryList::ROOT) + ->willReturn($dir); + $this->responseMock->expects($this->once())->method('setRedirect')->with('/_files/'); + $this->responseMock->expects($this->once())->method('sendHeaders'); + $bootstrap = $this->getBootstrapNotInstalled(); + $bootstrap->expects($this->once())->method('getParams')->willReturn([ + 'SCRIPT_NAME' => '/index.php', + 'DOCUMENT_ROOT' => __DIR__, + 'SCRIPT_FILENAME' => __DIR__ . '/index.php', + SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => '_files', + ]); + $this->assertTrue($this->http->catchException($bootstrap, new \Exception('Test Message'))); + } + + public function testHandleDeveloperMode() + { + $this->filesystemMock->expects($this->once()) + ->method('getDirectoryRead') + ->will($this->throwException(new \Exception('strange error'))); + $this->responseMock->expects($this->once())->method('setHttpResponseCode')->with(500); + $this->responseMock->expects($this->once())->method('setHeader')->with('Content-Type', 'text/plain'); + $constraint = new \PHPUnit_Framework_Constraint_StringStartsWith('strange error'); + $this->responseMock->expects($this->once())->method('setBody')->with($constraint); + $this->responseMock->expects($this->once())->method('sendResponse'); + $bootstrap = $this->getBootstrapNotInstalled(); + $bootstrap->expects($this->once())->method('getParams')->willReturn( + ['DOCUMENT_ROOT' => 'something', 'SCRIPT_FILENAME' => 'something/else'] + ); + $this->assertTrue($this->http->catchException($bootstrap, new \Exception('Test'))); + } + + public function testCatchExceptionSessionException() + { + $this->responseMock->expects($this->once())->method('setRedirect'); + $this->responseMock->expects($this->once())->method('sendHeaders'); + $bootstrap = $this->getMock('Magento\Framework\App\Bootstrap', [], [], '', false); + $bootstrap->expects($this->once())->method('isDeveloperMode')->willReturn(false); + $this->assertTrue($this->http->catchException($bootstrap, new \Magento\Framework\Session\Exception('Test'))); + } + + /** + * Prepares a mock of bootstrap in "not installed" state + * + * @return \PHPUnit_Framework_MockObject_MockObject + */ + private function getBootstrapNotInstalled() { - $expectedException = new \Exception('Test Message'); - $bootstrapMock = $this->getMock('Magento\Framework\App\Bootstrap', [], [], '', false); - $bootstrapMock->expects($this->once())->method('isDeveloperMode')->willReturn(true); - $bootstrapMock->expects($this->once())->method('getErrorCode')->willReturn(Bootstrap::ERR_IS_INSTALLED); - - $path = $this->http->getInstallerRedirectPath([]); - $this->responseMock->expects($this->once())->method('setRedirect')->with($path)->will($this->returnSelf()); - $this->responseMock->expects($this->once())->method('sendHeaders')->will($this->returnSelf()); - $this->assertTrue($this->http->catchException($bootstrapMock, $expectedException)); + $bootstrap = $this->getMock('Magento\Framework\App\Bootstrap', [], [], '', false); + $bootstrap->expects($this->once())->method('isDeveloperMode')->willReturn(true); + $bootstrap->expects($this->once())->method('getErrorCode')->willReturn(Bootstrap::ERR_IS_INSTALLED); + return $bootstrap; } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php index e6ed9c2353b6d..48140770efc35 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/App/Request/HttpTest.php @@ -31,14 +31,9 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected $cookieReaderMock; /** - * @var \Magento\TestFramework\Helper\ObjectManager + * @var \Magento\TestFramework\Helper\ObjectManager | \PHPUnit_Framework_MockObject_MockObject */ - protected $_objectManager; - - /** - * @var \Magento\Framework\App\Config\ReinitableConfigInterface | \PHPUnit_Framework_MockObject_MockObject - */ - protected $configMock; + protected $objectManager; /** * @var array @@ -47,7 +42,6 @@ class HttpTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_routerListMock = $this->getMock( 'Magento\Framework\App\Route\ConfigInterface\Proxy', @@ -59,7 +53,7 @@ protected function setUp() $this->_infoProcessorMock = $this->getMock('Magento\Framework\App\Request\PathInfoProcessorInterface'); $this->_infoProcessorMock->expects($this->any())->method('process')->will($this->returnArgument(1)); $this->cookieReaderMock = $this->getMock('Magento\Framework\Stdlib\Cookie\CookieReaderInterface'); - $this->configMock = $this->getMock('Magento\Framework\App\Config\ReinitableConfigInterface'); + $this->objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); // Stash the $_SERVER array to protect it from modification in test $this->serverArray = $_SERVER; @@ -80,15 +74,12 @@ public function testGetOriginalPathInfoWithTestUri() private function getModel($uri = null) { - return $this->_objectManager->getObject( - 'Magento\Framework\App\Request\Http', - [ - 'pathInfoProcessor' => $this->_infoProcessorMock, - 'routeConfig' => $this->_routerListMock, - 'cookieReader' => $this->cookieReaderMock, - 'uri' => $uri, - 'config' => $this->configMock - ] + return new \Magento\Framework\App\Request\Http( + $this->_routerListMock, + $this->_infoProcessorMock, + $this->cookieReaderMock, + $this->objectManager, + $uri ); } @@ -426,6 +417,30 @@ public function testGetDistroBaseUrl($serverVariables, $expectedResult) $_SERVER = $originalServerValue; } + /** + * @param string $scriptName + * @param string $expected + * @dataProvider getDistroBaseUrlPathDataProvider + */ + public function testGetDistroBaseUrlPath($scriptName, $expected) + { + $this->assertEquals($expected, Http::getDistroBaseUrlPath(['SCRIPT_NAME' => $scriptName])); + } + + public function getDistroBaseUrlPathDataProvider() + { + return [ + [null, '/'], + ['./index.php', '/'], + ['.\\index.php', '/'], + ['/index.php', '/'], + ['\\index.php', '/'], + ['subdir/script.php', 'subdir/'], + ['subdir\\script.php', 'subdir/'], + ['sub\\dir\\script.php', 'sub/dir/'], + ]; + } + public function testGetCookieDefault() { $key = "cookieName"; @@ -530,10 +545,19 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header { $this->_model = $this->getModel(); $configOffloadHeader = 'Header-From-Proxy'; - $this->configMock->expects($this->exactly($configCall)) + $configMock = $this->getMockBuilder('Magento\Framework\App\Config') + ->disableOriginalConstructor() + ->setMethods(['getValue']) + ->getMock(); + $configMock->expects($this->exactly($configCall)) ->method('getValue') ->with(Request::XML_PATH_OFFLOADER_HEADER, ScopeInterface::SCOPE_DEFAULT) ->willReturn($configOffloadHeader); + $this->objectManager->expects($this->exactly($configCall)) + ->method('get') + ->with('Magento\Framework\App\Config') + ->will($this->returnValue($configMock)); + $_SERVER[$headerOffloadKey] = $headerOffloadValue; $_SERVER['HTTPS'] = $serverHttps; diff --git a/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php b/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php new file mode 100644 index 0000000000000..19c76c1271360 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php @@ -0,0 +1,185 @@ + '/doc/root', 'SCRIPT_FILENAME' => '/doc/root/dir/file.php']; + + /** + * @param array $server + * @param string $expectedError + * @dataProvider constructorExceptionsDataProvider + */ + public function testConstructorExceptions($server, $expectedError) + { + $this->setExpectedException('\InvalidArgumentException', $expectedError); + new SetupInfo($server); + } + + public function constructorExceptionsDataProvider() + { + $docRootErr = 'DOCUMENT_ROOT variable is unavailable.'; + $projectRootErr = 'Project root cannot be automatically detected.'; + return [ + [[], $docRootErr], + [['DOCUMENT_ROOT' => ''], $docRootErr], + [['DOCUMENT_ROOT' => '/foo'], $projectRootErr], + [['DOCUMENT_ROOT' => '/foo', 'SCRIPT_FILENAME' => ''], $projectRootErr], + ]; + } + + /** + * @param array $server + * @param string $expected + * @dataProvider getUrlDataProvider + */ + public function testGetUrl($server, $expected) + { + $info = new SetupInfo($server); + $this->assertEquals($expected, $info->getUrl()); + } + + /** + * @return array + */ + public function getUrlDataProvider() + { + return [ + [ + self::$fixture, + '/setup/' + ], + [ + self::$fixture + [SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => 'install'], + '/install/', + ], + [ + self::$fixture + [SetupInfo::PARAM_NOT_INSTALLED_URL => 'http://example.com/'], + 'http://example.com/', + ], + ]; + } + + /** + * @param array $server + * @param string $expected + * @dataProvider getProjectUrlDataProvider + */ + public function testGetProjectUrl($server, $expected) + { + $info = new SetupInfo($server); + $this->assertEquals($expected, $info->getProjectUrl()); + } + + /** + * @return array + */ + public function getProjectUrlDataProvider() + { + return [ + [self::$fixture, ''], + [self::$fixture + ['HTTP_HOST' => ''], ''], + [['DOCUMENT_ROOT' => '/foo/bar', 'SCRIPT_FILENAME' => '/other/baz.php', 'HTTP_HOST' => 'example.com'], ''], + [self::$fixture + ['HTTP_HOST' => 'example.com'], 'http://example.com/dir/'], + [ + ['DOCUMENT_ROOT' => '/foo/bar', 'SCRIPT_FILENAME' => '/foo/bar/baz.php', 'HTTP_HOST' => 'example.com'], + 'http://example.com/' + ], + ]; + } + + /** + * @param array $server + * @param string $projectRoot + * @param string $expected + * @dataProvider getDirDataProvider + */ + public function testGetDir($server, $projectRoot, $expected) + { + $info = new SetupInfo($server); + $this->assertEquals($expected, $info->getDir($projectRoot)); + } + + /** + * @return array + */ + public function getDirDataProvider() + { + return [ + [ + self::$fixture, + '/test/root', + '/test/root/setup', + ], + [ + self::$fixture, + '/test/root/', + '/test/root/setup', + ], + [ + self::$fixture + [SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => '/install/'], + '/test/', + '/test/install', + ], + ]; + } + + /** + * @param array $server + * @param bool $expected + * @dataProvider isAvailableDataProvider + */ + public function testIsAvailable($server, $expected) + { + $info = new SetupInfo($server); + $this->assertEquals($expected, $info->isAvailable()); + } + + /** + * @return array + */ + public function isAvailableDataProvider() + { + $server = ['DOCUMENT_ROOT' => __DIR__, 'SCRIPT_FILENAME' => __FILE__]; + return [ + 'root = doc root, but no "setup" sub-directory' => [ + $server, // it will look for "setup/" sub-directory, but won't find anything + false + ], + 'root = doc root, nonexistent sub-directory' => [ + $server + [SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => 'nonexistent'], + false + ], + 'root = doc root, existent sub-directory' => [ + $server + [SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => '_files'], + true + ], + 'root within doc root, existent sub-directory' => [ + [ + 'DOCUMENT_ROOT' => dirname(__DIR__), + 'SCRIPT_FILENAME' => __FILE__, + SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => '_files' + ], + true + ], + 'root outside of doc root, existent sub-directory' => [ + [ + 'DOCUMENT_ROOT' => __DIR__, + 'SCRIPT_FILENAME' => dirname(dirname(__DIR__)) . '/foo.php', + SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => basename(__DIR__) + ], + false + ], + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Encryption/EncryptorTest.php b/dev/tests/unit/testsuite/Magento/Framework/Encryption/EncryptorTest.php index 60acd63ae1ecc..7c527ccea7115 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Encryption/EncryptorTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Encryption/EncryptorTest.php @@ -18,27 +18,21 @@ class EncryptorTest extends \PHPUnit_Framework_TestCase */ protected $_randomGenerator; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_cryptFactory; - protected function setUp() { $this->_randomGenerator = $this->getMock('Magento\Framework\Math\Random', [], [], '', false); - $this->_cryptFactory = $this->getMock('Magento\Framework\Encryption\CryptFactory', [], [], '', false); $deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); $deploymentConfigMock->expects($this->any()) ->method('get') ->with(Encryptor::PARAM_CRYPT_KEY) ->will($this->returnValue('cryptKey')); - $this->_model = new Encryptor($this->_randomGenerator, $this->_cryptFactory, $deploymentConfigMock); + $this->_model = new \Magento\Framework\Encryption\Encryptor($this->_randomGenerator, $deploymentConfigMock); } public function testGetHashNoSalt() { $this->_randomGenerator->expects($this->never())->method('getRandomString'); - $expected = '5f4dcc3b5aa765d61d8327deb882cf99'; + $expected = '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8'; $actual = $this->_model->getHash('password'); $this->assertEquals($expected, $actual); } @@ -46,39 +40,31 @@ public function testGetHashNoSalt() public function testGetHashSpecifiedSalt() { $this->_randomGenerator->expects($this->never())->method('getRandomString'); - $expected = '67a1e09bb1f83f5007dc119c14d663aa:salt'; + $expected = '13601bda4ea78e55a07b98866d2be6be0744e3866f13c00c811cab608a28f322:salt'; $actual = $this->_model->getHash('password', 'salt'); $this->assertEquals($expected, $actual); } public function testGetHashRandomSaltDefaultLength() { - $this->_randomGenerator->expects( - $this->once() - )->method( - 'getRandomString' - )->with( - 32 - )->will( - $this->returnValue('-----------random_salt----------') - ); - $expected = '7a22dd7ba57a7653cc0f6e58e9ba1aac:-----------random_salt----------'; + $this->_randomGenerator + ->expects($this->once()) + ->method('getRandomString') + ->with(32) + ->will($this->returnValue('-----------random_salt----------')); + $expected = 'a1c7fc88037b70c9be84d3ad12522c7888f647915db78f42eb572008422ba2fa:-----------random_salt----------'; $actual = $this->_model->getHash('password', true); $this->assertEquals($expected, $actual); } public function testGetHashRandomSaltSpecifiedLength() { - $this->_randomGenerator->expects( - $this->once() - )->method( - 'getRandomString' - )->with( - 11 - )->will( - $this->returnValue('random_salt') - ); - $expected = 'e6730b5a977c225a86cd76025a86a6fc:random_salt'; + $this->_randomGenerator + ->expects($this->once()) + ->method('getRandomString') + ->with(11) + ->will($this->returnValue('random_salt')); + $expected = '4c5cab8dd00137d11258f8f87b93fd17bd94c5026fc52d3c5af911dd177a2611:random_salt'; $actual = $this->_model->getHash('password', 11); $this->assertEquals($expected, $actual); } @@ -101,29 +87,11 @@ public function validateHashDataProvider() return [ ['password', 'hash', false], ['password', 'hash:salt', false], - ['password', '5f4dcc3b5aa765d61d8327deb882cf99', true], - ['password', '67a1e09bb1f83f5007dc119c14d663aa:salt', true] + ['password', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', true], + ['password', '67a1e09bb1f83f5007dc119c14d663aa:salt', true], ]; } - /** - * @param string $password - * @param string $hash - * - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Invalid hash. - * @dataProvider validateHashExceptionDataProvider - */ - public function testValidateHashException($password, $hash) - { - $this->_model->validateHash($password, $hash); - } - - public function validateHashExceptionDataProvider() - { - return [['password', 'hash1:hash2:hash3'], ['password', 'hash1:hash2:hash3:hash4']]; - } - /** * @param mixed $key * @@ -136,7 +104,7 @@ public function testEncryptWithEmptyKey($key) ->method('get') ->with(Encryptor::PARAM_CRYPT_KEY) ->will($this->returnValue($key)); - $model = new Encryptor($this->_randomGenerator, $this->_cryptFactory, $deploymentConfigMock); + $model = new Encryptor($this->_randomGenerator, $deploymentConfigMock); $value = 'arbitrary_string'; $this->assertEquals($value, $model->encrypt($value)); } @@ -147,74 +115,93 @@ public function encryptWithEmptyKeyDataProvider() } /** - * @param string $value - * @param string $expected + * @param mixed $key * - * @dataProvider encryptDataProvider + * @dataProvider decryptWithEmptyKeyDataProvider */ - public function testEncrypt($value, $expected) + public function testDecryptWithEmptyKey($key) { - $crypt = $this->getMock('Magento\Framework\Encryption\Crypt', [], [], '', false); - $this->_cryptFactory->expects($this->once())->method('create')->will($this->returnValue($crypt)); - $crypt->expects($this->once())->method('encrypt')->with($value)->will($this->returnArgument(0)); - $actual = $this->_model->encrypt($value); - $this->assertEquals($expected, $actual); + $deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); + $deploymentConfigMock->expects($this->any()) + ->method('get') + ->with(Encryptor::PARAM_CRYPT_KEY) + ->will($this->returnValue($key)); + $model = new Encryptor($this->_randomGenerator, $deploymentConfigMock); + $value = 'arbitrary_string'; + $this->assertEquals('', $model->decrypt($value)); } - public function encryptDataProvider() + public function decryptWithEmptyKeyDataProvider() { - return [['value1', 'dmFsdWUx'], [true, 'MQ==']]; + return [[null], [0], [''], ['0']]; } - /** - * @param string $value - * @param string $expected - * - * @dataProvider decryptDataProvider - */ - public function testDecrypt($value, $expected) + public function testEncrypt() { - $crypt = $this->getMock('Magento\Framework\Encryption\Crypt', [], [], '', false); - $this->_cryptFactory->expects($this->once())->method('create')->will($this->returnValue($crypt)); - $crypt->expects($this->once())->method('decrypt')->with($expected)->will($this->returnValue($expected)); - $actual = $this->_model->decrypt($value); - $this->assertEquals($expected, $actual); + // sample data to encrypt + $data = 'Mares eat oats and does eat oats, but little lambs eat ivy.'; + + $actual = $this->_model->encrypt($data); + + // Extract the initialization vector and encrypted data + $parts = explode(':', $actual, 4); + list(, , $iv, $encryptedData) = $parts; + + // Decrypt returned data with RIJNDAEL_256 cipher, cbc mode + $crypt = new Crypt('cryptKey', MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $iv); + // Verify decrypted matches original data + $this->assertEquals($data, $crypt->decrypt(base64_decode((string)$encryptedData))); } - public function decryptDataProvider() + public function testDecrypt() { - return [['dmFsdWUx', 'value1']]; + // sample data to encrypt + $data = '0:2:z3a4ACpkU35W6pV692U4ueCVQP0m0v0p:' . + '7ZPIIRZzQrgQH+csfF3fyxYNwbzPTwegncnoTxvI3OZyqKGYlOCTSx5i1KRqNemCC8kuCiOAttLpAymXhzjhNQ=='; + + $actual = $this->_model->decrypt($data); + + // Extract the initialization vector and encrypted data + $parts = explode(':', $data, 4); + list(, , $iv, $encrypted) = $parts; + + // Decrypt returned data with RIJNDAEL_256 cipher, cbc mode + $crypt = new Crypt('cryptKey', MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $iv); + // Verify decrypted matches original data + $this->assertEquals($encrypted, base64_encode($crypt->encrypt($actual))); } - public function testValidateKey() + public function testEncryptDecryptNewKeyAdded() { - $crypt = $this->getMock('Magento\Framework\Encryption\Crypt', [], [], '', false); - $this->_cryptFactory->expects( - $this->once() - )->method( - 'create' - )->with( - ['key' => 'some_key'] - )->will( - $this->returnValue($crypt) - ); - $this->assertSame($crypt, $this->_model->validateKey('some_key')); + $deploymentConfigMock = $this->getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); + $deploymentConfigMock->expects($this->at(0)) + ->method('get') + ->with(Encryptor::PARAM_CRYPT_KEY) + ->will($this->returnValue("cryptKey1")); + $deploymentConfigMock->expects($this->at(1)) + ->method('get') + ->with(Encryptor::PARAM_CRYPT_KEY) + ->will($this->returnValue("cryptKey1\ncryptKey2")); + $model1 = new Encryptor($this->_randomGenerator, $deploymentConfigMock); + // simulate an encryption key is being added + $model2 = new Encryptor($this->_randomGenerator, $deploymentConfigMock); + + // sample data to encrypt + $data = 'Mares eat oats and does eat oats, but little lambs eat ivy.'; + // encrypt with old key + $encryptedData = $model1->encrypt($data); + $decryptedData = $model2->decrypt($encryptedData); + + $this->assertSame($data, $decryptedData, 'Encryptor failed to decrypt data encrypted by old keys.'); } - public function testValidateKeyDefault() + public function testValidateKey() { - $crypt = $this->getMock('Magento\Framework\Encryption\Crypt', [], [], '', false); - $this->_cryptFactory->expects( - $this->once() - )->method( - 'create' - )->with( - ['key' => 'cryptKey'] - )->will( - $this->returnValue($crypt) - ); - $this->assertSame($crypt, $this->_model->validateKey(null)); - // Ensure crypt factory is invoked only once - $this->assertSame($crypt, $this->_model->validateKey(null)); + $actual = $this->_model->validateKey('some_key'); + $crypt = new Crypt('some_key', MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $actual->getInitVector()); + $expectedEncryptedData = base64_encode($crypt->encrypt('data')); + $actualEncryptedData = base64_encode($actual->encrypt('data')); + $this->assertEquals($expectedEncryptedData, $actualEncryptedData); + $this->assertEquals($crypt->decrypt($expectedEncryptedData), $actual->decrypt($actualEncryptedData)); } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php index 6262c9d80a940..a533dd2cf2f52 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Interception/Config/ConfigTest.php @@ -49,12 +49,8 @@ protected function setUp() ); $this->configScopeMock = $this->getMock('Magento\Framework\Config\ScopeListInterface'); $this->cacheMock = $this->getMock('Magento\Framework\Cache\FrontendInterface'); - $this->omConfigMock = $this->getMock( - 'Magento\Framework\Interception\ObjectManager\Config', - [], - [], - '', - false + $this->omConfigMock = $this->getMockForAbstractClass( + 'Magento\Framework\Interception\ObjectManager\ConfigInterface' ); $this->definitionMock = $this->getMock('Magento\Framework\ObjectManager\DefinitionInterface'); } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/Config/DeveloperTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/Config/DeveloperTest.php new file mode 100644 index 0000000000000..51cf610cc80ea --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/Config/DeveloperTest.php @@ -0,0 +1,53 @@ +interceptionConfig = $this->getMock('\Magento\Framework\Interception\ConfigInterface'); + $this->model = new Developer(); + } + + public function testGetInstanceTypeReturnsInterceptorClass() + { + $this->interceptionConfig->expects($this->once())->method('hasPlugins')->will($this->returnValue(true)); + $this->model->setInterceptionConfig($this->interceptionConfig); + + $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType('SomeClass')); + } + + public function testGetInstanceTypeReturnsSimpleClassIfNoPluginsAreDeclared() + { + $this->model->setInterceptionConfig($this->interceptionConfig); + + $this->assertEquals('SomeClass', $this->model->getInstanceType('SomeClass')); + } + + public function testGetInstanceTypeReturnsSimpleClassIfInterceptionConfigIsNotSet() + { + $this->assertEquals('SomeClass', $this->model->getInstanceType('SomeClass')); + } + + public function testGetOriginalInstanceTypeReturnsInterceptedClass() + { + $this->interceptionConfig->expects($this->once())->method('hasPlugins')->will($this->returnValue(true)); + $this->model->setInterceptionConfig($this->interceptionConfig); + + $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType('SomeClass')); + $this->assertEquals('SomeClass', $this->model->getOriginalInstanceType('SomeClass')); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/ConfigTest.php deleted file mode 100644 index 6b670c5a7f17a..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Framework/Interception/ObjectManager/ConfigTest.php +++ /dev/null @@ -1,97 +0,0 @@ -interceptionConfig = $this->getMock('\Magento\Framework\Interception\ConfigInterface'); - - $this->subjectConfigMock = $this->getMockBuilder('\Magento\Framework\ObjectManager\Config\Config') - ->disableOriginalConstructor() - ->setMethods(['getInstanceType']) - ->getMock(); - - $this->model = new Config($this->subjectConfigMock); - } - - public function testGetInstanceTypeReturnsInterceptorClass() - { - $instanceName = 'SomeClass'; - - $this->interceptionConfig->expects($this->once()) - ->method('hasPlugins') - ->willReturn(true); - - $this->subjectConfigMock->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->model->setInterceptionConfig($this->interceptionConfig); - - $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType($instanceName)); - } - - public function testGetInstanceTypeReturnsSimpleClassIfNoPluginsAreDeclared() - { - $instanceName = 'SomeClass'; - - $this->subjectConfigMock->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->model->setInterceptionConfig($this->interceptionConfig); - - $this->assertEquals('SomeClass', $this->model->getInstanceType($instanceName)); - } - - public function testGetInstanceTypeReturnsSimpleClassIfInterceptionConfigIsNotSet() - { - $instanceName = 'SomeClass'; - - $this->subjectConfigMock->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->assertEquals('SomeClass', $this->model->getInstanceType($instanceName)); - } - - public function testGetOriginalInstanceTypeReturnsInterceptedClass() - { - $this->interceptionConfig->expects($this->once()) - ->method('hasPlugins') - ->willReturn(true); - - $instanceName = 'SomeClass'; - - $this->subjectConfigMock->expects($this->exactly(2)) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn($instanceName); - - $this->model->setInterceptionConfig($this->interceptionConfig); - - $this->assertEquals('SomeClass\Interceptor', $this->model->getInstanceType($instanceName)); - $this->assertEquals('SomeClass', $this->model->getOriginalInstanceType($instanceName)); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php b/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php index 8b2d5a6695ad5..eb6478fba8c42 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Interception/PluginList/PluginListTest.php @@ -46,10 +46,7 @@ protected function setUp() ->method('get') ->will($this->returnValue(false)); - $omConfigMock = $this->getMockBuilder('Magento\Framework\Interception\ObjectManager\Config') - ->disableOriginalConstructor() - ->setMethods(['getOriginalInstanceType']) - ->getMock(); + $omConfigMock = $this->getMockForAbstractClass('Magento\Framework\Interception\ObjectManager\ConfigInterface'); $omConfigMock->expects($this->any())->method('getOriginalInstanceType')->will($this->returnArgument(0)); diff --git a/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php b/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php index 5b186550fea77..e8d9c772e049d 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Locale/ListsTest.php @@ -218,6 +218,11 @@ public function testGetOptionTimezones() foreach ($expectedResults as $value) { $this->assertContains($value, $timeZones); } + + $timeZoneList = \DateTimeZone::listIdentifiers(\DateTimeZone::ALL_WITH_BC); + foreach ($timeZones as $timeZone) { + $this->assertContains($timeZone['value'], $timeZoneList); + } } public function testGetOptionLocales() diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/DbVersionInfoTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/DbVersionInfoTest.php new file mode 100644 index 0000000000000..62f18125d8e12 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/DbVersionInfoTest.php @@ -0,0 +1,172 @@ +moduleList = $this->getMockForAbstractClass('Magento\Framework\Module\ModuleListInterface'); + $this->moduleList->expects($this->any()) + ->method('getOne') + ->will($this->returnValueMap([ + ['Module_One', ['name' => 'Module_One', 'schema_version' => '1']], + ['Module_Two', ['name' => 'Module_Two', 'schema_version' => '2']], + ['Module_No_Schema', []], + ])); + $this->moduleList->expects($this->any()) + ->method('getNames') + ->will($this->returnValue(['Module_One', 'Module_Two'])); + + $this->_outputConfig = $this->getMockForAbstractClass('Magento\Framework\Module\Output\ConfigInterface'); + $this->moduleResource = $this->getMockForAbstractClass('\Magento\Framework\Module\ResourceInterface'); + $this->resourceResolver = $this->getMockForAbstractClass('\Magento\Framework\Module\ResourceResolverInterface'); + + $this->dbVersionInfo = new DbVersionInfo( + $this->moduleList, + $this->moduleResource, + $this->resourceResolver + ); + } + + /** + * @param string $moduleName + * @param string|bool $dbVersion + * @param bool $expectedResult + * + * @dataProvider isDbUpToDateDataProvider + */ + public function testIsDbSchemaUpToDate($moduleName, $dbVersion, $expectedResult) + { + $resourceName = 'resource'; + $this->moduleResource->expects($this->once()) + ->method('getDbVersion') + ->with($resourceName) + ->will($this->returnValue($dbVersion)); + $this->assertEquals( + $expectedResult, + $this->dbVersionInfo->isSchemaUpToDate($moduleName, $resourceName) + ); + } + + /** + * @param string $moduleName + * @param string|bool $dbVersion + * @param bool $expectedResult + * + * @dataProvider isDbUpToDateDataProvider + */ + public function testIsDbDataUpToDate($moduleName, $dbVersion, $expectedResult) + { + $resourceName = 'resource'; + $this->moduleResource->expects($this->once()) + ->method('getDataVersion') + ->with($resourceName) + ->will($this->returnValue($dbVersion)); + $this->assertEquals( + $expectedResult, + $this->dbVersionInfo->isDataUpToDate($moduleName, $resourceName) + ); + } + + + /** + * @return array + */ + public function isDbUpToDateDataProvider() + { + return [ + 'version in config == version in db' => ['Module_One', '1', true], + 'version in config < version in db' => + [ + 'Module_One', + '2', + false + ], + 'version in config > version in db' => + [ + 'Module_Two', + '1', + false + ], + 'no version in db' => + [ + 'Module_One', + false, + false + ], + ]; + } + + public function testGetDbVersionErrors() + { + $this->moduleResource->expects($this->any()) + ->method('getDataVersion') + ->will($this->returnValue(2)); + $this->moduleResource->expects($this->any()) + ->method('getDbVersion') + ->will($this->returnValue(2)); + + $this->resourceResolver->expects($this->any())->method('getResourceList')->will($this->returnValueMap([ + ['Module_One', ['resource_one']], + ['Module_Two', ['resource_two']], + ])); + + $expectedErrors = [ + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_CURRENT => '2', + DbVersionInfo::KEY_REQUIRED => '1', + DbVersionInfo::KEY_TYPE => 'schema', + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_CURRENT => '2', + DbVersionInfo::KEY_REQUIRED => '1', + DbVersionInfo::KEY_TYPE => 'data', + ] + ]; + $this->assertEquals($expectedErrors, $this->dbVersionInfo->getDbVersionErrors()); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Schema version for module 'Module_No_Schema' is not specified + */ + public function testIsDbSchemaUpToDateException() + { + $this->dbVersionInfo->isSchemaUpToDate('Module_No_Schema', 'resource_name'); + } + + /** + * @expectedException \UnexpectedValueException + * @expectedExceptionMessage Schema version for module 'Module_No_Schema' is not specified + */ + public function testIsDbDataUpToDateException() + { + $this->dbVersionInfo->isDataUpToDate('Module_No_Schema', 'resource_name'); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php index 3446047bb03da..f19b4828ab7fb 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/ManagerTest.php @@ -4,6 +4,8 @@ */ namespace Magento\Framework\Module; +use Magento\Framework\Module\Plugin\DbStatusValidator; + class ManagerTest extends \PHPUnit_Framework_TestCase { /** @@ -26,11 +28,6 @@ class ManagerTest extends \PHPUnit_Framework_TestCase */ private $_outputConfig; - /** - * @var \Magento\Framework\Module\ResourceInterface|\PHPUnit_Framework_MockObject_MockObject - */ - private $moduleResource; - protected function setUp() { $this->_moduleList = $this->getMockForAbstractClass('Magento\Framework\Module\ModuleListInterface'); @@ -42,11 +39,9 @@ protected function setUp() ['Module_Three', ['name' => 'Two_Three']], ])); $this->_outputConfig = $this->getMockForAbstractClass('Magento\Framework\Module\Output\ConfigInterface'); - $this->moduleResource = $this->getMockForAbstractClass('\Magento\Framework\Module\ResourceInterface'); $this->_model = new \Magento\Framework\Module\Manager( $this->_outputConfig, $this->_moduleList, - $this->moduleResource, [ 'Module_Two' => self::XML_PATH_OUTPUT_ENABLED, ] @@ -111,69 +106,4 @@ public function isOutputEnabledCustomConfigPathDataProvider() 'path literal, output enabled' => [true, true], ]; } - - /** - * @param string $moduleName - * @param string|bool $dbVersion - * @param bool $expectedResult - * - * @dataProvider isDbUpToDateDataProvider - */ - public function testIsDbSchemaUpToDate($moduleName, $dbVersion, $expectedResult) - { - $resourceName = 'resource'; - $this->moduleResource->expects($this->once()) - ->method('getDbVersion') - ->with($resourceName) - ->will($this->returnValue($dbVersion)); - $this->assertSame($expectedResult, $this->_model->isDbSchemaUpToDate($moduleName, $resourceName)); - } - - /** - * @param string $moduleName - * @param string|bool $dbVersion - * @param bool $expectedResult - * - * @dataProvider isDbUpToDateDataProvider - */ - public function testIsDbDataUpToDate($moduleName, $dbVersion, $expectedResult) - { - $resourceName = 'resource'; - $this->moduleResource->expects($this->once()) - ->method('getDataVersion') - ->with($resourceName) - ->will($this->returnValue($dbVersion)); - $this->assertSame($expectedResult, $this->_model->isDbDataUpToDate($moduleName, $resourceName)); - } - - /** - * @return array - */ - public function isDbUpToDateDataProvider() - { - return [ - 'version in config == version in db' => ['Module_One', '1', true], - 'version in config < version in db' => ['Module_One', '2', false], - 'version in config > version in db' => ['Module_Two', '1', false], - 'no version in db' => ['Module_One', false, false], - ]; - } - - /** - * @expectedException \UnexpectedValueException - * @expectedExceptionMessage Schema version for module 'Module_Three' is not specified - */ - public function testIsDbSchemaUpToDateException() - { - $this->_model->isDbSchemaUpToDate('Module_Three', 'resource'); - } - - /** - * @expectedException \UnexpectedValueException - * @expectedExceptionMessage Schema version for module 'Module_Three' is not specified - */ - public function testIsDbDataUpToDateException() - { - $this->_model->isDbDataUpToDate('Module_Three', 'resource'); - } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php index 0ec872b012a0f..bde57cb3b924d 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/Plugin/DbStatusValidatorTest.php @@ -4,6 +4,8 @@ */ namespace Magento\Framework\Module\Plugin; +use Magento\Framework\Module\DbVersionInfo; + class DbStatusValidatorTest extends \PHPUnit_Framework_TestCase { /** @@ -41,6 +43,11 @@ class DbStatusValidatorTest extends \PHPUnit_Framework_TestCase */ private $moduleManager; + /** + * @var \Magento\Framework\Module\DbVersionInfo|\PHPUnit_Framework_MockObject_MockObject + */ + private $dbVersionInfoMock; + protected function setUp() { $this->_cacheMock = $this->getMock('\Magento\Framework\Cache\FrontendInterface'); @@ -61,11 +68,10 @@ protected function setUp() return ['resource_' . $moduleName]; })); $this->moduleManager = $this->getMock('\Magento\Framework\Module\Manager', [], [], '', false); + $this->dbVersionInfoMock = $this->getMock('\Magento\Framework\Module\DbVersionInfo', [], [], '', false); $this->_model = new DbStatusValidator( $this->_cacheMock, - $moduleList, - $resourceResolver, - $this->moduleManager + $this->dbVersionInfoMock ); } @@ -109,26 +115,24 @@ public function testAroundDispatchCached() } /** - * @param array $schemaValueMap - * @param array $dataValueMap + * @param array $dbVersionErrors * * @dataProvider aroundDispatchExceptionDataProvider * @expectedException \Magento\Framework\Module\Exception - * @expectedExceptionMessage Looks like database is outdated. Please, use setup tool to perform update + * @expectedExceptionMessage Please update your database: */ - public function testAroundDispatchException(array $schemaValueMap, array $dataValueMap) + public function testAroundDispatchException(array $dbVersionErrors) { $this->_cacheMock->expects($this->once()) ->method('load') ->with('db_is_up_to_date') ->will($this->returnValue(false)); $this->_cacheMock->expects($this->never())->method('save'); - $this->moduleManager->expects($this->any()) - ->method('isDbSchemaUpToDate') - ->will($this->returnValueMap($schemaValueMap)); - $this->moduleManager->expects($this->any()) - ->method('isDbDataUpToDate') - ->will($this->returnValueMap($dataValueMap)); + + $this->dbVersionInfoMock->expects($this->any()) + ->method('getDbVersionErrors') + ->will($this->returnValue($dbVersionErrors)); + $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock); } @@ -140,32 +144,50 @@ public function aroundDispatchExceptionDataProvider() return [ 'schema is outdated' => [ [ - ['Module_One', 'resource_Module_One', false], - ['Module_Two', 'resource_Module_Two', true], - ], - [ - ['Module_One', 'resource_Module_One', true], - ['Module_Two', 'resource_Module_Two', true], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_TYPE => 'schema', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ] ], ], 'data is outdated' => [ [ - ['Module_One', 'resource_Module_One', true], - ['Module_Two', 'resource_Module_Two', true], - ], - [ - ['Module_One', 'resource_Module_One', true], - ['Module_Two', 'resource_Module_Two', false], + [ + DbVersionInfo::KEY_MODULE => 'Module_Two', + DbVersionInfo::KEY_TYPE => 'data', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ] ], ], 'both schema and data are outdated' => [ [ - ['Module_One', 'resource_Module_One', false], - ['Module_Two', 'resource_Module_Two', false], - ], - [ - ['Module_One', 'resource_Module_One', false], - ['Module_Two', 'resource_Module_Two', false], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_TYPE => 'schema', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_Two', + DbVersionInfo::KEY_TYPE => 'schema', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_One', + DbVersionInfo::KEY_TYPE => 'data', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ], + [ + DbVersionInfo::KEY_MODULE => 'Module_Two', + DbVersionInfo::KEY_TYPE => 'data', + DbVersionInfo::KEY_CURRENT => 'none', + DbVersionInfo::KEY_REQUIRED => '1' + ] ], ], ]; diff --git a/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php b/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php index 50f919c422121..35cb6ef433511 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Module/UpdaterTest.php @@ -27,9 +27,9 @@ class UpdaterTest extends \PHPUnit_Framework_TestCase protected $_resourceSetupMock; /** - * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Module\DbVersionInfo|\PHPUnit_Framework_MockObject_MockObject */ - private $moduleManager; + private $_dbVersionInfo; /** * @var \Magento\Framework\Module\Updater @@ -63,36 +63,24 @@ protected function setUp() ->with('Test_Module') ->will($this->returnValue($resourceList)); - $this->moduleManager = $this->getMock('\Magento\Framework\Module\Manager', [], [], '', false); + $this->_dbVersionInfo = $this->getMock('Magento\Framework\Module\DbVersionInfo', [], [], '', false); $this->_model = new \Magento\Framework\Module\Updater( $this->_factoryMock, $this->_moduleListMock, $this->_resourceResolver, - $this->moduleManager + $this->_dbVersionInfo ); } - /** - * @covers \Magento\Framework\Module\Updater::updateData - */ - public function testUpdateDataNotApplied() - { - $this->moduleManager->expects($this->once()) - ->method('isDbDataUpToDate') - ->with('Test_Module', 'catalog_setup') - ->will($this->returnValue(true)); - $this->_factoryMock->expects($this->never()) - ->method('create'); - $this->_model->updateData(); - } - public function testUpdateData() { - $this->moduleManager->expects($this->once()) - ->method('isDbDataUpToDate') + $this->_dbVersionInfo->expects($this->once()) + ->method('isDataUpToDate') ->with('Test_Module', 'catalog_setup') - ->will($this->returnValue(false)); + ->will( + $this->returnValue(false) + ); $this->_factoryMock->expects($this->any()) ->method('create') ->with('catalog_setup', 'Test_Module') @@ -105,8 +93,8 @@ public function testUpdateData() public function testUpdateDataNoUpdates() { - $this->moduleManager->expects($this->once()) - ->method('isDbDataUpToDate') + $this->_dbVersionInfo->expects($this->once()) + ->method('isDataUpToDate') ->with('Test_Module', 'catalog_setup') ->will($this->returnValue(true)); $this->_factoryMock->expects($this->never()) diff --git a/dev/tests/unit/testsuite/Magento/Framework/ObjectManager/Config/ProxyConfigTest.php b/dev/tests/unit/testsuite/Magento/Framework/ObjectManager/Config/ProxyConfigTest.php deleted file mode 100644 index 5d1872c123cb2..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Framework/ObjectManager/Config/ProxyConfigTest.php +++ /dev/null @@ -1,112 +0,0 @@ -_config = $this->getMock('Magento\Framework\ObjectManager\ConfigInterface', [], [], '', false); - $this->_proxyConfig = new \Magento\Framework\ObjectManager\Config\ProxyConfig($this->_config); - } - - public function testSetRelations() - { - $relation = $this->getMock('Magento\Framework\ObjectManager\RelationsInterface', [], [], '', false); - $this->_config->expects($this->once()) - ->method('setRelations') - ->with($relation); - $this->_proxyConfig->setRelations($relation); - } - - public function testSetCache() - { - $configCache = $this->getMock('Magento\Framework\ObjectManager\ConfigCacheInterface', [], [], '', false); - $this->_config->expects($this->once()) - ->method('setCache') - ->with($configCache); - $this->_proxyConfig->setCache($configCache); - } - - public function testGetArguments() - { - $stringArgs = 'string'; - $this->_config->expects($this->once()) - ->method('getArguments') - ->with($stringArgs) - ->willReturn([]); - $this->assertEquals([], $this->_proxyConfig->getArguments($stringArgs)); - } - - /** - * @dataProvider isSharedDataProvider - */ - public function testIsShared($returnValue) - { - $type = 'string'; - $this->_config->expects($this->once()) - ->method('isShared') - ->with($type) - ->willReturn($returnValue); - $this->assertEquals($returnValue, $this->_proxyConfig->isShared($type)); - } - - /** - * @return array - */ - public function isSharedDataProvider() - { - return [ - [true], - [false] - ]; - } - - public function testGetInstanceType() - { - $instanceName = 'string'; - $this->_config->expects($this->once()) - ->method('getInstanceType') - ->with($instanceName) - ->willReturn('instanceType'); - $this->assertEquals('instanceType', $this->_proxyConfig->getInstanceType($instanceName)); - } - - public function testGetPreference() - { - $type = 'string'; - $this->_config->expects($this->once()) - ->method('getPreference') - ->with($type) - ->willReturn('someString'); - $this->assertEquals('someString', $this->_proxyConfig->getPreference($type)); - } - - public function testExtend() - { - $this->_config->expects($this->once()) - ->method('extend') - ->with([]); - $this->_proxyConfig->extend([]); - } - - public function testGetVirtualTypes() - { - $this->_config->expects($this->once()) - ->method('getVirtualTypes') - ->willReturn([]); - $this->assertEquals([], $this->_proxyConfig->getVirtualTypes()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Framework/ObjectTest.php b/dev/tests/unit/testsuite/Magento/Framework/ObjectTest.php index bfcbda9ee778d..1931664c04be8 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/ObjectTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/ObjectTest.php @@ -433,4 +433,30 @@ public function testOffset() $this->_object->offsetUnset('key1'); $this->assertFalse($this->_object->offsetExists('key1')); } + + /** + * Tests _underscore method directly + * + * @dataProvider underscoreDataProvider + */ + public function testUnderscore($input, $expectedOutput) + { + $refObject = new \ReflectionObject($this->_object); + $refMethod = $refObject->getMethod('_underscore'); + $refMethod->setAccessible(true); + $output = $refMethod->invoke($this->_object, $input); + $this->assertEquals($expectedOutput, $output); + } + + public function underscoreDataProvider() + { + return [ + 'Test 1' => ['Stone1Color', 'stone_1_color'], + 'Test 2' => ['StoneColor', 'stone_color'], + 'Test 3' => ['StoneToXML', 'stone_to_xml'], + 'Test 4' => ['1StoneColor', '1_stone_color'], + 'Test 5' => ['getCcLast4', 'get_cc_last_4'], + 'Test 6' => ['99Bottles', '99_bottles'] + ]; + } } diff --git a/dev/tests/unit/testsuite/Magento/Framework/Search/Request/Aggregation/StatusTest.php b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/Aggregation/StatusTest.php new file mode 100644 index 0000000000000..8090b4a80c007 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/Aggregation/StatusTest.php @@ -0,0 +1,29 @@ +objectManagerHelper = new ObjectManagerHelper($this); + $this->status = $this->objectManagerHelper->getObject('Magento\Framework\Search\Request\Aggregation\Status'); + } + + public function testIsEnabled() + { + $this->assertFalse($this->status->isEnabled()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php index d481832c30189..cd3280965f2ac 100644 --- a/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php +++ b/dev/tests/unit/testsuite/Magento/Framework/Search/Request/CleanerTest.php @@ -8,6 +8,9 @@ class CleanerTest extends \PHPUnit_Framework_TestCase { + /** @var \Magento\Framework\Search\Request\Aggregation\StatusInterface|\PHPUnit_Framework_MockObject_MockObject */ + private $status; + /** * @var \Magento\Framework\Search\Request\Cleaner */ @@ -17,11 +20,103 @@ protected function setUp() { $helper = new ObjectManager($this); - $this->cleaner = $helper->getObject('Magento\Framework\Search\Request\Cleaner'); + $this->status = $this->getMockBuilder('\Magento\Framework\Search\Request\Aggregation\StatusInterface') + ->disableOriginalConstructor() + ->setMethods(['isEnabled']) + ->getMockForAbstractClass(); + + $this->cleaner = $helper->getObject( + 'Magento\Framework\Search\Request\Cleaner', + ['aggregationStatus' => $this->status] + ); } public function testClean() { + $this->status->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue(true)); + $requestData = [ + 'query' => 'bool_query', + 'queries' => [ + 'bool_query' => [ + 'queryReference' => [ + ['ref' => 'bool_query_rm'], + ['ref' => 'match_query'], + ['ref' => 'filtered_query_to_filter2'], + ], + 'type' => 'boolQuery', + ], + 'match_query' => ['value' => 'ok', 'type' => 'matchQuery'], + 'bool_query_rm' => [ + 'queryReference' => [ + ['ref' => 'match_query_rm'], + ['ref' => 'filtered_query_to_query'], + ['ref' => 'filtered_query_to_filter'], + ], + 'type' => 'boolQuery', + ], + 'match_query_rm' => ['value' => '$some$', 'type' => 'matchQuery'], + 'match_query_rm2' => ['value' => '$some2$', 'type' => 'matchQuery'], + 'filtered_query_to_query' => [ + 'queryReference' => [['ref' => 'match_query_rm2']], + 'type' => 'filteredQuery', + ], + 'filtered_query_to_filter' => [ + 'filterReference' => [['ref' => 'bool_filter']], + 'type' => 'filteredQuery', + ], + 'filtered_query_to_filter2' => [ + 'filterReference' => [['ref' => 'bool_filter2']], + 'type' => 'filteredQuery', + ], + ], + 'filters' => [ + 'bool_filter' => [ + 'filterReference' => [['ref' => 'term_filter'], ['ref' => 'range_filter']], + 'type' => 'boolFilter', + ], + 'term_filter' => ['value' => '$val$', 'type' => 'termFilter'], + 'range_filter' => ['from' => '$from$', 'to' => '$to$', 'type' => 'rangeFilter'], + 'bool_filter2' => [ + 'filterReference' => [['ref' => 'term_filter2']], + 'type' => 'boolFilter', + ], + 'term_filter2' => ['value' => 'value_good', 'type' => 'termFilter'], + ], + ]; + $exceptedRequestData = [ + 'query' => 'bool_query', + 'queries' => [ + 'bool_query' => [ + 'queryReference' => [['ref' => 'match_query'], ['ref' => 'filtered_query_to_filter2']], + 'type' => 'boolQuery', + ], + 'match_query' => ['value' => 'ok', 'type' => 'matchQuery'], + 'filtered_query_to_filter2' => [ + 'filterReference' => [['ref' => 'bool_filter2']], + 'type' => 'filteredQuery', + ], + ], + 'filters' => [ + 'bool_filter2' => [ + 'filterReference' => [['ref' => 'term_filter2']], + 'type' => 'boolFilter', + ], + 'term_filter2' => ['value' => 'value_good', 'type' => 'termFilter'], + ], + ]; + + $result = $this->cleaner->clean($requestData); + + $this->assertEquals($exceptedRequestData, $result); + } + + public function testCleanWithoutAggregations() + { + $this->status->expects($this->once()) + ->method('isEnabled') + ->will($this->returnValue(false)); $requestData = [ 'query' => 'bool_query', 'queries' => [ @@ -91,6 +186,7 @@ public function testClean() ], 'term_filter2' => ['value' => 'value_good', 'type' => 'termFilter'], ], + 'aggregations' => [], ]; $result = $this->cleaner->clean($requestData); diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTest.php new file mode 100644 index 0000000000000..d7b77c400c1db --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Model/Attribute/SalePriceEffectiveDateTest.php @@ -0,0 +1,73 @@ +getObject('\Magento\GoogleShopping\Model\Attribute\SalePriceEffectiveDate'); + $product = $this->getMock('\Magento\Catalog\Model\Product', ['__wakeup'], [], '', false); + $effectiveDateFrom = $this->getMock( + '\Magento\GoogleShopping\Model\Attribute\DefaultAttribute', + ['getProductAttributeValue'], + [], + '', + false + ); + $effectiveDateFrom->expects($this->any()) + ->method('getProductAttributeValue') + ->with($product) + ->will($this->returnValue($dateFrom)); + + $effectiveDateTo = $this->getMock( + '\Magento\GoogleShopping\Model\Attribute\DefaultAttribute', + ['getProductAttributeValue'], + [], + '', + false + ); + $effectiveDateTo->expects($this->any()) + ->method('getProductAttributeValue') + ->with($product) + ->will($this->returnValue($dataTo)); + $model->setGroupAttributeSalePriceEffectiveDateFrom($effectiveDateFrom); + $model->setGroupAttributeSalePriceEffectiveDateTo($effectiveDateTo); + $attribute = $this->getMock('\Magento\Framework\Gdata\Gshopping\Extension\Attribute'); + $entry = $this->getMock( + '\Magento\Framework\Gdata\Gshopping\Entry', + ['getContentAttributeByName'], + [], + '', + false + ); + $entry->expects($this->any()) + ->method('getContentAttributeByName') + ->with('sale_price_effective_date') + ->will($this->returnValue($attribute)); + $this->assertEquals($entry, $model->convertAttribute($product, $entry)); + } + + /** + * @return array + */ + public function testConvertAttributeDataProvider() + { + $dateFrom = date(DATE_ATOM, strtotime("-2 day")); + $dateTo = date(DATE_ATOM); + return [ + [$dateFrom, $dateTo], + [null, $dateTo], + [$dateFrom, null] + ]; + } +} diff --git a/dev/tests/unit/testsuite/Magento/LayeredNavigation/Model/Aggregation/StatusTest.php b/dev/tests/unit/testsuite/Magento/LayeredNavigation/Model/Aggregation/StatusTest.php new file mode 100644 index 0000000000000..d1863feb20d8f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/LayeredNavigation/Model/Aggregation/StatusTest.php @@ -0,0 +1,29 @@ +objectManagerHelper = new ObjectManagerHelper($this); + $this->resolver = $this->objectManagerHelper->getObject('Magento\LayeredNavigation\Model\Aggregation\Status'); + } + + public function testIsEnabled() + { + $this->assertTrue($this->resolver->isEnabled()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/AddtocartTest.php b/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/AddtocartTest.php new file mode 100644 index 0000000000000..bbb5ed536e352 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/AddtocartTest.php @@ -0,0 +1,730 @@ +wishlistMock = $this->getMockBuilder('Magento\Wishlist\Model\Wishlist') + ->disableOriginalConstructor() + ->getMock(); + $this->wishlistFactorytMock = $this->getMockBuilder('Magento\Wishlist\Model\WishlistFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->wishlistFactorytMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($this->wishlistMock)); + + $this->registryMock = $this->getMockBuilder('Magento\Framework\Registry') + ->disableOriginalConstructor() + ->getMock(); + $this->itemFactoryMock = $this->getMockBuilder('Magento\Wishlist\Model\ItemFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $searchFactoryMock = $this->getMockBuilder('Magento\MultipleWishlist\Model\SearchFactory') + ->disableOriginalConstructor() + ->getMock(); + $strategyEmailFactoryMock = $this->getMockBuilder( + 'Magento\MultipleWishlist\Model\Search\Strategy\EmailFactory' + ) + ->disableOriginalConstructor() + ->getMock(); + $strategyNameFactoryMock = $this->getMockBuilder( + 'Magento\MultipleWishlist\Model\Search\Strategy\NameFactory' + ) + ->disableOriginalConstructor() + ->getMock(); + $checkoutSessionMock = $this->getMockBuilder('Magento\Checkout\Model\Session') + ->disableOriginalConstructor() + ->getMock(); + $this->checkoutCartMock = $this->getMockBuilder('Magento\Checkout\Model\Cart') + ->disableOriginalConstructor() + ->getMock(); + $this->customerSessionMock = $this->getMockBuilder('Magento\Customer\Model\Session') + ->disableOriginalConstructor() + ->getMock(); + $localeResolverMock = $this->getMockBuilder('Magento\Framework\Locale\ResolverInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->responseMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods(['setRedirect']) + ->getMockForAbstractClass(); + $this->viewMock = $this->getMockBuilder('Magento\Framework\App\ViewInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->redirectMock = $this->getMockBuilder('Magento\Framework\App\Response\RedirectInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->layoutMock = $this->getMockBuilder('Magento\Framework\View\Layout') + ->disableOriginalConstructor() + ->getMock(); + + $this->blockMock = $this->getMockBuilder('Magento\Framework\View\Element\BlockInterface') + ->disableOriginalConstructor() + ->setMethods(['toHtml', 'setRefererUrl']) + ->getMockForAbstractClass(); + + $this->moduleManagerMock = $this->getMockBuilder('Magento\Framework\Module\Manager') + ->disableOriginalConstructor() + ->getMock(); + + $this->quantityProcessorMock = $this->getMockBuilder('Magento\Wishlist\Model\LocaleQuantityProcessor') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->messageManagerMock = $this->getMockBuilder('Magento\Framework\Message\ManagerInterface') + ->disableOriginalConstructor() + ->setMethods(['addSuccess']) + ->getMockForAbstractClass(); + + $this->contextMock = $this->getMockBuilder('Magento\Framework\App\Action\Context') + ->disableOriginalConstructor() + ->getMock(); + $this->contextMock->expects($this->any()) + ->method('getRequest') + ->will($this->returnValue($this->requestMock)); + $this->contextMock->expects($this->any()) + ->method('getResponse') + ->will($this->returnValue($this->responseMock)); + $this->contextMock->expects($this->any()) + ->method('getView') + ->will($this->returnValue($this->viewMock)); + $this->contextMock->expects($this->any()) + ->method('getRedirect') + ->will($this->returnValue($this->redirectMock)); + $this->contextMock->expects($this->any()) + ->method('getObjectManager') + ->will($this->returnValue($this->objectManagerMock)); + $this->contextMock->expects($this->any()) + ->method('getMessageManager') + ->will($this->returnValue($this->messageManagerMock)); + + $this->model = new Addtocart( + $this->contextMock, + $this->registryMock, + $this->itemFactoryMock, + $this->wishlistFactorytMock, + $searchFactoryMock, + $strategyEmailFactoryMock, + $strategyNameFactoryMock, + $checkoutSessionMock, + $this->checkoutCartMock, + $this->customerSessionMock, + $localeResolverMock, + $this->moduleManagerMock, + $this->quantityProcessorMock + ); + } + + public function testExecuteWithNoSelectedAndRedirectToCart() + { + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('qty', null) + ->willReturn(false); + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('selected', null) + ->willReturn(false); + + $cartHelperMock = $this->getMockBuilder('Magento\Checkout\Helper\Cart') + ->disableOriginalConstructor() + ->getMock(); + $cartHelperMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(true); + $cartHelperMock->expects($this->once()) + ->method('getCartUrl') + ->willReturn('cart_url'); + + $this->objectManagerMock->expects($this->exactly(2)) + ->method('get') + ->with('Magento\Checkout\Helper\Cart') + ->willReturn($cartHelperMock); + + $salesQuoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->getMock(); + $salesQuoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->checkoutCartMock->expects($this->once()) + ->method('getQuote') + ->willReturn($salesQuoteMock); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with('cart_url'); + + $this->model->execute(); + } + + public function testExecuteWithRedirectToReferer() + { + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('qty', null) + ->willReturn([11 => 2]); + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('selected', null) + ->willReturn([11 => 'on']); + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->getMock(); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + $itemMock->expects($this->once()) + ->method('loadWithOptions') + ->with(11) + ->willReturnSelf(); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(2) + ->willReturn('2'); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with('2') + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, false) + ->willReturn(true); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getProduct') + ->willReturn($productMock); + + $cartHelperMock = $this->getMockBuilder('Magento\Checkout\Helper\Cart') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Checkout\Helper\Cart') + ->willReturn($cartHelperMock); + + $cartHelperMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(false); + $this->redirectMock->expects($this->exactly(2)) + ->method('getRefererUrl') + ->willReturn('referer_url'); + + $productMock->expects($this->once()) + ->method('getName') + ->willReturn('product_name'); + $this->messageManagerMock->expects($this->once()) + ->method('addSuccess') + ->with('1 product(s) have been added to shopping cart: "product_name".') + ->willReturnSelf(); + + $salesQuoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->getMock(); + $salesQuoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->checkoutCartMock->expects($this->once()) + ->method('getQuote') + ->willReturn($salesQuoteMock); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with('referer_url'); + + $this->model->execute(); + } + + public function testExecuteWithNotSalableAndNoRedirect() + { + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('qty', null) + ->willReturn([22 => 2]); + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('selected', null) + ->willReturn([22 => 'on']); + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->getMock(); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + $itemMock->expects($this->once()) + ->method('loadWithOptions') + ->with(22) + ->willReturnSelf(); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(2) + ->willReturn('2'); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with('2') + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, false) + ->willThrowException( + new \Magento\Framework\Model\Exception(null, \Magento\Wishlist\Model\Item::EXCEPTION_CODE_NOT_SALABLE) + ); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getProduct') + ->willReturn($productMock); + + $cartHelperMock = $this->getMockBuilder('Magento\Checkout\Helper\Cart') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Checkout\Helper\Cart') + ->willReturn($cartHelperMock); + + $cartHelperMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(false); + $this->redirectMock->expects($this->once()) + ->method('getRefererUrl') + ->willReturn(false); + + $productMock->expects($this->once()) + ->method('getName') + ->willReturn('product_name'); + $this->messageManagerMock->expects($this->once()) + ->method('addError') + ->with('Cannot add the following product(s) to shopping cart: "product_name".') + ->willReturnSelf(); + + $salesQuoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->getMock(); + $salesQuoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->checkoutCartMock->expects($this->once()) + ->method('getQuote') + ->willReturn($salesQuoteMock); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with(''); + + $this->model->execute(); + } + + public function testExecuteWithHasOptions() + { + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('qty', null) + ->willReturn([22 => 2]); + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('selected', null) + ->willReturn([22 => 'on']); + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->getMock(); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + $itemMock->expects($this->once()) + ->method('loadWithOptions') + ->with(22) + ->willReturnSelf(); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(2) + ->willReturn('2'); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with('2') + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, false) + ->willThrowException( + new \Magento\Framework\Model\Exception( + null, + \Magento\Wishlist\Model\Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS + ) + ); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getProduct') + ->willReturn($productMock); + + $cartHelperMock = $this->getMockBuilder('Magento\Checkout\Helper\Cart') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Checkout\Helper\Cart') + ->willReturn($cartHelperMock); + + $cartHelperMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(false); + $this->redirectMock->expects($this->once()) + ->method('getRefererUrl') + ->willReturn(false); + + $productMock->expects($this->once()) + ->method('getName') + ->willReturn('product_name'); + $itemMock->expects($this->once()) + ->method('getProductUrl') + ->willReturn('product_url'); + + $salesQuoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->getMock(); + $salesQuoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->checkoutCartMock->expects($this->once()) + ->method('getQuote') + ->willReturn($salesQuoteMock); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with('product_url'); + + $this->model->execute(); + } + + public function testExecuteWithMagentoException() + { + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('qty', null) + ->willReturn([22 => 2]); + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('selected', null) + ->willReturn([22 => 'on']); + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->getMock(); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + $itemMock->expects($this->once()) + ->method('loadWithOptions') + ->with(22) + ->willReturnSelf(); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(2) + ->willReturn('2'); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with('2') + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, false) + ->willThrowException(new \Magento\Framework\Model\Exception('Unknown Magento error')); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $itemMock->expects($this->once()) + ->method('getProduct') + ->willReturn($productMock); + + $cartHelperMock = $this->getMockBuilder('Magento\Checkout\Helper\Cart') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock->expects($this->once()) + ->method('get') + ->with('Magento\Checkout\Helper\Cart') + ->willReturn($cartHelperMock); + + $cartHelperMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(false); + $this->redirectMock->expects($this->exactly(2)) + ->method('getRefererUrl') + ->willReturn('referer_url'); + + $productMock->expects($this->once()) + ->method('getName') + ->willReturn('product_name'); + $this->messageManagerMock->expects($this->once()) + ->method('addError') + ->with('Unknown Magento error for "product_name"') + ->willReturnSelf(); + + $salesQuoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->getMock(); + $salesQuoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->checkoutCartMock->expects($this->once()) + ->method('getQuote') + ->willReturn($salesQuoteMock); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with('referer_url'); + + $this->model->execute(); + } + + public function testExecuteWithException() + { + $this->requestMock->expects($this->at(0)) + ->method('getParam') + ->with('qty', null) + ->willReturn([22 => 2]); + $this->requestMock->expects($this->at(1)) + ->method('getParam') + ->with('selected', null) + ->willReturn([22 => 'on']); + + $itemMock = $this->getMockBuilder('Magento\Wishlist\Model\Item') + ->disableOriginalConstructor() + ->getMock(); + $this->itemFactoryMock->expects($this->once()) + ->method('create') + ->willReturn($itemMock); + $itemMock->expects($this->once()) + ->method('loadWithOptions') + ->with(22) + ->willReturnSelf(); + + $this->quantityProcessorMock->expects($this->once()) + ->method('process') + ->with(2) + ->willReturn('2'); + + $exception = new \Exception(); + + $itemMock->expects($this->once()) + ->method('setQty') + ->with('2') + ->willReturnSelf(); + $itemMock->expects($this->once()) + ->method('addToCart') + ->with($this->checkoutCartMock, false) + ->willThrowException($exception); + + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->disableOriginalConstructor() + ->getMock(); + + $loggerMock = $this->getMockBuilder('Magento\Framework\Logger') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock->expects($this->at(0)) + ->method('get') + ->with('Magento\Framework\Logger') + ->willReturn($loggerMock); + + $loggerMock->expects($this->once()) + ->method('logException') + ->with($exception); + + $cartHelperMock = $this->getMockBuilder('Magento\Checkout\Helper\Cart') + ->disableOriginalConstructor() + ->getMock(); + + $this->objectManagerMock->expects($this->at(1)) + ->method('get') + ->with('Magento\Checkout\Helper\Cart') + ->willReturn($cartHelperMock); + + $cartHelperMock->expects($this->once()) + ->method('getShouldRedirectToCart') + ->willReturn(false); + $this->redirectMock->expects($this->exactly(2)) + ->method('getRefererUrl') + ->willReturn('referer_url'); + + $this->messageManagerMock->expects($this->once()) + ->method('addError') + ->with('We could not add the item to shopping cart.') + ->willReturnSelf(); + + $salesQuoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') + ->disableOriginalConstructor() + ->getMock(); + $salesQuoteMock->expects($this->once()) + ->method('collectTotals') + ->willReturnSelf(); + + $this->checkoutCartMock->expects($this->once()) + ->method('save') + ->willReturnSelf(); + $this->checkoutCartMock->expects($this->once()) + ->method('getQuote') + ->willReturn($salesQuoteMock); + + $this->responseMock->expects($this->once()) + ->method('setRedirect') + ->with('referer_url'); + + $this->model->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/ViewTest.php b/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/ViewTest.php index bb04bdfa23958..874746943526f 100644 --- a/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/MultipleWishlist/Controller/Search/ViewTest.php @@ -62,6 +62,11 @@ class ViewTest extends \PHPUnit_Framework_TestCase */ protected $blockMock; + /** + * @var \Magento\Framework\Module\Manager|\PHPUnit_Framework_MockObject_MockObject + */ + protected $moduleManagerMock; + protected function setUp() { $this->wishlistMock = $this->getMockBuilder('Magento\Wishlist\Model\Wishlist') @@ -145,6 +150,10 @@ protected function setUp() ->method('getRedirect') ->will($this->returnValue($this->redirectMock)); + $this->moduleManagerMock = $this->getMockBuilder('Magento\Framework\Module\Manager') + ->disableOriginalConstructor() + ->getMock(); + $this->model = new View( $this->contextMock, $this->registryMock, @@ -156,7 +165,8 @@ protected function setUp() $checkoutSessionMock, $checkoutCartMock, $this->customerSessionMock, - $localeResolverMock + $localeResolverMock, + $this->moduleManagerMock ); } diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php new file mode 100644 index 0000000000000..2b87525d0ba73 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Block/Checkout/Address/SelectTest.php @@ -0,0 +1,191 @@ +objectManager = new ObjectManager($this); + $this->multishippingMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->addressMock = $this->getMock('Magento\Customer\Api\Data\AddressInterface'); + $this->customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->searchCriteriaBuilderMock = + $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->addressRepositoryMock = $this->getMock('Magento\Customer\Api\AddressRepositoryInterface'); + $this->filterMock = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); + $this->searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteria', [], [], '', false); + $this->block = $this->objectManager->getObject('Magento\Multishipping\Block\Checkout\Address\Select', [ + 'multishipping' => $this->multishippingMock, + 'addressRepository' => $this->addressRepositoryMock, + 'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock, + 'filterBuilder' => $this->filterBuilderMock + ] + ); + } + + /** + * @param string $id + * @param bool $expectedValue + * @dataProvider isDefaultAddressDataProvider + */ + public function testIsAddressDefaultBilling($id, $expectedValue) + { + $this->addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getDefaultBilling')->willReturn($id); + $this->assertEquals($expectedValue, $this->block->isAddressDefaultBilling($this->addressMock)); + } + + /** + * @param string $id + * @param bool $expectedValue + * @dataProvider isDefaultAddressDataProvider + */ + public function testIsAddressDefaultShipping($id, $expectedValue) + { + $this->addressMock->expects($this->once())->method('getId')->willReturn(1); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getDefaultShipping')->willReturn($id); + $this->assertEquals($expectedValue, $this->block->isAddressDefaultShipping($this->addressMock)); + } + + public function isDefaultAddressDataProvider() + { + return [ + 'yes' => [1, true], + 'no' => [2, false], + ]; + } + + public function testGetAddress() + { + $searchResultMock = $this->getMock('Magento\Customer\Api\Data\AddressSearchResultsInterface'); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getId')->willReturn(1); + $this->filterBuilderMock->expects($this->once())->method('setField')->with('parent_id')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setValue')->with(1)->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setConditionType')->with('eq')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($this->filterMock); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('addFilter') + ->with([$this->filterMock]) + ->willReturnSelf(); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + $this->addressRepositoryMock + ->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($searchResultMock); + $searchResultMock->expects($this->once())->method('getItems')->willReturn([$this->addressMock]); + $this->assertEquals([$this->addressMock], $this->block->getAddress()); + $this->assertEquals([$this->addressMock], $this->block->getData('address_collection')); + } + + public function testGetAlreadyExistingAddress() + { + $this->block = $this->objectManager->getObject('Magento\Multishipping\Block\Checkout\Address\Select', [ + 'addressRepository' => $this->addressRepositoryMock, + 'filterBuilder' => $this->filterBuilderMock, + 'data' => [ + 'address_collection' => [$this->addressMock + ] + ] + ] + ); + $this->filterBuilderMock->expects($this->never())->method('setField'); + $this->addressRepositoryMock + ->expects($this->never()) + ->method('getList'); + $this->assertEquals([$this->addressMock], $this->block->getAddress()); + } + + public function testGetAddressWhenItNotExistInCustomer() + { + $searchResultMock = $this->getMock('Magento\Customer\Api\Data\AddressSearchResultsInterface'); + $this->multishippingMock->expects($this->once())->method('getCustomer')->willReturn($this->customerMock); + $this->customerMock->expects($this->once())->method('getId')->willReturn(1); + $this->filterBuilderMock->expects($this->once())->method('setField')->with('parent_id')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setValue')->with(1)->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setConditionType')->with('eq')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($this->filterMock); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('addFilter') + ->with([$this->filterMock]) + ->willReturnSelf(); + $this->searchCriteriaBuilderMock + ->expects($this->once()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + $this->addressRepositoryMock + ->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($searchResultMock); + + $searchResultMock->expects($this->once())->method('getItems')->willThrowException(new NoSuchEntityException()); + $this->assertEquals([], $this->block->getAddress()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditAddressTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditAddressTest.php new file mode 100644 index 0000000000000..a16266fae67fb --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditAddressTest.php @@ -0,0 +1,141 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('\Magento\Multishipping\Controller\Checkout\Address\EditAddress', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->request->expects($this->once())->method('getParam')->with('id')->willReturn(1); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Edit Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Edit Address'); + $valueMap = [ + ['*/*/selectBilling', null, 'success/url'], + ['*/*/*', ['id' => 1], 'error/url'], + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('success/url'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditBillingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditBillingTest.php new file mode 100644 index 0000000000000..3ba5dec09094e --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditBillingTest.php @@ -0,0 +1,172 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->stateMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping\State', [], [], '', false); + $valueMap = [ + ['Magento\Multishipping\Model\Checkout\Type\Multishipping\State', $this->stateMock], + ['Magento\Multishipping\Model\Checkout\Type\Multishipping', $this->checkoutMock] + ]; + $this->objectManagerMock->expects($this->any())->method('get')->willReturnMap($valueMap); + $this->request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\EditBilling', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with( \Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_BILLING); + $this->request->expects($this->once())->method('getParam')->with('id')->willReturn(1); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Edit Billing Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Edit Billing Address'); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + $valueMap = [ + ['*/*/saveBilling', ['id' => 1], 'success/url'], + ['*/*/*', ['id' => 1], 'error/url'], + ['*/checkout/overview', null, 'back/address'] + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('back/address'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_BILLING); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditShippingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditShippingTest.php new file mode 100644 index 0000000000000..fd8ca0515670a --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/EditShippingTest.php @@ -0,0 +1,175 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->stateMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping\State', [], [], '', false); + $valueMap = [ + ['Magento\Multishipping\Model\Checkout\Type\Multishipping\State', $this->stateMock], + ['Magento\Multishipping\Model\Checkout\Type\Multishipping', $this->checkoutMock] + ]; + $this->objectManagerMock->expects($this->any())->method('get')->willReturnMap($valueMap); + $this->request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($this->request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\EditShipping', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SHIPPING); + $this->request->expects($this->once())->method('getParam')->with('id')->willReturn(1); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Edit Shipping Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Edit Shipping Address'); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + $valueMap = [ + ['*/*/editShippingPost', ['id' => 1], 'success/url'], + ['*/*/*', null, 'error/url'], + ['*/checkout/shipping', null, 'back/address'] + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->checkoutMock + ->expects($this->once()) + ->method('getCustomerDefaultShippingAddress') + ->willReturn('shipping_addres'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('back/address'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SHIPPING); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewBillingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewBillingTest.php new file mode 100644 index 0000000000000..0c3925db9b7c7 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewBillingTest.php @@ -0,0 +1,133 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setErrorUrl', 'setBackUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\NewBilling', + ['context' => $contextMock]); + } + + public function testExecute() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Create Billing Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Create Billing Address'); + $valueMap = [ + ['*/*/selectBilling', null, 'success/url'], + ['*/*/*', null, 'error/url'], + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with('success/url'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewShippingTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewShippingTest.php new file mode 100644 index 0000000000000..a0e703c3e20cc --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/NewShippingTest.php @@ -0,0 +1,184 @@ +configMock = $this->getMock('Magento\Framework\View\Page\Config', [], [], '', false); + $this->checkoutMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping', [], [], '', false); + $this->titleMock = $this->getMock('Magento\Framework\View\Page\Title', [], [], '', false); + $this->layoutMock = $this->getMock('Magento\Framework\View\Layout', [], [], '', false); + $this->viewMock = $this->getMock('Magento\Framework\App\ViewInterface'); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->stateMock = + $this->getMock('Magento\Multishipping\Model\Checkout\Type\Multishipping\State', [], [], '', false); + $valueMap = [ + ['Magento\Multishipping\Model\Checkout\Type\Multishipping\State', $this->stateMock], + ['Magento\Multishipping\Model\Checkout\Type\Multishipping', $this->checkoutMock] + ]; + $this->objectManagerMock->expects($this->any())->method('get')->willReturnMap($valueMap); + $request = $this->getMockBuilder('\Magento\Framework\App\RequestInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface') + ->disableOriginalConstructor() + ->setMethods([]) + ->getMockForAbstractClass(); + $contextMock = $this->getMock('\Magento\Framework\App\Action\Context', [], [], '', false); + $contextMock->expects($this->atLeastOnce()) + ->method('getRequest') + ->will($this->returnValue($request)); + $contextMock->expects($this->atLeastOnce()) + ->method('getResponse') + ->will($this->returnValue($response)); + $contextMock->expects($this->any())->method('getView')->willReturn($this->viewMock); + $contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $methods = ['setTitle', 'getTitle', 'setSuccessUrl', 'setBackUrl', 'setErrorUrl', '__wakeUp']; + $this->addressFormMock = + $this->getMock('Magento\Customer\Block\Address\Edit', $methods, [], '', false); + $this->urlMock = $this->getMock('Magento\Framework\UrlInterface'); + $contextMock->expects($this->any())->method('getUrl')->willReturn($this->urlMock); + $this->pageMock = $this->getMock('Magento\Framework\View\Result\Page', [], [], '', false); + $this->pageMock->expects($this->any())->method('getConfig')->willReturn($this->configMock); + $this->configMock->expects($this->any())->method('getTitle')->willReturn($this->titleMock); + $this->viewMock->expects($this->any())->method('getPage')->willReturn($this->pageMock); + $this->controller = $objectManager->getObject('Magento\Multishipping\Controller\Checkout\Address\NewShipping', + ['context' => $contextMock]); + } + + /** + * @param string $backUrl + * @param string $shippingAddress + * @param string $url + * @dataProvider executeDataProvider + */ + public function testExecute($backUrl, $shippingAddress, $url) + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SELECT_ADDRESSES); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit') + ->willReturn($this->addressFormMock); + $this->addressFormMock + ->expects($this->once()) + ->method('setTitle') + ->with('Create Shipping Address') + ->willReturnSelf(); + $helperMock = $this->getMock('Magento\Multishipping\Helper\Data', [], [], '', false); + $helperMock->expects($this->any())->method('__')->willReturn('Create Shipping Address'); + $this->addressFormMock->expects($this->once())->method('setSuccessUrl')->with('success/url')->willReturnSelf(); + $this->addressFormMock->expects($this->once())->method('setErrorUrl')->with('error/url')->willReturnSelf(); + $valueMap = [ + ['*/*/shippingSaved', null, 'success/url'], + ['*/*/*', null, 'error/url'], + [$backUrl, null, $url] + ]; + $this->urlMock->expects($this->any())->method('getUrl')->willReturnMap($valueMap); + $this->titleMock->expects($this->once())->method('getDefault')->willReturn('default_title'); + $this->addressFormMock->expects($this->once())->method('getTitle')->willReturn('Address title'); + $this->titleMock->expects($this->once())->method('set')->with('Address title - default_title'); + $this->checkoutMock + ->expects($this->once()) + ->method('getCustomerDefaultShippingAddress') + ->willReturn($shippingAddress); + $this->addressFormMock->expects($this->once())->method('setBackUrl')->with($url); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } + + public function executeDataProvider() + { + return [ + 'shipping_address_exists' => ['*/checkout/addresses', 'shipping_address', 'back/address'], + 'shipping_address_not_exist' => ['*/cart/', null, 'back/cart'] + ]; + } + + + public function testExecuteWhenCustomerAddressBlockNotExist() + { + $this->stateMock + ->expects($this->once()) + ->method('setActiveStep') + ->with(\Magento\Multishipping\Model\Checkout\Type\Multishipping\State::STEP_SELECT_ADDRESSES); + $this->viewMock->expects($this->once())->method('loadLayout')->willReturnSelf(); + $this->viewMock->expects($this->any())->method('getLayout')->willReturn($this->layoutMock); + $this->layoutMock + ->expects($this->once()) + ->method('getBlock') + ->with('customer_address_edit'); + $this->urlMock->expects($this->never())->method('getUrl'); + $this->viewMock->expects($this->once())->method('renderLayout'); + $this->controller->execute(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/ShippingSavedTest.php b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/ShippingSavedTest.php new file mode 100644 index 0000000000000..28136ff1454f6 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Multishipping/Controller/Checkout/Address/ShippingSavedTest.php @@ -0,0 +1,149 @@ +checkoutMock = $this->getMock( + 'Magento\Multishipping\Model\Checkout\Type\Multishipping', + [], + [], + '', + false + ); + $this->objectManagerMock = $this->getMock('Magento\Framework\ObjectManagerInterface'); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with('Magento\Multishipping\Model\Checkout\Type\Multishipping') + ->willReturn($this->checkoutMock); + $this->contextMock = $this->getMock('Magento\Framework\App\Action\Context', [], [], '', false); + $requestMock = $this->getMock('Magento\Framework\App\RequestInterface'); + $responseMock = $this->getMock('Magento\Framework\App\ResponseInterface'); + $this->redirectMock = $this->getMock('Magento\Framework\App\Response\RedirectInterface'); + $this->contextMock->expects($this->any())->method('getObjectManager')->willReturn($this->objectManagerMock); + $this->contextMock->expects($this->any())->method('getRequest')->willReturn($requestMock); + $this->contextMock->expects($this->any())->method('getResponse')->willReturn($responseMock); + $this->contextMock->expects($this->any())->method('getRedirect')->willReturn($this->redirectMock); + + $this->addressRepositoryMock = $this->getMock('Magento\Customer\Api\AddressRepositoryInterface'); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->criteriaBuilderMock = $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->controller = new ShippingSaved( + $this->contextMock, + $this->addressRepositoryMock, + $this->filterBuilderMock, + $this->criteriaBuilderMock + ); + } + + public function testExecuteResetsCheckoutIfCustomerHasAddedNewShippingAddressAndItIsTheOnlyAddressHeHas() + { + $customerId = 1; + $customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + $customerMock->expects($this->any())->method('getId')->willReturn($customerId); + $this->checkoutMock->expects($this->any())->method('getCustomer')->willReturn($customerMock); + + $this->mockCustomerAddressRepository( + $customerId, + [$this->getMock('Magento\Customer\Api\Data\AddressInterface')] + ); + + // check that checkout is reset + $this->checkoutMock->expects($this->once())->method('reset'); + $this->controller->execute(); + } + + public function testExecuteDoesNotResetCheckoutIfCustomerHasMoreThanOneAddress() + { + $customerId = 1; + $customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface'); + $customerMock->expects($this->any())->method('getId')->willReturn($customerId); + $this->checkoutMock->expects($this->any())->method('getCustomer')->willReturn($customerMock); + + $this->mockCustomerAddressRepository( + $customerId, + [ + $this->getMock('Magento\Customer\Api\Data\AddressInterface'), + $this->getMock('Magento\Customer\Api\Data\AddressInterface'), + ] + ); + + // check that checkout is not reset + $this->checkoutMock->expects($this->never())->method('reset'); + $this->controller->execute(); + } + + /** + * Mock customer address repository + * + * @param int $customerId + * @param array $addresses list of customer addresses + */ + private function mockCustomerAddressRepository($customerId, array $addresses) + { + $filterMock = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); + $this->filterBuilderMock->expects($this->once())->method('setField')->with('parent_id')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setValue')->with($customerId)->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('setConditionType')->with('eq')->willReturnSelf(); + $this->filterBuilderMock->expects($this->once())->method('create')->willReturn($filterMock); + + $searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteria', [], [], '', false); + $this->criteriaBuilderMock->expects($this->once())->method('addFilter')->with([$filterMock])->willReturnSelf(); + $this->criteriaBuilderMock->expects($this->once())->method('create')->willReturn($searchCriteriaMock); + + $searchResultMock = $this->getMock('Magento\Customer\Api\Data\AddressSearchResultsInterface'); + $this->addressRepositoryMock->expects($this->once()) + ->method('getList') + ->with($searchCriteriaMock) + ->willReturn($searchResultMock); + + $searchResultMock->expects($this->once())->method('getItems')->willReturn($addresses); + } +} diff --git a/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php b/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php index 44ec471bfedae..82f9a717dab7e 100644 --- a/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/PageCache/Model/ConfigTest.php @@ -31,8 +31,7 @@ public function setUp() $filesystemMock = $this->getMock('Magento\Framework\Filesystem', ['getDirectoryRead'], [], '', false); $this->_coreConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface'); - $this->_cacheState = - $this->getMock('\Magento\Framework\App\Cache\State', ['isEnabled'], [], '', false); + $this->_cacheState = $this->getMockForAbstractClass('Magento\Framework\App\Cache\StateInterface'); $modulesDirectoryMock = $this->getMock( 'Magento\Framework\Filesystem\Directory\Write', @@ -119,17 +118,15 @@ public function testGetTll() */ public function testIsEnabled() { - $this->_cacheState->setEnabled(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER, true); - - $this->_cacheState->expects( - $this->once() - )->method( - 'isEnabled' - )->with( - \Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER - )->will( - $this->returnValue(true) - ); - $this->_model->isEnabled(); + $this->_cacheState->expects($this->at(0)) + ->method('isEnabled') + ->with(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER) + ->will($this->returnValue(true)); + $this->_cacheState->expects($this->at(1)) + ->method('isEnabled') + ->with(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER) + ->will($this->returnValue(false)); + $this->assertTrue($this->_model->isEnabled()); + $this->assertFalse($this->_model->isEnabled()); } } diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php index ab8a17485a2bd..0dc9087bc7751 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/InfoTest.php @@ -223,7 +223,7 @@ public function importToPaymentDataProvider() Info::FRAUD_FILTERS => Info::PAYPAL_FRAUD_FILTERS, Info::CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, Info::AVS_CODE => Info::PAYPAL_AVS_CODE, - Info::CVV2_MATCH => Info::PAYPAL_CVV2_MATCH, + Info::CVV_2_MATCH => Info::PAYPAL_CVV_2_MATCH, Info::CENTINEL_VPAS => Info::CENTINEL_VPAS, Info::CENTINEL_ECI => Info::CENTINEL_ECI, Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, @@ -242,7 +242,7 @@ public function importToPaymentDataProvider() Info::PAYPAL_FRAUD_FILTERS => Info::PAYPAL_FRAUD_FILTERS, Info::PAYPAL_CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, Info::PAYPAL_AVS_CODE => Info::PAYPAL_AVS_CODE, - Info::PAYPAL_CVV2_MATCH => Info::PAYPAL_CVV2_MATCH, + Info::PAYPAL_CVV_2_MATCH => Info::PAYPAL_CVV_2_MATCH, Info::CENTINEL_VPAS => Info::CENTINEL_VPAS, Info::CENTINEL_ECI => Info::CENTINEL_ECI, Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php index c2a0b075a3bfe..2932fc78dee8a 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/_files/additional_info_data.php @@ -17,7 +17,7 @@ Info::PAYPAL_CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, Info::PAYPAL_AVS_CODE => 'A', - Info::PAYPAL_CVV2_MATCH => 'M', + Info::PAYPAL_CVV_2_MATCH => 'M', Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE_CNPJ, Info::CENTINEL_VPAS => '2', Info::CENTINEL_ECI => '01', @@ -59,7 +59,7 @@ 'label' => 'Address Verification System Response', 'value' => '#A: Matched Address only (no ZIP)', ], - Info::PAYPAL_CVV2_MATCH => [ + Info::PAYPAL_CVV_2_MATCH => [ 'label' => 'CVV2 Check Result by PayPal', 'value' => '#M: Matched (CVV2CSC)', ], @@ -97,7 +97,7 @@ Info::PAYPAL_CORRELATION_ID => Info::PAYPAL_CORRELATION_ID, Info::BUYER_TAX_ID => Info::BUYER_TAX_ID, Info::PAYPAL_AVS_CODE => Info::PAYPAL_AVS_CODE, - Info::PAYPAL_CVV2_MATCH => Info::PAYPAL_CVV2_MATCH, + Info::PAYPAL_CVV_2_MATCH => Info::PAYPAL_CVV_2_MATCH, Info::BUYER_TAX_ID_TYPE => Info::BUYER_TAX_ID_TYPE, Info::CENTINEL_VPAS => Info::CENTINEL_VPAS, Info::CENTINEL_ECI => Info::CENTINEL_ECI, @@ -139,9 +139,9 @@ 'label' => 'Address Verification System Response', 'value' => '#paypal_avs_code', ], - Info::PAYPAL_CVV2_MATCH => [ + Info::PAYPAL_CVV_2_MATCH => [ 'label' => 'CVV2 Check Result by PayPal', - 'value' => '#paypal_cvv2_match', + 'value' => '#paypal_cvv_2_match', ], Info::CENTINEL_VPAS => [ 'label' => 'PayPal/Centinel Visa Payer Authentication Service Result', diff --git a/dev/tests/unit/testsuite/Magento/Pci/Model/EncryptionTest.php b/dev/tests/unit/testsuite/Magento/Pci/Model/EncryptionTest.php deleted file mode 100644 index 3b967acde0bf3..0000000000000 --- a/dev/tests/unit/testsuite/Magento/Pci/Model/EncryptionTest.php +++ /dev/null @@ -1,48 +0,0 @@ -getMock('\Magento\Framework\App\DeploymentConfig', [], [], '', false); - $deploymentConfigMock->expects($this->any()) - ->method('get') - ->with(Encryption::PARAM_CRYPT_KEY) - ->will($this->returnValue($key)); - - // Encrypt data with known key - $objectManager = new ObjectManager($this); - /** - * @var \Magento\Pci\Model\Encryption - */ - $encryption = $objectManager->getObject( - 'Magento\Pci\Model\Encryption', - ['deploymentConfig' => $deploymentConfigMock] - ); - $actual = $encryption->encrypt($data); - - // Extract the initialization vector and encrypted data - $parts = explode(':', $actual, 4); - list(, , $iv, $encryptedData) = $parts; - - // Decrypt returned data with RIJNDAEL_256 cipher, cbc mode - $crypt = new Crypt($key, MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC, $iv); - // Verify decrypted matches original data - $this->assertEquals($data, $crypt->decrypt(base64_decode((string)$encryptedData))); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Pci/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Pci/Model/ObserverTest.php index 86bc05e157d80..649c92297f030 100644 --- a/dev/tests/unit/testsuite/Magento/Pci/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Pci/Model/ObserverTest.php @@ -7,7 +7,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Pci\Model\Encryption|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Encryption\Encryptor|\PHPUnit_Framework_MockObject_MockObject */ protected $encryptorMock; @@ -24,7 +24,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->encryptorMock = $this->getMockBuilder( - '\Magento\Pci\Model\Encryption' + '\Magento\Framework\Encryption\Encryptor' )->disableOriginalConstructor()->getMock(); $this->encryptorMock->expects($this->any())->method('validateHashByVersion')->will( $this->returnCallback( diff --git a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/ViewTest.php b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/ViewTest.php new file mode 100644 index 0000000000000..d2e8626481443 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/ViewTest.php @@ -0,0 +1,44 @@ +postHelper = $this->getMock( + 'Magento\Core\Helper\PostData', + [], + [], + '', + false + ); + $this->block = $objectManager->getObject( + 'Magento\ProductAlert\Block\Product\View', + ['coreHelper' => $this->postHelper] + ); + } + + public function testGetPostAction() + { + $this->block->setSignupUrl('someUrl'); + $this->postHelper->expects($this->once()) + ->method('getPostData') + ->with('someUrl') + ->will($this->returnValue('{parsedAction}')); + $this->assertEquals('{parsedAction}', $this->block->getPostAction()); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Reports/Model/Event/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Reports/Model/Event/ObserverTest.php new file mode 100644 index 0000000000000..941fb7843d459 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Reports/Model/Event/ObserverTest.php @@ -0,0 +1,222 @@ +customerSessionMock = $this->getMockBuilder('Magento\Customer\Model\Session') + ->disableOriginalConstructor()->getMock(); + $this->customerVisitorMock = $this->getMockBuilder('Magento\Customer\Model\Visitor') + ->disableOriginalConstructor()->getMock(); + + $productIndexFactoryMock = $this->getMockBuilder('Magento\Reports\Model\Product\Index\ViewedFactory') + ->setMethods(['create']) + ->disableOriginalConstructor()->getMock(); + $this->productIndexMock = $this->getMockBuilder('Magento\Reports\Model\Product\Index\Viewed') + ->disableOriginalConstructor()->getMock(); + + $productIndexFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->productIndexMock); + + $reportEventFactory = $this->getMockBuilder('Magento\Reports\Model\EventFactory') + ->setMethods(['create'])->disableOriginalConstructor()->getMock(); + $this->reportEventMock = $this->getMockBuilder('Magento\Reports\Model\Event') + ->disableOriginalConstructor()->getMock(); + + $reportEventFactory->expects($this->any()) + ->method('create') + ->willReturn($this->reportEventMock); + + /** @var \Magento\Store\Model\StoreManagerInterfac|\PHPUnit_Framework_MockObject_MockObject $storeManager */ + $storeManager = $this->getMock('Magento\Store\Model\StoreManagerInterface'); + + $this->storeMock = $this->getMockBuilder('\Magento\Store\Model\Store') + ->disableOriginalConstructor()->getMock(); + + $storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->storeMock); + + $this->observer = $objectManager->getObject( + 'Magento\Reports\Model\Event\Observer', + [ + 'customerSession' => $this->customerSessionMock, + 'customerVisitor' => $this->customerVisitorMock, + 'productIndxFactory' => $productIndexFactoryMock, + 'storeManager' => $storeManager, + 'event' => $reportEventFactory + ] + ); + } + + public function testCatalogProductViewCustomer() + { + $productId = 5; + $customerId = 77; + $storeId = 1; + $expectedViewedData = [ + 'product_id' => $productId, + 'customer_id' => $customerId + ]; + + $expectedEventData = [ + 'event_type_id' => \Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, + 'object_id' => $productId, + 'subject_id' => $customerId, + 'subtype' => 0, + 'store_id' => $storeId, + ]; + + $this->storeMock->expects($this->any()) + ->method('getId') + ->willReturn($storeId); + + $this->customerSessionMock->expects($this->any()) + ->method('isLoggedIn') + ->willReturn(true); + + $this->customerSessionMock->expects($this->any()) + ->method('getCustomerId') + ->willReturn($customerId); + + $this->prepareProductIndexMock($expectedViewedData); + $this->prepareReportEventModel($expectedEventData); + $eventObserver = $this->getObserverMock($productId); + $this->observer->catalogProductView($eventObserver); + } + + public function testCatalogProductViewVisitor() + { + $productId = 6; + $visitorId = 88; + $storeId = 1; + $expectedViewedData = [ + 'product_id' => $productId, + 'visitor_id' => $visitorId + ]; + + $expectedEventData = [ + 'event_type_id' => \Magento\Reports\Model\Event::EVENT_PRODUCT_VIEW, + 'object_id' => $productId, + 'subject_id' => $visitorId, + 'subtype' => 1, + 'store_id' => $storeId, + ]; + + $this->storeMock->expects($this->any()) + ->method('getId') + ->willReturn($storeId); + + $this->customerSessionMock->expects($this->any()) + ->method('isLoggedIn') + ->willReturn(false); + + $this->customerVisitorMock->expects($this->any()) + ->method('getId') + ->willReturn($visitorId); + + $this->prepareProductIndexMock($expectedViewedData); + $this->prepareReportEventModel($expectedEventData); + $eventObserver = $this->getObserverMock($productId); + $this->observer->catalogProductView($eventObserver); + } + + /** + * @param array $expectedViewedData + * @return void + */ + protected function prepareProductIndexMock($expectedViewedData) + { + $this->productIndexMock->expects($this->any()) + ->method('setData') + ->with($expectedViewedData) + ->willReturnSelf(); + + $this->productIndexMock->expects($this->any()) + ->method('save') + ->willReturnSelf(); + + $this->productIndexMock->expects($this->any()) + ->method('calculate') + ->willReturnSelf(); + } + + /** + * @param array $expectedEventData + * @return void + */ + protected function prepareReportEventModel($expectedEventData) + { + $this->reportEventMock->expects($this->any()) + ->method('setData') + ->with($expectedEventData) + ->willReturnSelf(); + + $this->reportEventMock->expects($this->any()) + ->method('save') + ->willReturnSelf(); + } + + /** + * @param int $productId + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function getObserverMock($productId) + { + $eventObserverMock = $this->getMockBuilder('Magento\Framework\Event\Observer')->disableOriginalConstructor() + ->getMock(); + $eventMock = $this->getMockBuilder('Magento\Framework\Event')->disableOriginalConstructor() + ->setMethods(['getProduct'])->getMock(); + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product')->disableOriginalConstructor() + ->getMock(); + + $productMock->expects($this->any()) + ->method('getId') + ->willReturn($productId); + $eventMock->expects($this->any()) + ->method('getProduct') + ->willReturn($productMock); + $eventObserverMock->expects($this->any()) + ->method('getEvent') + ->willReturn($eventMock); + + return $eventObserverMock; + } +} diff --git a/dev/tests/unit/testsuite/Magento/Rss/App/Action/Plugin/BackendAuthenticationTest.php b/dev/tests/unit/testsuite/Magento/Rss/App/Action/Plugin/BackendAuthenticationTest.php new file mode 100644 index 0000000000000..93d29e8173414 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Rss/App/Action/Plugin/BackendAuthenticationTest.php @@ -0,0 +1,74 @@ +getMock('Magento\Backend\App\AbstractAction', [], [], '', false); + + /** @var \Magento\Framework\App\ResponseInterface|\PHPUnit_Framework_MockObject_MockObject $response */ + $response = $this->getMock('Magento\Framework\App\ResponseInterface', [], [], '', false); + + $proceed = function () use ($response) { + return $response; + }; + + /** @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject $request */ + $request = $this->getMock('Magento\Framework\App\Request\Http', [], [], '', false); + $request->expects($this->atLeastOnce())->method('getControllerName')->will($this->returnValue('feed')); + $request->expects($this->atLeastOnce())->method('getActionName')->will($this->returnValue('index')); + $request->expects($this->once())->method('getParam')->with('type')->will($this->returnValue('notifystock')); + + /** @var \Magento\Backend\Model\Auth\StorageInterface|\PHPUnit_Framework_MockObject_MockObject $session */ + $session = $this->getMock('Magento\Backend\Model\Auth\StorageInterface', [], [], '', false); + $session->expects($this->at(0))->method('isLoggedIn')->will($this->returnValue(false)); + $session->expects($this->at(1))->method('isLoggedIn')->will($this->returnValue(true)); + + $username = 'admin'; + $password = '123123qa'; + $auth = $this->getMock('Magento\Backend\Model\Auth', [], [], '', false); + $auth->expects($this->once())->method('getAuthStorage')->will($this->returnValue($session)); + $auth->expects($this->once())->method('login')->with($username, $password); + + /** @var \Magento\Framework\HTTP\Authentication|\PHPUnit_Framework_MockObject_MockObject $httpAuthentication */ + $httpAuthentication = $this->getMock('Magento\Framework\HTTP\Authentication', [], [], '', false); + $httpAuthentication->expects($this->once())->method('getCredentials') + ->will($this->returnValue([$username, $password])); + $httpAuthentication->expects($this->once())->method('setAuthenticationFailed')->with('RSS Feeds'); + + $authorization = $this->getMock('Magento\Framework\AuthorizationInterface', [], [], '', false); + $authorization->expects($this->at(0))->method('isAllowed')->with('Magento_Rss::rss') + ->will($this->returnValue(true)); + $authorization->expects($this->at(1))->method('isAllowed')->with('Magento_Catalog::catalog_inventory') + ->will($this->returnValue(false)); + + $aclResources = [ + 'feed' => 'Magento_Rss::rss', + 'notifystock' => 'Magento_Catalog::catalog_inventory', + 'new_order' => 'Magento_Sales::actions_view', + 'review' => 'Magento_Reports::review_product' + ]; + + /** @var \Magento\Rss\App\Action\Plugin\BackendAuthentication $plugin */ + $plugin = (new \Magento\TestFramework\Helper\ObjectManager($this)) + ->getObject( + 'Magento\Rss\App\Action\Plugin\BackendAuthentication', + [ + 'auth' => $auth, + 'httpAuthentication' => $httpAuthentication, + 'response' => $response, + 'authorization' => $authorization, + 'aclResources' => $aclResources + ] + ); + $this->assertSame( + $response, + $plugin->aroundDispatch($subject, $proceed, $request) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php index 5dfe0f258c31a..7e746c92e6900 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/CreditmemoTest.php @@ -6,6 +6,8 @@ use Magento\Sales\Model\Resource\OrderFactory; use Magento\TestFramework\Helper\ObjectManager as ObjectManagerHelper; +use Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory; +use Magento\Sales\Model\Resource\Order\Creditmemo\Item\Collection as ItemCollection; /** * Class CreditmemoTest @@ -22,6 +24,11 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase */ protected $creditmemo; + /** + * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $cmItemCollectionFactoryMock; + public function setUp() { $this->orderFactory = $this->getMock( @@ -33,6 +40,12 @@ public function setUp() ); $objectManagerHelper = new ObjectManagerHelper($this); + $this->cmItemCollectionFactoryMock = $this->getMockBuilder( + '\Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory' + )->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $arguments = [ 'context' => $this->getMock('Magento\Framework\Model\Context', [], [], '', false), 'registry' => $this->getMock('Magento\Framework\Registry', [], [], '', false), @@ -40,13 +53,7 @@ public function setUp() 'dateTime' => $this->getMock('Magento\Framework\Stdlib\DateTime', [], [], '', false), 'creditmemoConfig' => $this->getMock('Magento\Sales\Model\Order\Creditmemo\Config', [], [], '', false), 'orderFactory' => $this->orderFactory, - 'cmItemCollectionFactory' => $this->getMock( - 'Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory', - [], - [], - '', - false - ), + 'cmItemCollectionFactory' => $this->cmItemCollectionFactoryMock, 'calculatorFactory' => $this->getMock('Magento\Framework\Math\CalculatorFactory', [], [], '', false), 'storeManager' => $this->getMock('Magento\Store\Model\StoreManagerInterface', [], [], '', false), 'commentFactory' => $this->getMock( @@ -128,4 +135,62 @@ public function testGetIncrementId() $this->creditmemo->setIncrementId('test_increment_id'); $this->assertEquals('test_increment_id', $this->creditmemo->getIncrementId()); } + + public function testGetItemsCollectionWithId() + { + $id = 1; + $this->creditmemo->setId($id); + + $items = []; + $itemMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Creditmemo\Item') + ->disableOriginalConstructor() + ->getMock(); + $itemMock->expects($this->once()) + ->method('setCreditmemo') + ->with($this->creditmemo); + $items[] = $itemMock; + + /** @var ItemCollection|\PHPUnit_Framework_MockObject_MockObject $itemCollectionMock */ + $itemCollectionMock = $this->getMockBuilder('\Magento\Sales\Model\Resource\Order\Creditmemo\Item\Collection') + ->disableOriginalConstructor() + ->getMock(); + $itemCollectionMock->expects($this->once()) + ->method('setCreditmemoFilter') + ->with($id) + ->will($this->returnValue($items)); + + $this->cmItemCollectionFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($itemCollectionMock)); + + $itemsCollection = $this->creditmemo->getItemsCollection(); + $this->assertEquals($items, $itemsCollection); + } + + public function testGetItemsCollectionWithoutId() + { + $items = []; + $itemMock = $this->getMockBuilder('\Magento\Sales\Model\Order\Creditmemo\Item') + ->disableOriginalConstructor() + ->getMock(); + $itemMock->expects($this->never()) + ->method('setCreditmemo'); + $items[] = $itemMock; + + /** @var ItemCollection|\PHPUnit_Framework_MockObject_MockObject $itemCollectionMock */ + $itemCollectionMock = $this->getMockBuilder('\Magento\Sales\Model\Resource\Order\Creditmemo\Item\Collection') + ->disableOriginalConstructor() + ->getMock(); + $itemCollectionMock->expects($this->once()) + ->method('setCreditmemoFilter') + ->with(null) + ->will($this->returnValue($items)); + + $this->cmItemCollectionFactoryMock->expects($this->any()) + ->method('create') + ->will($this->returnValue($itemCollectionMock)); + + $itemsCollection = $this->creditmemo->getItemsCollection(); + $this->assertEquals($items, $itemsCollection); + } } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php index 2548b7a342ed8..f99a191a3f16f 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/QuoteTest.php @@ -547,10 +547,6 @@ public function testSetCustomerAddressData() '', false ); - $customerMock->expects($this->any()) - ->method('getId') - ->will($this->returnValue($customerId)); - $this->customerRepositoryMock->expects($this->once()) ->method('getById') ->will($this->returnValue($customerMock)); diff --git a/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php b/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php index 976d7aaeaccf6..27915e5bd7a1e 100644 --- a/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php +++ b/dev/tests/unit/testsuite/Magento/Store/Model/StoreTest.php @@ -50,7 +50,7 @@ public function setUp() $this->cookieManagerMock = $this->getMock('Magento\Framework\Stdlib\CookieManagerInterface'); $this->cookieMetadataFactoryMock = $this->getMock( 'Magento\Framework\Stdlib\Cookie\CookieMetadataFactory', - [], + ['createPublicCookieMetadata'], [], '', false @@ -448,13 +448,9 @@ public function testGetAllowedCurrencies() public function testSetCookie() { $storeCode = 'store code'; - $cookieMetadata = $this->getMock( - 'Magento\Framework\Stdlib\Cookie\PublicCookieMetadata', - [], - [], - '', - false - ); + $cookieMetadata = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\PublicCookieMetadata') + ->disableOriginalConstructor() + ->getMock(); $cookieMetadata->expects($this->once()) ->method('setHttpOnly') ->with(true) @@ -462,6 +458,9 @@ public function testSetCookie() $cookieMetadata->expects($this->once()) ->method('setDurationOneYear') ->willReturnSelf(); + $cookieMetadata->expects($this->once()) + ->method('setPath') + ->willReturnSelf(); $this->cookieMetadataFactoryMock->expects($this->once()) ->method('createPublicCookieMetadata') ->will($this->returnValue($cookieMetadata)); @@ -496,9 +495,18 @@ public function testGetStoreCodeFromCookie() public function testDeleteCookie() { + $cookieMetadata = $this->getMockBuilder('Magento\Framework\Stdlib\Cookie\PublicCookieMetadata') + ->disableOriginalConstructor() + ->getMock(); + $this->cookieMetadataFactoryMock->expects($this->once()) + ->method('createPublicCookieMetadata') + ->will($this->returnValue($cookieMetadata)); + $cookieMetadata->expects($this->once()) + ->method('setPath') + ->willReturnSelf(); $this->cookieManagerMock->expects($this->once()) ->method('deleteCookie') - ->with(Store::COOKIE_NAME); + ->with(Store::COOKIE_NAME, $cookieMetadata); /** @var \Magento\Store\Model\Store $model */ $model = $this->objectManagerHelper->getObject( 'Magento\Store\Model\Store', diff --git a/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php index 02534b33c9d4f..01af7e215929c 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Helper/DataTest.php @@ -4,7 +4,8 @@ */ namespace Magento\Tax\Helper; -use Magento\Sales\Model\Quote\Address; +use Magento\Framework\Object as MagentoObject; +use Magento\TestFramework\Event\Magento; /** * Class DataTest @@ -32,6 +33,7 @@ public function setUp() $this->priceCurrencyMock = $this->getMockBuilder('Magento\Framework\Pricing\PriceCurrencyInterface') ->disableOriginalConstructor() ->getMock(); + $this->helper = $objectManager->getObject( 'Magento\Tax\Helper\Data', [ @@ -114,52 +116,79 @@ public function testGetCalculatedTaxesForOrder() $this->assertEquals($itemPercent, $result[0]['percent']); } - public function testGetCalculatedTaxesForOrderItems() + /** + * Creat OrderTaxDetails mock from array of data + * + * @param $inputArray + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Tax\Api\Data\OrderTaxDetailsInterface + */ + protected function mapOrderTaxItemDetail($inputArray) { - $orderId = 1; - $itemShippingTaxAmount = 1; - $orderShippingTaxAmount = 1; - $itemCode = 'test_code'; - $itemAmount = 1; - $itemBaseAmount = 2; - $itemTitle = 'Test title'; - $itemPercent = 0.1; - $failedTaxAmount = "0.00000"; - - $expectedAmount = 2; - $expectedBaseAmount = 4; - - $orderDetailsItemNormal = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') - ->disableOriginalConstructor() + $orderTaxItemDetailsMock = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsInterface') ->getMock(); - $orderDetailsItemNormal->expects($this->once()) - ->method('getCode') - ->willReturn($itemCode); - $orderDetailsItemNormal->expects($this->once()) - ->method('getAmount') - ->willReturn($itemAmount); - $orderDetailsItemNormal->expects($this->once()) - ->method('getBaseAmount') - ->willReturn($itemBaseAmount); - $orderDetailsItemNormal->expects($this->once()) - ->method('getTitle') - ->willReturn($itemTitle); - $orderDetailsItemNormal->expects($this->once()) - ->method('getPercent') - ->willReturn($itemPercent); + $itemMocks = []; + foreach ($inputArray['items'] as $orderTaxDetailsItemData) { + $itemId = isset($orderTaxDetailsItemData['item_id']) ? $orderTaxDetailsItemData['item_id'] : null; + $associatedItemId = isset($orderTaxDetailsItemData['associated_item_id']) + ? $orderTaxDetailsItemData['associated_item_id'] + : null; + $itemType = isset($orderTaxDetailsItemData['type']) ? $orderTaxDetailsItemData['type'] : null; + $appliedTaxesData = $orderTaxDetailsItemData['applied_taxes']; + $appliedTaxesMocks = []; + foreach ($appliedTaxesData as $appliedTaxData) { + $appliedTaxesMock = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') + ->getMock(); + $appliedTaxesMock->expects($this->any()) + ->method('getAmount') + ->will($this->returnValue($appliedTaxData['amount'])); + $appliedTaxesMock->expects($this->any()) + ->method('getBaseAmount') + ->will($this->returnValue($appliedTaxData['base_amount'])); + $appliedTaxesMock->expects($this->any()) + ->method('getCode') + ->will($this->returnValue($appliedTaxData['code'])); + $appliedTaxesMock->expects($this->any()) + ->method('getTitle') + ->will($this->returnValue($appliedTaxData['title'])); + $appliedTaxesMock->expects($this->any()) + ->method('getPercent') + ->will($this->returnValue($appliedTaxData['percent'])); + $appliedTaxesMocks[] = $appliedTaxesMock; + } + $orderTaxDetailsItemMock = $this->getMockBuilder('\Magento\Tax\Api\Data\OrderTaxDetailsItemInterface') + ->getMock(); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getItemId') + ->will($this->returnValue($itemId)); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getAssociatedItemId') + ->will($this->returnValue($associatedItemId)); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getType') + ->will($this->returnValue($itemType)); + $orderTaxDetailsItemMock->expects($this->any()) + ->method('getAppliedTaxes') + ->will($this->returnValue($appliedTaxesMocks)); - $orderDetailsItemZeroAmount = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsAppliedTaxInterface') - ->disableOriginalConstructor() - ->getMock(); - $orderDetailsItemZeroAmount->expects($this->once()) - ->method('getAmount') - ->willReturn(0); - $orderDetailsItemZeroAmount->expects($this->once()) - ->method('getBaseAmount') - ->willReturn(0); + $itemMocks[] = $orderTaxDetailsItemMock; + } + $orderTaxItemDetailsMock->expects($this->any()) + ->method('getItems') + ->will($this->returnValue($itemMocks)); - $appliedTaxes = [$orderDetailsItemNormal, $orderDetailsItemZeroAmount]; + return $orderTaxItemDetailsMock; + } + /** + * @dataProvider getCalculatedTaxesForOrderItemsDataProvider + */ + public function testGetCalculatedTaxesForOrderItems($orderData, $invoiceData, $expectedResults) + { + $orderId = $orderData['order_id']; + $orderShippingTaxAmount = isset($orderData['shipping_tax_amount']) ? $orderData['shipping_tax_amount'] : 0; + $orderTaxDetails = $orderData['order_tax_details']; + + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order $orderMock */ $orderMock = $this->getMockBuilder('Magento\Sales\Model\Order') ->disableOriginalConstructor() ->getMock(); @@ -170,46 +199,17 @@ public function testGetCalculatedTaxesForOrderItems() ->method('getShippingTaxAmount') ->willReturn($orderShippingTaxAmount); - $taxDetailsData = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsItemInterface') - ->disableOriginalConstructor() - ->getMock(); - $taxDetailsData->expects($this->once()) - ->method('getType') - ->willReturn(Address::TYPE_SHIPPING); - $taxDetailsData->expects($this->once()) - ->method('getAppliedTaxes') - ->willReturn($appliedTaxes); - - $orderDetails = $this->getMockBuilder('Magento\Tax\Api\Data\OrderTaxDetailsInterface') - ->disableOriginalConstructor() - ->getMock(); - $orderDetails->expects($this->once()) - ->method('getItems') - ->willReturn([$taxDetailsData]); - - $this->orderTaxManagementMock->expects($this->once()) + $orderTaxDetailsMock = $this->mapOrderTaxItemDetail($orderTaxDetails); + $this->orderTaxManagementMock->expects($this->any()) ->method('getOrderTaxDetails') ->with($orderId) - ->willReturn($orderDetails); + ->will($this->returnValue($orderTaxDetailsMock)); - $orderItemMock = $this->getMockBuilder('Magento\Sales\Model\Order\Item') - ->disableOriginalConstructor() - ->getMock(); - $orderItemMock->expects($this->once()) - ->method('getTaxAmount') - ->willReturn($failedTaxAmount); - - $invoiceItemFailed = $this->getMockBuilder('Magento\Sales\Model\Order\Invoice\Item') - ->disableOriginalConstructor() - ->getMock(); - $invoiceItemFailed->expects($this->once()) - ->method('getOrderItem') - ->willReturn($orderItemMock); - $invoiceItemFailed->expects($this->once()) - ->method('getTaxAmount') - ->willReturn(1); - - $source = $this->getMockBuilder('Magento\Sales\Model\Order\Creditmemo') + $invoiceShippingTaxAmount = + isset($invoiceData['shipping_tax_amount']) ? $invoiceData['shipping_tax_amount'] : 0; + $invoiceItems = $invoiceData['invoice_items']; + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Sales\Model\Order\Invoice $source */ + $source = $this->getMockBuilder('Magento\Sales\Model\Order\Invoice') ->disableOriginalConstructor() ->getMock(); $source->expects($this->once()) @@ -217,24 +217,156 @@ public function testGetCalculatedTaxesForOrderItems() ->willReturn($orderMock); $source->expects($this->once()) ->method('getShippingTaxAmount') - ->willReturn($itemShippingTaxAmount); + ->willReturn($invoiceShippingTaxAmount); $source->expects($this->once()) - ->method('getItemsCollection') - ->willReturn([$invoiceItemFailed]); + ->method('getItems') + ->willReturn($invoiceItems); - $roundValues = [ - [$itemAmount, $expectedAmount], - [$itemBaseAmount, $expectedBaseAmount], - ]; - $this->priceCurrencyMock->expects($this->exactly(2)) + $this->priceCurrencyMock->expects($this->any()) ->method('round') - ->will($this->returnValueMap($roundValues)); + ->will($this->returnCallback( + function ($arg) { + return round($arg, 2); + } + ) + ); $result = $this->helper->getCalculatedTaxes($source); - $this->assertCount(1, $result); - $this->assertEquals($expectedAmount, $result[0]['tax_amount']); - $this->assertEquals($expectedBaseAmount, $result[0]['base_tax_amount']); - $this->assertEquals($itemTitle, $result[0]['title']); - $this->assertEquals($itemPercent, $result[0]['percent']); + foreach ($result as $index => $appliedTax) { + $expectedTax = $expectedResults[$index]; + foreach ($appliedTax as $attr => $value) { + $this->assertEquals($expectedTax[$attr], $value, "The ".$attr." of tax does not match"); + } + } + } + + /** + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) + * @return array + */ + public function getCalculatedTaxesForOrderItemsDataProvider() + { + $data = [ + //Scenario 1: two items, one item with 0 tax + 'two_items_with_one_zero_tax' => [ + 'order' => [ + 'order_id' => 1, + 'shipping_tax_amount' => 0, + 'order_tax_details' => [ + 'items' => [ + 'itemTax1' => [ + 'item_id' => 1, + 'applied_taxes' => [ + [ + 'amount' => 5.0, + 'base_amount' => 5.0, + 'code' => 'US-CA', + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + ], + ], + ], + ], + ], + ], + 'invoice' => [ + 'invoice_items' => [ + 'item1' => new MagentoObject( + [ + 'order_item' => new MagentoObject( + [ + 'id' => 1, + 'tax_amount' => 5.00, + ] + ), + 'tax_amount' => 2.50, + ] + ), + 'item2' => new MagentoObject( + [ + 'order_item' => new MagentoObject( + [ + 'id' => 2, + 'tax_amount' => 0.0, + ] + ), + 'tax_amount' => 0.0, + ] + ), + ], + ], + 'expected_results' => [ + [ + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + 'tax_amount' => 2.5, + 'base_tax_amount' => 2.5, + ], + ], + ], + //Scenario 2: one item with associated weee tax + 'item_with_weee_tax_partial_invoice' => [ + 'order' => [ + 'order_id' => 1, + 'shipping_tax_amount' => 0, + 'order_tax_details' => [ + 'items' => [ + 'itemTax1' => [ + 'item_id' => 1, + 'applied_taxes' => [ + [ + 'amount' => 5.0, + 'base_amount' => 5.0, + 'code' => 'US-CA', + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + ], + ], + ], + 'weeeTax1' => [ + 'associated_item_id' => 1, + 'type' => 'weee', + 'applied_taxes' => [ + [ + 'amount' => 3.0, + 'base_amount' => 3.0, + 'code' => 'US-CA', + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + ], + ], + ], + ], + ], + ], + 'invoice' => [ + 'invoice_items' => [ + 'item1' => new MagentoObject( + [ + 'order_item' => new MagentoObject( + [ + 'id' => 1, + 'tax_amount' => 5.00, + ] + ), + 'tax_amount' => 5.0, + //half of weee tax is invoiced + 'tax_ratio' => serialize(['weee' => 0.5]), + ] + ), + ], + ], + 'expected_results' => [ + [ + 'title' => 'US-CA-Sales-Tax', + 'percent' => 20.0, + 'tax_amount' => 6.5, + 'base_tax_amount' => 6.5, + ], + ], + ], + ]; + + return $data; } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php index 47184c9f5b20d..387a864c25de2 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/Calculation/RateRepositoryTest.php @@ -5,6 +5,8 @@ namespace Magento\Tax\Model\Calculation; use Magento\TestFramework\Helper\ObjectManager; +use Magento\Framework\Model\Exception as ModelException; +use Magento\Framework\Api\SearchCriteria; class RateRepositoryTest extends \PHPUnit_Framework_TestCase { @@ -272,4 +274,166 @@ private function getTaxRateMock(array $taxRateData) return $taxRateMock; } + + /** + * @param ModelException $expectedException + * @param string $exceptionType + * @param string $exceptionMessage + * @throws ModelException + * @throws \Exception + * @throws \Magento\Framework\Exception\InputException + * @dataProvider saveThrowsExceptionIfCannotSaveTitlesDataProvider + */ + public function testSaveThrowsExceptionIfCannotSaveTitles($expectedException, $exceptionType, $exceptionMessage) + { + $countryCode = 'US'; + $countryMock = $this->getMock('Magento\Directory\Model\Country', [], [], '', false); + $countryMock->expects($this->any())->method('getId')->will($this->returnValue(1)); + $countryMock->expects($this->any())->method('loadByCode')->with($countryCode)->will($this->returnSelf()); + $this->countryFactoryMock->expects($this->once())->method('create')->will($this->returnValue($countryMock)); + + $regionId = 2; + $regionMock = $this->getMock('Magento\Directory\Model\Region', [], [], '', false); + $regionMock->expects($this->any())->method('getId')->will($this->returnValue($regionId)); + $regionMock->expects($this->any())->method('load')->with($regionId)->will($this->returnSelf()); + $this->regionFactoryMock->expects($this->once())->method('create')->will($this->returnValue($regionMock)); + + $rateTitles = ['Label 1', 'Label 2']; + $rateMock = $this->getTaxRateMock( + [ + 'id' => null, + 'tax_country_id' => $countryCode, + 'tax_region_id' => $regionId, + 'region_name' => null, + 'tax_postcode' => null, + 'zip_is_range' => true, + 'zip_from' => 90000, + 'zip_to' => 90005, + 'rate' => 7.5, + 'code' => 'Tax Rate Code', + 'titles' => $rateTitles, + ] + ); + $this->rateConverterMock->expects($this->once())->method('createTitleArrayFromServiceObject') + ->with($rateMock)->will($this->returnValue($rateTitles)); + $this->rateResourceMock->expects($this->once())->method('save')->with($rateMock); + $rateMock + ->expects($this->once()) + ->method('saveTitles') + ->with($rateTitles) + ->willThrowException($expectedException); + $this->rateRegistryMock->expects($this->never())->method('registerTaxRate')->with($rateMock); + $this->setExpectedException($exceptionType, $exceptionMessage); + $this->model->save($rateMock); + } + + public function saveThrowsExceptionIfCannotSaveTitlesDataProvider() + { + return [ + 'entity_already_exists' => [ + new ModelException( + 'Cannot save titles', + ModelException::ERROR_CODE_ENTITY_ALREADY_EXISTS + ), + 'Magento\Framework\Exception\InputException', + 'Cannot save titles' + ], + 'cannot_save_title' => [ + new ModelException( + 'Cannot save titles' + ), + 'Magento\Framework\Model\Exception', + 'Cannot save titles' + ] + ]; + } + + public function testGetListWhenFilterGroupExists() + { + $searchCriteriaMock = $this->getMock('Magento\Framework\Api\SearchCriteriaInterface'); + $filterGroupMock = $this->getMock('Magento\Framework\Api\Search\FilterGroup', [], [], '', false); + $searchCriteriaMock + ->expects($this->any()) + ->method('getFilterGroups') + ->will($this->returnValue([$filterGroupMock])); + $filterMock = $this->getMock('Magento\Framework\Api\Filter', [], [], '', false); + $filterGroupMock->expects($this->once())->method('getFilters')->willReturn([$filterMock]); + $filterMock->expects($this->exactly(2))->method('getConditionType')->willReturn('like'); + $filterMock->expects($this->once())->method('getField')->willReturn('region_name'); + $filterMock->expects($this->once())->method('getValue')->willReturn('condition_value'); + $objectManager = new ObjectManager($this); + $rateMock = $this->getTaxRateMock([]); + $items = [$rateMock]; + $collectionMock = $objectManager->getCollectionMock( + 'Magento\Tax\Model\Resource\Calculation\Rate\Collection', + $items + ); + $collectionMock + ->expects($this->once()) + ->method('addFieldToFilter') + ->with(['region_table.code'], [['like' => 'condition_value']]); + $sortOrderMock = $this->getMock('Magento\Framework\Api\SortOrder', [], [], '', false); + $searchCriteriaMock + ->expects($this->any()) + ->method('getSortOrders') + ->will($this->returnValue([$sortOrderMock])); + $sortOrderMock->expects($this->once())->method('getField')->willReturn('field_name'); + $sortOrderMock->expects($this->once())->method('getDirection')->willReturn(SearchCriteria::SORT_ASC); + $collectionMock->expects($this->once())->method('addOrder')->with('main_table.field_name', 'ASC'); + $currentPage = 1; + $pageSize = 100; + $searchCriteriaMock->expects($this->any())->method('getCurrentPage')->will($this->returnValue($currentPage)); + $searchCriteriaMock->expects($this->any())->method('getPageSize')->will($this->returnValue($pageSize)); + $rateMock = $this->getTaxRateMock([]); + + + $collectionMock->expects($this->once())->method('joinRegionTable'); + $collectionMock->expects($this->once())->method('setCurPage')->with($currentPage); + $collectionMock->expects($this->once())->method('setPageSize')->with($pageSize); + $collectionMock->expects($this->once())->method('getSize')->will($this->returnValue(count($items))); + + $this->rateFactoryMock->expects($this->once())->method('create')->will($this->returnValue($rateMock)); + $rateMock->expects($this->any())->method('getCollection')->will($this->returnValue($collectionMock)); + + + + $this->searchResultBuilder->expects($this->once())->method('setItems')->with($items)->willReturnSelf(); + $this->searchResultBuilder->expects($this->once())->method('setTotalCount')->with(count($items)) + ->willReturnSelf(); + $this->searchResultBuilder->expects($this->once())->method('setSearchCriteria')->with($searchCriteriaMock) + ->willReturnSelf(); + $this->searchResultBuilder->expects($this->once())->method('create'); + + $this->model->getList($searchCriteriaMock); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage One or more input exceptions have occurred. + */ + public function testValidate() + { + $regionId = 2; + $rateTitles = ['Label 1', 'Label 2']; + $regionMock = $this->getMock('Magento\Directory\Model\Region', [], [], '', false); + $regionMock->expects($this->any())->method('getId')->will($this->returnValue('')); + $regionMock->expects($this->any())->method('load')->with($regionId)->will($this->returnSelf()); + $this->regionFactoryMock->expects($this->once())->method('create')->will($this->returnValue($regionMock)); + $rateMock = $this->getTaxRateMock( + [ + 'id' => null, + 'tax_country_id' => '', + 'tax_region_id' => $regionId, + 'region_name' => null, + 'tax_postcode' => null, + 'zip_is_range' => true, + 'zip_from' => -90000, + 'zip_to' => '', + 'rate' => '', + 'code' => '', + 'titles' => $rateTitles, + ] + ); + $this->model->save($rateMock); + } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php index b62310f41491b..493fed9d93a83 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/RepositoryTest.php @@ -6,6 +6,8 @@ namespace Magento\Tax\Model\TaxClass; use Magento\Framework\Exception\CouldNotDeleteException; +use Magento\Framework\Model\Exception as ModelException; +use Magento\Framework\Api\SearchCriteria; class RepositoryTest extends \PHPUnit_Framework_TestCase { @@ -125,7 +127,7 @@ public function testGet() $this->assertEquals($taxClass, $this->model->get($classId)); } - + public function testDeleteById() { $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); @@ -148,15 +150,26 @@ public function testGetList() $taxClassOne = $this->getMock('\Magento\Tax\Api\Data\TaxClassInterface'); $taxClassTwo = $this->getMock('\Magento\Tax\Api\Data\TaxClassInterface'); $searchCriteria = $this->getMock('\Magento\Framework\Api\SearchCriteriaInterface'); - $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([]); + $filterGroup = $this->getMock('\Magento\Framework\Api\Search\FilterGroup', [], [], '', false); + $filter = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $collection = $this->getMock('\Magento\Tax\Model\Resource\TaxClass\Collection', [], [], '', false); + $sortOrder = $this->getMock('\Magento\Framework\Api\SortOrder', [], [], '', false); + + $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroup]); + $filterGroup->expects($this->once())->method('getFilters')->willReturn([$filter]); + $filter->expects($this->atLeastOnce())->method('getConditionType')->willReturn('eq'); + $filter->expects($this->once())->method('getField')->willReturn('field'); + $filter->expects($this->once())->method('getValue')->willReturn('value'); + $collection->expects($this->once())->method('addFieldToFilter')->with(['field'], [['eq' => 'value']]); + + $searchCriteria->expects($this->exactly(2))->method('getSortOrders')->willReturn([$sortOrder]); + $sortOrder->expects($this->once())->method('getField')->willReturn('field'); + $sortOrder->expects($this->once())->method('getDirection')->willReturn(SearchCriteria::SORT_ASC); + $collection->expects($this->once())->method('addOrder')->with('field', 'ASC'); $searchCriteria->expects($this->once())->method('getPageSize')->willReturn(20); $searchCriteria->expects($this->once())->method('getCurrentPage')->willReturn(0); $result = $this->getMock('\Magento\Tax\Api\Data\TaxRateSearchResultsInterface'); - $collection = $this->objectManager->getCollectionMock( - '\Magento\Tax\Model\Resource\TaxClass\Collection', - [$taxClassOne, $taxClassTwo] - ); $collection->expects($this->any())->method('getSize')->willReturn(2); $collection->expects($this->any())->method('setItems')->with([$taxClassOne, $taxClassTwo]); $collection->expects($this->once())->method('setCurPage')->with(0); @@ -190,4 +203,100 @@ public function testSave() $this->taxClassResourceMock->expects($this->once())->method('save')->with($taxClass); $this->assertEquals(10, $this->model->save($taxClass)); } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage Updating classType is not allowed. + */ + public function testSaveWithInputException() + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originalTax = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->exactly(2))->method('getClassId')->willReturn(10); + $this->classModelRegistryMock->expects($this->once())->method('retrieve')->with(10)->willReturn($originalTax); + $originalTax->expects($this->once())->method('getClassType')->willReturn('PRODUCT'); + $taxClass->expects($this->once())->method('getClassType')->willReturn('PRODUCT2'); + $this->model->save($taxClass); + } + + /** + * @expectedException \Magento\Framework\Model\Exception + * @expectedExceptionMessage Something went wrong + */ + public function testSaveWithModelException() + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->any())->method('getClassName')->willReturn('Class Name'); + $taxClass->expects($this->atLeastOnce())->method('getClassType')->willReturn('PRODUCT'); + $taxClass->expects($this->any())->method('getClassId')->willReturn(10); + + $originTaxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originTaxClass->expects($this->once())->method('getClassType')->willReturn('PRODUCT'); + + $this->classModelRegistryMock + ->expects($this->once()) + ->method('retrieve') + ->with(10) + ->willReturn($originTaxClass); + + $this->taxClassResourceMock->expects($this->once())->method('save')->with($taxClass) + ->willThrowException(new ModelException("Something went wrong")); + $this->model->save($taxClass); + } + + /** + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage A class with the same name already exists for ClassType PRODUCT. + */ + public function testSaveWithSameClassException() + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->any())->method('getClassName')->willReturn('Class Name'); + $taxClass->expects($this->atLeastOnce())->method('getClassType')->willReturn('PRODUCT'); + $taxClass->expects($this->any())->method('getClassId')->willReturn(10); + + $originTaxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originTaxClass->expects($this->once())->method('getClassType')->willReturn('PRODUCT'); + + $this->classModelRegistryMock + ->expects($this->once()) + ->method('retrieve') + ->with(10) + ->willReturn($originTaxClass); + + $this->taxClassResourceMock->expects($this->once())->method('save')->with($taxClass) + ->willThrowException(new ModelException(\Magento\Tax\Model\Resource\TaxClass::UNIQUE_TAX_CLASS_MSG)); + $this->model->save($taxClass); + } + + /** + * @dataProvider validateTaxClassDataProvider + * @expectedException \Magento\Framework\Exception\InputException + * @expectedExceptionMessage One or more input exceptions have occurred. + */ + public function testSaveWithValidateTaxClassDataException($classType) + { + $taxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $taxClass->expects($this->any())->method('getClassName')->willReturn(''); + $taxClass->expects($this->atLeastOnce())->method('getClassType')->willReturn($classType); + $taxClass->expects($this->any())->method('getClassId')->willReturn(10); + + $originTaxClass = $this->getMock('\Magento\Tax\Model\ClassModel', [], [], '', false); + $originTaxClass->expects($this->once())->method('getClassType')->willReturn($classType); + + $this->classModelRegistryMock + ->expects($this->once()) + ->method('retrieve') + ->with(10) + ->willReturn($originTaxClass); + $this->model->save($taxClass); + } + + public function validateTaxClassDataProvider() + { + return [ + [''], + ['ERROR'] + ]; + } } diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php new file mode 100644 index 0000000000000..5d1ecef858b10 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateCollectionTest.php @@ -0,0 +1,169 @@ +entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->searchCriteriaBuilderMock = + $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->sortOrderBuilderMock = $this->getMock('Magento\Framework\Api\SortOrderBuilder', [], [], '', false); + $this->rateServiceMock = $this->getMock( + 'Magento\Tax\Api\TaxRateRepositoryInterface', + [ + 'save', + 'get', + 'deleteById', + 'getList', + 'delete', + '__wakeup' + ], + [], + '', + false + ); + $this->rateConverterMock = $this->getMock( + 'Magento\Tax\Model\Calculation\Rate\Converter', + [], + [], + '', + false + ); + $this->searchCriteriaMock = $this->getMock( + 'Magento\Framework\Api\SearchCriteriaInterface', + [], + [], + '', + false + ); + $this->searchResultsMock = $this->getMock( + 'Magento\Tax\Api\Data\TaxRateSearchResultsInterface', + [], + [], + '', + false + ); + $this->taxRateMock = $this->getMock('Magento\Tax\Model\Calculation\Rate', [], [], '', false); + + $this->searchCriteriaBuilderMock->expects($this->any()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + + $this->model = new TaxRateCollection( + $this->entityFactoryMock, + $this->filterBuilderMock, + $this->searchCriteriaBuilderMock, + $this->sortOrderBuilderMock, + $this->rateServiceMock, + $this->rateConverterMock + ); + } + + public function testLoadData() + { + $this->rateServiceMock->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($this->searchResultsMock); + + $this->searchResultsMock->expects($this->once())->method('getTotalCount')->willReturn(123); + + $this->searchResultsMock->expects($this->once())->method('getItems')->willReturn([$this->taxRateMock]); + $this->taxRateMock->expects($this->once())->method('getId')->willReturn(33); + $this->taxRateMock->expects($this->once())->method('getCode')->willReturn(44); + $this->taxRateMock->expects($this->once())->method('getTaxCountryId')->willReturn('CountryId'); + $this->taxRateMock->expects($this->once())->method('getTaxRegionId')->willReturn(55); + $this->taxRateMock->expects($this->once())->method('getRegionName')->willReturn('Region Name'); + $this->taxRateMock->expects($this->once())->method('getTaxPostcode')->willReturn('Post Code'); + $this->taxRateMock->expects($this->once())->method('getRate')->willReturn(1.85); + $this->rateConverterMock->expects($this->once()) + ->method('createTitleArrayFromServiceObject') + ->with($this->taxRateMock) + ->willReturn([]); + $this->taxRateMock->expects($this->once())->method('getZipTo')->willReturn(null); + $this->taxRateMock->expects($this->never())->method('getZipFrom'); + + $this->model->loadData(); + } + + public function testCreateTaxRateCollectionItem() + { + $this->rateServiceMock->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($this->searchResultsMock); + + $this->searchResultsMock->expects($this->once())->method('getTotalCount')->willReturn(123); + $this->searchResultsMock->expects($this->once())->method('getItems')->willReturn([$this->taxRateMock]); + $this->taxRateMock->expects($this->once())->method('getId')->willReturn(33); + $this->taxRateMock->expects($this->once())->method('getCode')->willReturn(44); + $this->taxRateMock->expects($this->once())->method('getTaxCountryId')->willReturn('CountryId'); + $this->taxRateMock->expects($this->once())->method('getTaxRegionId')->willReturn(55); + $this->taxRateMock->expects($this->once())->method('getRegionName')->willReturn('Region Name'); + $this->taxRateMock->expects($this->once())->method('getTaxPostcode')->willReturn('Post Code'); + $this->taxRateMock->expects($this->once())->method('getRate')->willReturn(1.85); + $this->rateConverterMock->expects($this->once()) + ->method('createTitleArrayFromServiceObject') + ->with($this->taxRateMock) + ->willReturn([]); + $this->taxRateMock->expects($this->exactly(2))->method('getZipTo')->willReturn(1); + $this->taxRateMock->expects($this->exactly(2))->method('getZipFrom')->willReturn(200); + + $this->model->loadData(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateManagementTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateManagementTest.php new file mode 100644 index 0000000000000..5d573a75d72ce --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRateManagementTest.php @@ -0,0 +1,94 @@ +filterBuilderMock = $this->getMock('\Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->taxRuleRepositoryMock = $this->getMock('\Magento\Tax\Api\TaxRuleRepositoryInterface', [], [], '', false); + $this->taxRateRepositoryMock = $this->getMock('\Magento\Tax\Api\TaxRateRepositoryInterface', [], [], '', false); + $this->searchCriteriaBuilderMock = $this->getMock( + '\Magento\Framework\Api\SearchCriteriaBuilder', + [], + [], + '', + false + ); + $this->model = new \Magento\Tax\Model\TaxRateManagement( + $this->taxRuleRepositoryMock, + $this->taxRateRepositoryMock, + $this->filterBuilderMock, + $this->searchCriteriaBuilderMock + ); + } + + public function testGetRatesByCustomerAndProductTaxClassId() + { + $customerTaxClassId = 4; + $productTaxClassId = 42; + $rateIds = [10]; + $productFilterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $customerFilterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); + $searchResultsMock = $this->getMock('\Magento\Tax\Api\Data\TaxRuleSearchResultsInterface', [], [], '', false); + $taxRuleMock = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface', [], [], '', false); + $taxRateMock = $this->getMock('\Magento\Tax\Api\Data\TaxRateInterface', [], [], '', false); + + $this->filterBuilderMock->expects($this->exactly(2))->method('setField')->withConsecutive( + ['customer_tax_class_ids'], + ['product_tax_class_ids'] + )->willReturnSelf(); + $this->filterBuilderMock->expects($this->exactly(2))->method('setValue')->withConsecutive( + [$this->equalTo([$customerTaxClassId])], + [$this->equalTo([$productTaxClassId])] + )->willReturnSelf(); + $this->filterBuilderMock->expects($this->exactly(2))->method('create')->willReturnOnConsecutiveCalls( + $customerFilterMock, + $productFilterMock + ); + $this->searchCriteriaBuilderMock->expects($this->exactly(2))->method('addFilter')->withConsecutive( + [[$customerFilterMock]], + [[$productFilterMock]] + ); + $this->searchCriteriaBuilderMock->expects($this->once())->method('create')->willReturn($searchCriteriaMock); + $this->taxRuleRepositoryMock->expects($this->once())->method('getList')->with($searchCriteriaMock) + ->willReturn($searchResultsMock); + $searchResultsMock->expects($this->once())->method('getItems')->willReturn([$taxRuleMock]); + $taxRuleMock->expects($this->once())->method('getTaxRateIds')->willReturn($rateIds); + $this->taxRateRepositoryMock->expects($this->once())->method('get')->with($rateIds[0]) + ->willReturn($taxRateMock); + $this->assertEquals( + [$taxRateMock], + $this->model->getRatesByCustomerAndProductTaxClassId($customerTaxClassId, $productTaxClassId) + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleCollectionTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleCollectionTest.php new file mode 100644 index 0000000000000..4dbdc586e4cfa --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleCollectionTest.php @@ -0,0 +1,111 @@ +entityFactoryMock = $this->getMock('Magento\Core\Model\EntityFactory', [], [], '', false); + $this->filterBuilderMock = $this->getMock('Magento\Framework\Api\FilterBuilder', [], [], '', false); + $this->searchCriteriaBuilderMock = + $this->getMock('Magento\Framework\Api\SearchCriteriaBuilder', [], [], '', false); + $this->sortOrderBuilderMock = $this->getMock('Magento\Framework\Api\SortOrderBuilder', [], [], '', false); + $this->ruleServiceMock = $this->getMock('Magento\Tax\Api\TaxRuleRepositoryInterface', [], [], '', false); + $this->searchCriteriaMock = $this->getMock( + 'Magento\Framework\Api\SearchCriteria', + [], + [], + '', + false + ); + $this->searchResultsMock = $this->getMock( + 'Magento\Tax\Api\Data\TaxRateSearchResultsInterface', + [], + [], + '', + false + ); + + $this->taxRuleMock = $this->getMock('Magento\Tax\Model\Calculation\Rule', [], [], '', false); + $this->searchCriteriaBuilderMock->expects($this->any()) + ->method('create') + ->willReturn($this->searchCriteriaMock); + + $this->model = new TaxRuleCollection( + $this->entityFactoryMock, + $this->filterBuilderMock, + $this->searchCriteriaBuilderMock, + $this->sortOrderBuilderMock, + $this->ruleServiceMock + ); + } + + public function testLoadData() + { + $this->ruleServiceMock->expects($this->once()) + ->method('getList') + ->with($this->searchCriteriaMock) + ->willReturn($this->searchResultsMock); + + $this->searchResultsMock->expects($this->once())->method('getTotalCount')->willReturn(568); + $this->searchResultsMock->expects($this->once())->method('getItems')->willReturn([$this->taxRuleMock]); + $this->taxRuleMock->expects($this->once())->method('getId')->willReturn(33); + $this->taxRuleMock->expects($this->once())->method('getCode')->willReturn(44); + $this->taxRuleMock->expects($this->once())->method('getPriority')->willReturn('some priority'); + $this->taxRuleMock->expects($this->once())->method('getPosition')->willReturn('position'); + $this->taxRuleMock->expects($this->once())->method('getCalculateSubtotal')->willReturn(null); + $this->taxRuleMock->expects($this->once())->method('getCustomerTaxClassIds')->willReturn('Post Code'); + $this->taxRuleMock->expects($this->once())->method('getProductTaxClassIds')->willReturn([12]); + $this->taxRuleMock->expects($this->once())->method('getTaxRateIds')->willReturn([66]); + + $this->model->loadData(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php index 45fc2740e9c10..8f778bd7fef04 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxRuleRepositoryTest.php @@ -4,6 +4,9 @@ */ namespace Magento\Tax\Model; +use Magento\Framework\Model\Exception as ModelException; +use Magento\Framework\Api\SearchCriteria as SearchCriteria; + class TaxRuleRepositoryTest extends \PHPUnit_Framework_TestCase { /** @@ -54,7 +57,11 @@ protected function setUp() ); $this->ruleFactory = $this->getMock('\Magento\Tax\Model\Calculation\RuleFactory', [], [], '', false); $this->collectionFactory = $this->getMock( - '\Magento\Tax\Model\Resource\Calculation\Rule\CollectionFactory', ['create'], [], '', false + '\Magento\Tax\Model\Resource\Calculation\Rule\CollectionFactory', + ['create'], + [], + '', + false ); $this->resource = $this->getMock('\Magento\Tax\Model\Resource\Calculation\Rule', [], [], '', false); @@ -105,30 +112,83 @@ public function testSave() $this->assertEquals($rule, $this->model->save($rule)); } - public function testGetList() + /** + * @dataProvider saveExceptionsDataProvider + * @param $exceptionObject + * @param $exceptionName + * @param $exceptionMessage + */ + public function testSaveWithExceptions($exceptionObject, $exceptionName, $exceptionMessage) { - $taxRuleOne = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface'); - $taxRuleTwo = $this->getMock('\Magento\Tax\Api\Data\TaxRuleInterface'); - $searchCriteria = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); - $searchCriteria->expects($this->once())->method('getFilterGroups')->willReturn([]); - $searchCriteria->expects($this->once())->method('getPageSize')->willReturn(20); - $searchCriteria->expects($this->once())->method('getCurrentPage')->willReturn(0); - - $result = $this->getMock('\Magento\Tax\Api\Data\TaxRuleSearchResultsInterface'); - $collection = $this->objectManager->getCollectionMock( - '\Magento\Tax\Model\Resource\TaxClass\Collection', - [$taxRuleOne, $taxRuleTwo] - ); - $collection->expects($this->any())->method('getSize')->willReturn(2); - $collection->expects($this->any())->method('setItems')->with([$taxRuleOne, $taxRuleTwo]); - $collection->expects($this->once())->method('setCurPage')->with(0); - $collection->expects($this->once())->method('setPageSize')->with(20); + $rule = $this->getMock('\Magento\Tax\Model\Calculation\Rule', [], [], '', false); + $rule->expects($this->once())->method('getId')->willReturn(10); - $this->searchResultBuilder->expects($this->once())->method('setSearchCriteria')->with($searchCriteria); - $this->searchResultBuilder->expects($this->once())->method('setTotalCount')->with(2); - $this->searchResultBuilder->expects($this->once())->method('create')->willReturn($result); - $this->collectionFactory->expects($this->once())->method('create')->willReturn($collection); + $this->taxRuleRegistry->expects($this->once())->method('retrieveTaxRule')->with(10)->willReturn($rule); + $this->resource->expects($this->once())->method('save')->with($rule) + ->willThrowException($exceptionObject); + $this->taxRuleRegistry->expects($this->never())->method('registerTaxRule'); + + $this->setExpectedException($exceptionName, $exceptionMessage); + $this->model->save($rule); + } - $this->assertEquals($result, $this->model->getList($searchCriteria)); + public function saveExceptionsDataProvider() + { + return [ + [ + new \Magento\Framework\Model\Exception('Could not save'), + '\Magento\Framework\Exception\CouldNotSaveException', + 'Could not save' + ], [ + new \Magento\Framework\Model\Exception('InputError', ModelException::ERROR_CODE_ENTITY_ALREADY_EXISTS), + '\Magento\Framework\Exception\InputException', + 'InputError' + ], [ + new \Magento\Framework\Exception\NoSuchEntityException('No such entity'), + '\Magento\Framework\Exception\NoSuchEntityException', + 'No such entity' + ] + ]; + } + + public function testGetList() + { + $collectionSize = 1; + $currentPage = 42; + $pageSize = 4; + + $searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteria', [], [], '', false); + $collectionMock = $this->getMock('Magento\Tax\Model\Resource\Calculation\Rule\Collection', [], [], '', false); + $filterGroupMock = $this->getMock('\Magento\Framework\Api\Search\FilterGroup', [], [], '', false); + $filterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false); + $sortOrderMock = $this->getMock('\Magento\Framework\Api\SortOrder', [], [], '', false); + + $this->searchResultBuilder->expects($this->once())->method('setSearchCriteria')->with($searchCriteriaMock); + $this->collectionFactory->expects($this->once())->method('create')->willReturn($collectionMock); + $searchCriteriaMock->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroupMock]); + $filterGroupMock->expects($this->exactly(2))->method('getFilters')->willReturn([$filterMock]); + $filterMock->expects($this->exactly(2))->method('getConditionType')->willReturn('eq'); + $filterMock->expects($this->exactly(2))->method('getField')->willReturnOnConsecutiveCalls( + 'rate.tax_calculation_rate_id', + 'cd.customer_tax_class_id' + ); + $filterMock->expects($this->once())->method('getValue')->willReturn('value'); + $collectionMock->expects($this->exactly(2))->method('joinCalculationData')->withConsecutive(['rate'], ['cd']); + $collectionMock->expects($this->once())->method('addFieldToFilter') + ->with([0 => 'rate.tax_calculation_rate_id'], [0 => ['eq' => 'value']]); + $collectionMock->expects($this->once())->method('getSize')->willReturn($collectionSize); + $this->searchResultBuilder->expects($this->once())->method('setTotalCount')->with($collectionSize); + $searchCriteriaMock->expects($this->once())->method('getSortOrders')->willReturn([$sortOrderMock]); + $sortOrderMock->expects($this->once())->method('getField')->willReturn('sort_order'); + $sortOrderMock->expects($this->once())->method('getDirection')->willReturn(SearchCriteria::SORT_ASC); + $collectionMock->expects($this->once())->method('addOrder')->with('position', 'ASC'); + $searchCriteriaMock->expects($this->once())->method('getCurrentPage')->willReturn($currentPage); + $collectionMock->expects($this->once())->method('setCurPage')->with($currentPage); + $searchCriteriaMock->expects($this->once())->method('getPageSize')->willReturn($pageSize); + $collectionMock->expects($this->once())->method('setPageSize')->with($pageSize); + $collectionMock->expects($this->once())->method('getItems')->willReturn([]); + $this->searchResultBuilder->expects($this->once())->method('setItems')->with([]); + $this->searchResultBuilder->expects($this->once())->method('create')->willReturnSelf(); + $this->assertEquals($this->searchResultBuilder, $this->model->getList($searchCriteriaMock)); } } diff --git a/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php b/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php index eadc24150ace7..46eecc68c7c9f 100644 --- a/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php +++ b/dev/tests/unit/testsuite/Magento/Tools/View/Deployer/LogTest.php @@ -12,14 +12,14 @@ class LogTest extends \PHPUnit_Framework_TestCase /** * @param string $method * @param int $verbosity - * @param string $exepctedMsg + * @param string $expectedMsg * @dataProvider logDataProvider */ - public function testLog($method, $verbosity, $exepctedMsg) + public function testLog($method, $verbosity, $expectedMsg) { $object = new Log($verbosity); $object->$method('foo'); - $this->expectOutputString($exepctedMsg); + $this->expectOutputString($expectedMsg); } /** @@ -44,4 +44,29 @@ public function logDataProvider() ['logDebug', Log::ERROR | Log::DEBUG, $foo], ]; } + + /** + * @param int $verbosity + * @param string $expectedMsg + * + * @dataProvider logDebugAltDataProvider + */ + public function testLogDebugAlt($verbosity, $expectedMsg) + { + $object = new Log($verbosity); + $object->logDebug('foo', '[alt]'); + $this->expectOutputString($expectedMsg); + } + + /** + * @return array + */ + public function logDebugAltDataProvider() + { + return[ + 'debug mode' => [Log::DEBUG, "foo\n"], + 'default mode' => [Log::ERROR, '[alt]'], + 'silent mode' => [Log::SILENT, ''] + ]; + } } diff --git a/dev/tests/unit/testsuite/Magento/WebsiteRestriction/Model/RestrictorTest.php b/dev/tests/unit/testsuite/Magento/WebsiteRestriction/Model/RestrictorTest.php new file mode 100644 index 0000000000000..e19b9132012d2 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/WebsiteRestriction/Model/RestrictorTest.php @@ -0,0 +1,191 @@ +config = $this->getMockBuilder('Magento\WebsiteRestriction\Model\ConfigInterface') + ->getMockForAbstractClass(); + $this->config->expects($this->once()) + ->method('getMode') + ->will($this->returnValue(\Magento\WebsiteRestriction\Model\Mode::ALLOW_LOGIN)); + + $customerSession = $this->getMockBuilder('Magento\Customer\Model\Session') + ->disableOriginalConstructor() + ->setMethods(['isLoggedIn']) + ->getMock(); + $customerSession->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(false)); + + $this->session = $this->getMockBuilder('Magento\Framework\Session\Generic') + ->disableOriginalConstructor() + ->setMethods(['setWebsiteRestrictionAfterLoginUrl']) + ->getMock(); + + $this->urlFactory = $this->getMockBuilder('Magento\Framework\UrlFactory') + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + + $this->model = $objectManager->getObject( + 'Magento\WebsiteRestriction\Model\Restrictor', + [ + 'config' => $this->config, + 'session' => $this->session, + 'urlFactory' => $this->urlFactory, + 'customerSession' => $customerSession, + ] + ); + } + + public function testRestrictRedirectNot302Landing() + { + $requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->setMethods(['getFullActionName', 'setControllerName']) + ->getMockForAbstractClass(); + $requestMock->expects($this->once()) + ->method('getFullActionName') + ->will($this->returnValue('')); + $responseMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface') + ->setMethods(['setRedirect']) + ->getMockForAbstractClass(); + $isCustomerLoggedIn = false; + + $this->config->expects($this->once()) + ->method('getGenericActions') + ->will($this->returnValue(['generic_actions'])); + $this->config->expects($this->once()) + ->method('getHTTPRedirectCode') + ->will($this->returnValue(0)); + + $urlMock = $this->getMockBuilder('Magento\Framework\Url') + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMock(); + + $this->urlFactory->expects($this->at(0)) + ->method('create') + ->will($this->returnValue($urlMock)); + + $urlValue = 'url_value'; + $urlMock->expects($this->once()) + ->method('getUrl') + ->with('customer/account/login') + ->will($this->returnValue($urlValue)); + + $responseMock->expects($this->once()) + ->method('setRedirect') + ->will($this->returnValue($urlValue)); + + $urlMock = $this->getMockBuilder('Magento\Framework\Url') + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMock(); + $this->urlFactory->expects($this->at(1)) + ->method('create') + ->will($this->returnValue($urlMock)); + $urlValue = 'url_value2'; + $urlMock->expects($this->once()) + ->method('getUrl') + ->will($this->returnValue($urlValue)); + + $this->session->expects($this->once()) + ->method('setWebsiteRestrictionAfterLoginUrl') + ->with($urlValue); + + $this->model->restrict($requestMock, $responseMock, $isCustomerLoggedIn); + } + + public function testRestrictRedirect302Landing() + { + $requestMock = $this->getMockBuilder('Magento\Framework\App\RequestInterface') + ->setMethods(['getFullActionName', 'setControllerName']) + ->getMockForAbstractClass(); + $requestMock->expects($this->once()) + ->method('getFullActionName') + ->will($this->returnValue('')); + $responseMock = $this->getMockBuilder('Magento\Framework\App\ResponseInterface') + ->setMethods(['setRedirect']) + ->getMockForAbstractClass(); + $isCustomerLoggedIn = false; + + $this->config->expects($this->once()) + ->method('getGenericActions') + ->will($this->returnValue(['generic_actions'])); + $this->config->expects($this->once()) + ->method('getHTTPRedirectCode') + ->will($this->returnValue(\Magento\WebsiteRestriction\Model\Mode::HTTP_302_LANDING)); + + $landingPageCode = 'landing_page_code'; + $this->config->expects($this->once()) + ->method('getLandingPageCode') + ->will($this->returnValue($landingPageCode)); + + $urlMock = $this->getMockBuilder('Magento\Framework\Url') + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMock(); + + $this->urlFactory->expects($this->at(0)) + ->method('create') + ->will($this->returnValue($urlMock)); + + $urlValue = 'url_value'; + $urlMock->expects($this->once()) + ->method('getUrl') + ->with('', ['_direct' => $landingPageCode]) + ->will($this->returnValue($urlValue)); + + $responseMock->expects($this->once()) + ->method('setRedirect') + ->will($this->returnValue($urlValue)); + + $urlMock = $this->getMockBuilder('Magento\Framework\Url') + ->disableOriginalConstructor() + ->setMethods(['getUrl']) + ->getMock(); + $this->urlFactory->expects($this->at(1)) + ->method('create') + ->will($this->returnValue($urlMock)); + $urlValue = 'url_value2'; + $urlMock->expects($this->once()) + ->method('getUrl') + ->will($this->returnValue($urlValue)); + + $this->session->expects($this->once()) + ->method('setWebsiteRestrictionAfterLoginUrl') + ->with($urlValue); + + $this->model->restrict($requestMock, $responseMock, $isCustomerLoggedIn); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Attribute/Backend/Weee/TaxTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Attribute/Backend/Weee/TaxTest.php new file mode 100644 index 0000000000000..6a47ac0eea7f1 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Attribute/Backend/Weee/TaxTest.php @@ -0,0 +1,241 @@ +objectManager = new ObjectManager($this); + $this->model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax'); + } + + public function testGetBackendModelName() + { + $this->assertEquals('Magento\Weee\Model\Attribute\Backend\Weee\Tax', $this->model->getBackendModelName()); + } + + public function testValidate() + { + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Attribute') + ->setMethods(['getName']) + ->disableOriginalConstructor() + ->getMock(); + $attributeMock + ->expects($this->any()) + ->method('getName') + ->will($this->returnValue('weeeTax')); + + $modelMock = $this->getMockBuilder('Magento\Weee\Model\Attribute\Backend\Weee\Tax') + ->setMethods(['getAttribute']) + ->disableOriginalConstructor() + ->getMock(); + $modelMock + ->expects($this->any()) + ->method('getAttribute') + ->will($this->returnValue($attributeMock)); + + $taxes = [['state' => 'Texas', 'country' => 'US', 'website_id' => '1']]; + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getData']) + ->disableOriginalConstructor() + ->getMock(); + $productMock + ->expects($this->any()) + ->method('getData') + ->will($this->returnValue($taxes)); + + // No exception + $modelMock->validate($productMock); + + $taxes = [['state' => 'Texas', 'country' => 'US', 'website_id' => '1'], + ['state' => 'Texas', 'country' => 'US', 'website_id' => '1']]; + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getData']) + ->disableOriginalConstructor() + ->getMock(); + $productMock + ->expects($this->any()) + ->method('getData') + ->will($this->returnValue($taxes)); + + // Exception caught + $this->setExpectedException('Exception', + 'We found a duplicate of website, country and state fields for a fixed product tax'); + $modelMock->validate($productMock); + } + + public function testAfterLoad() + { + $data = [['website_id' => 1, 'value' => 1]]; + + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['loadProductData']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->any()) + ->method('loadProductData') + ->will($this->returnValue($data)); + + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Attribute') + ->setMethods(['getName']) + ->disableOriginalConstructor() + ->getMock(); + $attributeMock + ->expects($this->any()) + ->method('getName') + ->will($this->returnValue('weeeTax')); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + '_attribute' => $attributeMock + ] + ); + + $model->setAttribute($attributeMock); + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['setData']) + ->disableOriginalConstructor() + ->getMock(); + + $model->afterLoad($productMock); + } + + /** + * Tests the specific method with various regions + * + * @param array $origData + * @param array $currentData + * @param array $expectedData + * @dataProvider dataProviderAfterSaveWithRegion + */ + public function testAfterSaveWithRegion($origData, $currentData, $expectedData) + { + $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') + ->setMethods(['getOrigData', 'getData']) + ->disableOriginalConstructor() + ->getMock(); + + $productMock + ->expects($this->once()) + ->method('getOrigData') + ->will($this->returnValue($origData)); + $productMock + ->expects($this->any()) + ->method('getData') + ->will($this->returnValue($currentData)); + + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['deleteProductData', 'insertProductData']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->once()) + ->method('deleteProductData') + ->will($this->returnValue(null)); + $attributeTaxMock + ->expects($this->once()) + ->method('insertProductData') + ->with($productMock, $expectedData) + ->will($this->returnValue(null)); + + $attributeMock = $this->getMockBuilder('Magento\Eav\Model\Attribute') + ->setMethods(['getName', 'getId']) + ->disableOriginalConstructor() + ->getMock(); + $attributeMock + ->expects($this->any()) + ->method('getName') + ->will($this->returnValue('weeeTax')); + $attributeMock + ->expects($this->any()) + ->method('getId') + ->will($this->returnValue(1)); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + '_attribute' => $attributeMock + ] + ); + + $model->setAttribute($attributeMock); + $model->afterSave($productMock); + } + + /** + * @return array + */ + public function dataProviderAfterSaveWithRegion() + { + return [ + 'withRegion' => [ + 'origData' => [['state' => 'TX', 'country' => 'US', 'website_id' => '1']], + 'currentData' => [['state' => 'TX', 'country' => 'US', 'website_id' => '2', 'price' => 100]], + 'expectedData' => ['state' => 'TX', 'country' => 'US', 'website_id' => '2', 'value' => 100, + 'attribute_id' => 1]], + 'withNoRegion' => [ + 'origData' => [['state' => '0', 'country' => 'US', 'website_id' => '1']], + 'currentData' => [['state' => '0', 'country' => 'US', 'website_id' => '2', 'price' => 100]], + 'expectedData' => ['state' => '0', 'country' => 'US', 'website_id' => '2', 'value' => 100, + 'attribute_id' => 1]] + ]; + } + + public function testAfterDelete() + { + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['deleteProductData']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->once()) + ->method('deleteProductData') + ->with(null, null) + ->will($this->returnValue(null)); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + ] + ); + + $model->afterDelete(null); + } + + public function testGetTable() + { + $attributeTaxMock = $this->getMockBuilder('Magento\Weee\Model\Resource\Attribute\Backend\Weee\Tax') + ->setMethods(['getTable']) + ->disableOriginalConstructor() + ->getMock(); + $attributeTaxMock + ->expects($this->once()) + ->method('getTable') + ->with('weee_tax') + ->will($this->returnValue(null)); + + $model = $this->objectManager->getObject('Magento\Weee\Model\Attribute\Backend\Weee\Tax', + [ + 'attributeTax' => $attributeTaxMock, + ] + ); + + $model->getTable(); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php index eee57aaca2407..789fbbe420c51 100644 --- a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Creditmemo/WeeeTest.php @@ -4,7 +4,6 @@ */ namespace Magento\Weee\Model\Total\Creditmemo; - class WeeeTest extends \PHPUnit_Framework_TestCase { /** @@ -128,6 +127,7 @@ function ($price, $type) use (&$roundingDelta) { } $roundedPrice = round($price + $roundingDelta[$type], 2); $roundingDelta[$type] = $price - $roundedPrice; + return $roundedPrice; } )); @@ -139,18 +139,24 @@ function ($price, $type) use (&$roundingDelta) { $this->assertEquals( $value, $this->creditmemo->getData($key), - 'Creditmemo data field ' . $key . ' is incorrect' + 'Creditmemo data field '.$key.' is incorrect' ); } //verify invoice item data foreach ($expectedResults['creditmemo_items'] as $itemKey => $itemData) { $creditmemoItem = $creditmemoItems[$itemKey]; foreach ($itemData as $key => $value) { - $this->assertEquals( - $value, - $creditmemoItem->getData($key), - 'Creditmemo item field ' . $key . ' is incorrect' - ); + if ($key == 'tax_ratio') { + $taxRatio = unserialize($creditmemoItem->getData($key)); + $expectedTaxRatio = unserialize($itemData[$key]); + $this->assertEquals($expectedTaxRatio['weee'], $taxRatio['weee'], "Tax ratio is incorrect"); + } else { + $this->assertEquals( + $value, + $creditmemoItem->getData($key), + 'Creditmemo item field '.$key.' is incorrect' + ); + } } } } @@ -226,6 +232,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 32.47, ], ], + 'tax_ratio' => serialize(['weee' => 1.0]), 'weee_tax_applied_row_amount' => 30, 'base_weee_tax_applied_row_amount' => 30, @@ -309,6 +316,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 21.65, ], ], + 'tax_ratio' => serialize(['weee' => 1.65 / 2.47]), 'weee_tax_applied_row_amount' => 20, 'base_weee_tax_applied_row_amount' => 20, @@ -392,6 +400,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 10.82, ], ], + 'tax_ratio' => serialize(['weee' => 0.83 / 2.47]), 'weee_tax_applied_row_amount' => 10, 'base_weee_tax_applied_row_amount' => 10, @@ -410,6 +419,7 @@ public function collectDataProvider() ], ], ]; + return $result; } diff --git a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php index cc1c0ad19bc72..8325747574ad7 100644 --- a/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php +++ b/dev/tests/unit/testsuite/Magento/Weee/Model/Total/Invoice/WeeeTest.php @@ -4,7 +4,6 @@ */ namespace Magento\Weee\Model\Total\Invoice; - class WeeeTest extends \PHPUnit_Framework_TestCase { /** @@ -135,6 +134,7 @@ function ($price, $type) use (&$roundingDelta) { } $roundedPrice = round($price + $roundingDelta[$type], 2); $roundingDelta[$type] = $price - $roundedPrice; + return $roundedPrice; } )); @@ -143,17 +143,23 @@ function ($price, $type) use (&$roundingDelta) { //verify invoice data foreach ($expectedResults['invoice_data'] as $key => $value) { - $this->assertEquals($value, $this->invoice->getData($key), 'Invoice data field ' . $key . ' is incorrect'); + $this->assertEquals($value, $this->invoice->getData($key), 'Invoice data field '.$key.' is incorrect'); } //verify invoice item data foreach ($expectedResults['invoice_items'] as $itemKey => $itemData) { $invoiceItem = $invoiceItems[$itemKey]; foreach ($itemData as $key => $value) { - $this->assertEquals( - $value, - $invoiceItem->getData($key), - 'Invoice item field ' . $key . ' is incorrect' - ); + if ($key == 'tax_ratio') { + $taxRatio = unserialize($invoiceItem->getData($key)); + $expectedTaxRatio = unserialize($itemData[$key]); + $this->assertEquals($expectedTaxRatio['weee'], $taxRatio['weee'], "Tax ratio is incorrect"); + } else { + $this->assertEquals( + $value, + $invoiceItem->getData($key), + 'Invoice item field '.$key.' is incorrect' + ); + } } } } @@ -250,7 +256,7 @@ public function collectDataProvider() ], 'weee_tax_applied_row_amount' => 30, 'base_weee_tax_applied_row_amount' => 30, - + 'tax_ratio' => serialize(['weee' => 1.0]), ], ], 'invoice_data' => [ @@ -350,6 +356,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 21.65, ], ], + 'tax_ratio' => serialize(['weee' => 1.65 / 2.47]), 'weee_tax_applied_row_amount' => 20, 'base_weee_tax_applied_row_amount' => 20, @@ -453,6 +460,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 10.82, ], ], + 'tax_ratio' => serialize(['weee' => 0.82 / 2.47]), 'weee_tax_applied_row_amount' => 10, 'base_weee_tax_applied_row_amount' => 10, @@ -556,6 +564,7 @@ public function collectDataProvider() 'row_amount_incl_tax' => 10.82, ], ], + 'tax_ratio' => serialize(['weee' => 0.83 / 2.47]), 'weee_tax_applied_row_amount' => 10, 'base_weee_tax_applied_row_amount' => 10, @@ -574,6 +583,7 @@ public function collectDataProvider() ], ], ]; + return $result; } diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/TextTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/TextTest.php new file mode 100644 index 0000000000000..0cbad71c8d661 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Block/Adminhtml/Widget/Grid/Column/Filter/TextTest.php @@ -0,0 +1,26 @@ +textFilterBlock = (new \Magento\TestFramework\Helper\ObjectManager($this))->getObject( + 'Magento\Wishlist\Block\Adminhtml\Widget\Grid\Column\Filter\Text' + ); + } + + public function testGetCondition() + { + $value = "test"; + $this->textFilterBlock->setValue($value); + $this->assertSame(["like" => $value], $this->textFilterBlock->getCondition()); + } +} diff --git a/dev/tools/Magento/Tools/Composer/Package/Reader.php b/dev/tools/Magento/Tools/Composer/Package/Reader.php index 6c33bc3567e3a..698accb0aa763 100644 --- a/dev/tools/Magento/Tools/Composer/Package/Reader.php +++ b/dev/tools/Magento/Tools/Composer/Package/Reader.php @@ -61,7 +61,7 @@ public function readMagentoPackages() { $result = []; foreach ($this->patterns as $pattern) { - foreach (glob("{$this->rootDir}/{$pattern}/*", GLOB_ONLYDIR) as $dir) { + foreach (glob("{$this->rootDir}/{$pattern}", GLOB_ONLYDIR) as $dir) { $package = $this->readFile($dir . '/composer.json'); if (false === $package) { throw new \LogicException("Missing composer.json file in the directory: {$dir}"); diff --git a/dev/tools/Magento/Tools/Composer/etc/magento_components_list.txt b/dev/tools/Magento/Tools/Composer/etc/magento_components_list.txt index e7afc7bfa8298..54550638cd577 100644 --- a/dev/tools/Magento/Tools/Composer/etc/magento_components_list.txt +++ b/dev/tools/Magento/Tools/Composer/etc/magento_components_list.txt @@ -1,5 +1,5 @@ -app/code/Magento -app/design/adminhtml/Magento -app/design/frontend/Magento -app/i18n/magento -lib/internal/Magento +app/code/Magento/* +app/design/adminhtml/Magento/* +app/design/frontend/Magento/* +app/i18n/magento/* +lib/internal/Magento/* diff --git a/dev/tools/Magento/Tools/Composer/version.php b/dev/tools/Magento/Tools/Composer/version.php index 630eaeb7c1194..16113bfe1c79f 100644 --- a/dev/tools/Magento/Tools/Composer/version.php +++ b/dev/tools/Magento/Tools/Composer/version.php @@ -7,10 +7,7 @@ namespace Magento\Tools\Composer\Package; -require __DIR__ . '/Package/Reader.php'; -require __DIR__ . '/Package/Package.php'; -require __DIR__ . '/Package/Collection.php'; -require __DIR__ . '/Package/Version.php'; +require __DIR__ . '/../../../bootstrap.php'; $usage = "Usage: php -f version.php -- --version=2.1.3 [--dependent=] [--dir=/path/to/work/dir] --version - set the specified version value to all the components. Possible formats: diff --git a/dev/tools/Magento/Tools/Di/compiler.php b/dev/tools/Magento/Tools/Di/compiler.php index c327ffaef1956..f838a21987b9a 100644 --- a/dev/tools/Magento/Tools/Di/compiler.php +++ b/dev/tools/Magento/Tools/Di/compiler.php @@ -42,7 +42,11 @@ $relationsFile = $diDir . '/relations.php'; $pluginDefFile = $diDir . '/plugins.php'; - $compilationDirs = [$rootDir . '/app/code', $rootDir . '/lib/internal/Magento']; + $compilationDirs = [ + $rootDir . '/app/code', + $rootDir . '/lib/internal/Magento', + $rootDir . '/dev/tools/Magento/Tools/View' + ]; /** @var Writer\WriterInterface $logWriter Writer model for success messages */ $logWriter = $opt->getOption('v') ? new Writer\Console() : new Writer\Quiet(); diff --git a/dev/tools/Magento/Tools/I18n/bootstrap.php b/dev/tools/Magento/Tools/I18n/bootstrap.php index 562a94b0e9e91..e66c2faf7d87d 100644 --- a/dev/tools/Magento/Tools/I18n/bootstrap.php +++ b/dev/tools/Magento/Tools/I18n/bootstrap.php @@ -2,5 +2,4 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -define('BP', realpath(__DIR__) . '/'); -require realpath(BP . '/../../../../../app/autoload.php'); +require_once __DIR__ . '/../../../../../app/autoload.php'; diff --git a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php index b76d8dbc92d8d..701a2fba5f047 100644 --- a/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php +++ b/dev/tools/Magento/Tools/Migration/factory_table_names/replace_ce.php @@ -123,7 +123,6 @@ 'cms/page_store' => 'cms_page_store', 'compiler/configuration' => 'compiler_configuration', 'core/cache' => 'core_cache', - 'core/cache_option' => 'core_cache_option', 'core/cache_tag' => 'core_cache_tag', 'core/config_data' => 'core_config_data', 'core/config_field' => 'core_config_field', diff --git a/dev/tools/Magento/Tools/SampleData/Installer.php b/dev/tools/Magento/Tools/SampleData/Installer.php index 1a90ef8aa2bba..3211a648b2421 100644 --- a/dev/tools/Magento/Tools/SampleData/Installer.php +++ b/dev/tools/Magento/Tools/SampleData/Installer.php @@ -4,115 +4,73 @@ */ namespace Magento\Tools\SampleData; -use Magento\Framework\App\Bootstrap; -use Magento\Framework\App\Console; -use Magento\Framework\App\ObjectManager\ConfigLoader; -use Magento\Framework\App\State; -use Magento\Framework\Module\ModuleListInterface; -use Magento\Framework\ObjectManagerInterface; - /** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * Model for installation Sample Data */ -class Installer implements \Magento\Framework\AppInterface +class Installer { /** - * @var State - */ - protected $appState; - - /** - * @var SetupFactory - */ - protected $setupFactory; - - /** - * @var ModuleListInterface - */ - protected $moduleList; - - /** - * @var ObjectManagerInterface + * @var Helper\Deploy */ - protected $objectManager; + private $deploy; /** - * @var ConfigLoader + * @var \Magento\Framework\Module\ModuleListInterface */ - protected $configLoader; + private $moduleList; /** - * @var Console\Response + * @var SetupFactory */ - protected $response; + private $setupFactory; /** * @var Helper\PostInstaller */ - protected $postInstaller; - - /** - * @var Helper\Deploy - */ - protected $deploy; + private $postInstaller; /** * @var \Magento\Backend\Model\Auth\Session */ - protected $session; + private $session; /** - * @param State $appState + * Constructor + * + * @param \Magento\Framework\Module\ModuleListInterface $moduleList + * @param Helper\Deploy $deploy * @param SetupFactory $setupFactory - * @param ModuleListInterface $moduleList - * @param ObjectManagerInterface $objectManager - * @param ConfigLoader $configLoader - * @param Console\Response $response * @param Helper\PostInstaller $postInstaller - * @param Helper\Deploy $deploy - * @param \Magento\User\Model\UserFactory $userFactory - * @param \Magento\Backend\Model\Auth\Session $backendAuthSession - * @param array $data - * @throws \Exception - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @param \Magento\Backend\Model\Auth\Session $session */ public function __construct( - State $appState, - SetupFactory $setupFactory, - ModuleListInterface $moduleList, - ObjectManagerInterface $objectManager, - ConfigLoader $configLoader, - Console\Response $response, - Helper\PostInstaller $postInstaller, - Helper\Deploy $deploy, - \Magento\User\Model\UserFactory $userFactory, - \Magento\Backend\Model\Auth\Session $backendAuthSession, - array $data = [] + \Magento\Framework\Module\ModuleListInterface $moduleList, + \Magento\Tools\SampleData\Helper\Deploy $deploy, + \Magento\Tools\SampleData\SetupFactory $setupFactory, + \Magento\Tools\SampleData\Helper\PostInstaller $postInstaller, + \Magento\Backend\Model\Auth\Session $session ) { - $this->appState = $appState; - $this->setupFactory = $setupFactory; + $this->deploy = $deploy; $this->moduleList = $moduleList; - $this->objectManager = $objectManager; - $this->configLoader = $configLoader; - $this->response = $response; + $this->setupFactory = $setupFactory; $this->postInstaller = $postInstaller; - $this->deploy = $deploy; - $this->session = $backendAuthSession; - $user = $userFactory->create()->loadByUsername($data['admin_username']); - if (!$user || !$user->getId()) { - throw new \Exception('Invalid username provided'); - } - $backendAuthSession->setUser($user); + $this->session = $session; } /** - * {@inheritdoc} - **/ - public function launch() + * Run installation in context of the specified admin user + * + * @param \Magento\User\Model\User $adminUser + * @throws \Exception + * + * @return void + */ + public function run(\Magento\User\Model\User $adminUser) { - $areaCode = 'adminhtml'; - $this->appState->setAreaCode($areaCode); - $this->objectManager->configure($this->configLoader->load($areaCode)); + if (!$adminUser || !$adminUser->getId()) { + throw new \Exception('Invalid admin user provided'); + } + $this->session->setUser($adminUser); $this->deploy->run(); @@ -124,24 +82,14 @@ public function launch() $this->postInstaller->addModule($moduleName); } } + $this->session->unsUser(); $this->postInstaller->run(); - - $this->response->setCode(0); - return $this->response; - } - - /** - * {@inheritdoc} - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - **/ - public function catchException(Bootstrap $bootstrap, \Exception $exception) - { - return false; } /** * Init resources + * * @return array */ private function initResources() diff --git a/dev/tools/Magento/Tools/SampleData/InstallerApp.php b/dev/tools/Magento/Tools/SampleData/InstallerApp.php new file mode 100644 index 0000000000000..e1c1f7a775e9a --- /dev/null +++ b/dev/tools/Magento/Tools/SampleData/InstallerApp.php @@ -0,0 +1,108 @@ +appState = $appState; + $this->objectManager = $objectManager; + $this->configLoader = $configLoader; + $this->response = $response; + $this->installer = $installer; + $this->userFactory = $userFactory; + $this->adminUserName = isset($data['admin_username']) ? $data['admin_username'] : ''; + } + + /** + * {@inheritdoc} + **/ + public function launch() + { + $areaCode = 'adminhtml'; + $this->appState->setAreaCode($areaCode); + $this->objectManager->configure($this->configLoader->load($areaCode)); + /** @var \Magento\Tools\SampleData\Logger $sampleDataLogger */ + $sampleDataLogger = $this->objectManager->get('Magento\Tools\SampleData\Logger'); + $sampleDataLogger->setSubject($this->objectManager->get('Magento\Setup\Model\ConsoleLogger')); + + $this->installer->run($this->userFactory->create()->loadByUsername($this->adminUserName)); + + return $this->response; + } + + /** + * {@inheritdoc} + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + **/ + public function catchException(Bootstrap $bootstrap, \Exception $exception) + { + return false; + } +} diff --git a/dev/tools/Magento/Tools/SampleData/Logger.php b/dev/tools/Magento/Tools/SampleData/Logger.php index e245e25db9ecf..39381973771e3 100644 --- a/dev/tools/Magento/Tools/SampleData/Logger.php +++ b/dev/tools/Magento/Tools/SampleData/Logger.php @@ -4,19 +4,71 @@ */ namespace Magento\Tools\SampleData; +use Magento\Setup\Model\LoggerInterface; + /** - * Class Logger + * A dirty proxy for Setup application logger */ -class Logger +class Logger implements LoggerInterface { /** - * Logs a message + * Proxy subject + * + * @var LoggerInterface + */ + private $subject; + + /** + * Setter for the proxy subject + * + * Known issue: a proper way to implement proxy is to inject subject through constructor. + * This implementation is a workaround of integration of Magento Setup application and framework object manager * - * @param string $message + * @param LoggerInterface $subject * @return void */ + public function setSubject(LoggerInterface $subject) + { + $this->subject = $subject; + } + + /** + * {@inheritdoc} + */ public function log($message) { - echo $message; + return $this->subject->log($message); + } + + /** + * {@inheritdoc} + */ + public function logInline($message) + { + return $this->subject->logInline($message); + } + + /** + * {@inheritdoc} + */ + public function logError(\Exception $e) + { + return $this->subject->logError($e); + } + + /** + * {@inheritdoc} + */ + public function logMeta($message) + { + return $this->subject->logMeta($message); + } + + /** + * {@inheritdoc} + */ + public function logSuccess($message) + { + return $this->subject->logSuccess($message); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Attribute.php b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Attribute.php index 487a5ce4641a7..eaba3360e792b 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Attribute.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Attribute.php @@ -113,7 +113,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing catalog attributes' . PHP_EOL); + $this->logger->log('Installing catalog attributes:'); $attributeCount = 0; foreach ($this->moduleList->getNames() as $moduleName) { @@ -173,10 +173,9 @@ public function run() } } - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); $this->eavConfig->clear(); } diff --git a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Category.php b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Category.php index a882cc576f704..bbcc031982698 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Category.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Category.php @@ -85,7 +85,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing categories' . PHP_EOL); + $this->logger->log('Installing categories:'); foreach ($this->moduleList->getNames() as $moduleName) { $fileName = substr($moduleName, strpos($moduleName, "_") + 1) . '/categories.csv'; @@ -114,10 +114,9 @@ public function run() $this->setAdditionalData($row, $category); $category->save(); } - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Product.php b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Product.php index 24076d56787be..5ab94f74af935 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Product.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/Product.php @@ -117,7 +117,7 @@ public function __construct( */ public function run() { - $this->logger->log("Installing {$this->productType} products" . PHP_EOL); + $this->logger->log("Installing {$this->productType} products:"); $product = $this->productFactory->create(); @@ -150,10 +150,9 @@ public function run() $product->save(); $this->gallery->install($product); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/ProductLink.php b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/ProductLink.php index b38d486659847..2cd294762f796 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/ProductLink.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Catalog/Setup/ProductLink.php @@ -72,7 +72,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing product links' . PHP_EOL); + $this->logger->log('Installing product links:'); $entityFileAssociation = [ 'related', 'upsell', @@ -105,10 +105,9 @@ public function run() } $this->linksInitializer->initializeLinks($product, $links); $product->getLinkInstance()->saveProductRelations($product); - $this->logger->log('.'); + $this->logger->logInline('.'); } } } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/CatalogRule/Setup/Rule.php b/dev/tools/Magento/Tools/SampleData/Module/CatalogRule/Setup/Rule.php index 89ac4155c39ad..cb17368371a5f 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/CatalogRule/Setup/Rule.php +++ b/dev/tools/Magento/Tools/SampleData/Module/CatalogRule/Setup/Rule.php @@ -90,7 +90,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing catalog rules' . PHP_EOL); + $this->logger->log('Installing catalog rules:'); $file = 'CatalogRule/catalog_rules.csv'; $fileName = $this->fixtureHelper->getPath($file); $csvReader = $this->csvReaderFactory->create(['fileName' => $fileName, 'mode' => 'r']); @@ -102,11 +102,10 @@ public function run() $ruleModel = $this->ruleFactory->create(); $ruleModel->loadPost($row); $ruleModel->save(); - $this->logger->log('.'); + $this->logger->logInline('.'); } $ruleJob = $this->jobFactory->create(); $ruleJob->applyAll(); - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Block.php b/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Block.php index 240ccb78e487b..f6a9732d42b5e 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Block.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Block.php @@ -78,7 +78,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing CMS blocks' . PHP_EOL); + $this->logger->log('Installing CMS blocks:'); foreach ($this->fixtures as $file) { /** @var \Magento\Tools\SampleData\Helper\Csv\Reader */ $fileName = $this->fixtureHelper->getPath($file); @@ -87,10 +87,9 @@ public function run() $data = $this->converter->convertRow($row); $cmsBlock = $this->saveCmsBlock($data['block']); $cmsBlock->unsetData(); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Page.php b/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Page.php index af2ae1306d292..49ecafbf3f588 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Page.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Cms/Setup/Page.php @@ -69,7 +69,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing CMS pages' . PHP_EOL); + $this->logger->log('Installing CMS pages:'); foreach ($this->fixtures as $file) { /** @var \Magento\Tools\SampleData\Helper\Csv\Reader $csvReader */ @@ -81,9 +81,8 @@ public function run() ->addData($row) ->setStores([\Magento\Store\Model\Store::DEFAULT_STORE_ID]) ->save(); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/Customer/Setup/Customer.php b/dev/tools/Magento/Tools/SampleData/Module/Customer/Setup/Customer.php index 7cdbb1d79ab70..f52ee77c207ed 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Customer/Setup/Customer.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Customer/Setup/Customer.php @@ -109,7 +109,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing customers' . PHP_EOL); + $this->logger->log('Installing customers:'); foreach ($this->fixtures as $file) { /** @var \Magento\Tools\SampleData\Helper\Csv\Reader $csvReader */ $fileName = $this->fixtureHelper->getPath($file); @@ -143,9 +143,8 @@ public function run() ->create(); $this->accountManagement->createAccount($customer, $row['password']); - $this->logger->log('.'); + $this->logger->logInline('.'); } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/CustomerBalance/Observer.php b/dev/tools/Magento/Tools/SampleData/Module/CustomerBalance/Observer.php new file mode 100644 index 0000000000000..02d4a97dd4a60 --- /dev/null +++ b/dev/tools/Magento/Tools/SampleData/Module/CustomerBalance/Observer.php @@ -0,0 +1,28 @@ +getOrderItem(); + $data = $params->getCreditMemo(); + if ($orderItem->getOrder()->getBaseGrandTotal()) { + $data['refund_customerbalance_return_enable'] = '1'; + $data['refund_customerbalance_return'] = $orderItem->getOrder()->getBaseGrandTotal(); + } + + return $data; + } +} diff --git a/dev/tools/Magento/Tools/SampleData/Module/GiftRegistry/Setup/GiftRegistry.php b/dev/tools/Magento/Tools/SampleData/Module/GiftRegistry/Setup/GiftRegistry.php index b820fb44365a3..ae2d87eebedf6 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/GiftRegistry/Setup/GiftRegistry.php +++ b/dev/tools/Magento/Tools/SampleData/Module/GiftRegistry/Setup/GiftRegistry.php @@ -124,7 +124,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing Gift Registry' . PHP_EOL); + $this->logger->log('Installing Gift Registry:'); $fixtureFile = 'GiftRegistry/gift_registry.csv'; $fixtureFilePath = $this->fixtureHelper->getPath($fixtureFile); /** @var \Magento\Tools\SampleData\Helper\Csv\Reader $csvReader */ @@ -161,9 +161,8 @@ public function run() ->save(); } } - $this->logger->log('.'); + $this->logger->logInline('.'); } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/MultipleWishlist/Setup/Wishlist.php b/dev/tools/Magento/Tools/SampleData/Module/MultipleWishlist/Setup/Wishlist.php index 59a77a90b38df..83e11d3b422ef 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/MultipleWishlist/Setup/Wishlist.php +++ b/dev/tools/Magento/Tools/SampleData/Module/MultipleWishlist/Setup/Wishlist.php @@ -97,7 +97,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing multiple wishlists' . PHP_EOL); + $this->logger->log('Installing multiple wishlists:'); $multipleEnabledConfig = 'wishlist/general/multiple_enabled'; if (!$this->config->isSetFlag($multipleEnabledConfig)) { $this->configWriter->save($multipleEnabledConfig, 1); @@ -130,9 +130,8 @@ public function run() } $productSkuList = explode("\n", $row['product_list']); $this->wishlistHelper->addProductsToWishlist($wishlist, $productSkuList); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/OfflineShipping/Setup/Tablerate.php b/dev/tools/Magento/Tools/SampleData/Module/OfflineShipping/Setup/Tablerate.php index 1b7d697244e27..3c77e6a2cdb67 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/OfflineShipping/Setup/Tablerate.php +++ b/dev/tools/Magento/Tools/SampleData/Module/OfflineShipping/Setup/Tablerate.php @@ -100,7 +100,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing Tablerate' . PHP_EOL); + $this->logger->log('Installing Tablerate:'); /** @var \Magento\Framework\DB\Adapter\AdapterInterface $adapter */ $adapter = $this->resource->getConnection('core_write'); $fixtureFile = 'OfflineShipping/tablerate.csv'; @@ -125,12 +125,11 @@ public function run() 'cost' => 0, ] ); - $this->logger->log('.'); + $this->logger->logInline('.'); } $this->configWriter->save('carriers/tablerate/active', 1); $this->configWriter->save('carriers/tablerate/condition_name', 'package_value'); $this->cacheTypeList->cleanType('config'); - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Review/Setup/Review.php b/dev/tools/Magento/Tools/SampleData/Module/Review/Setup/Review.php index b36f09583cdf1..53f92c970aad3 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Review/Setup/Review.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Review/Setup/Review.php @@ -114,7 +114,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing product reviews' . PHP_EOL); + $this->logger->log('Installing product reviews:'); $fixtureFile = 'Review/products_reviews.csv'; $fixtureFilePath = $this->fixtureHelper->getPath($fixtureFile); /** @var \Magento\Tools\SampleData\Helper\Csv\Reader $csvReader */ @@ -131,9 +131,8 @@ public function run() } $review->save(); $this->setReviewRating($review, $row); - $this->logger->log('.'); + $this->logger->logInline('.'); } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order.php b/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order.php index 845c473d764f4..975c9eead54c9 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order.php @@ -67,16 +67,15 @@ public function __construct( */ public function run() { - $this->logger->log('Installing orders' . PHP_EOL); + $this->logger->log('Installing orders:'); foreach ($this->fixtures as $file) { $fileName = $this->fixtureHelper->getPath($file); $csvReader = $this->csvReaderFactory->create(['fileName' => $fileName, 'mode' => 'r']); foreach ($csvReader as $row) { $orderData = $this->converter->convertRow($row); $this->orderProcessor->createOrder($orderData); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order/Processor.php b/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order/Processor.php index b212177f333be..45fe6a45cf454 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order/Processor.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Sales/Setup/Order/Processor.php @@ -4,6 +4,8 @@ */ namespace Magento\Tools\SampleData\Module\Sales\Setup\Order; +use Magento\Framework\Object; + /** * Class Processor * @@ -61,6 +63,11 @@ class Processor */ protected $storeManager; + /** + * @var \Magento\Tools\SampleData\ObserverManager + */ + protected $observerManager; + /** * @param \Magento\Framework\Registry $coreRegistry * @param \Magento\Framework\Phrase\Renderer\CompositeFactory $rendererCompositeFactory @@ -73,6 +80,7 @@ class Processor * @param \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoaderFactory $shipmentLoaderFactory * @param \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoaderFactory $creditmemoLoaderFactory * @param \Magento\Tools\SampleData\Helper\StoreManager $storeManager + * @param \Magento\Tools\SampleData\ObserverManager $observerManager * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -86,7 +94,8 @@ public function __construct( \Magento\Sales\Model\Service\OrderFactory $serviceOrderFactory, \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoaderFactory $shipmentLoaderFactory, \Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoaderFactory $creditmemoLoaderFactory, - \Magento\Tools\SampleData\Helper\StoreManager $storeManager + \Magento\Tools\SampleData\Helper\StoreManager $storeManager, + \Magento\Tools\SampleData\ObserverManager $observerManager ) { $this->coreRegistry = $coreRegistry; $this->rendererCompositeFactory = $rendererCompositeFactory; @@ -99,6 +108,7 @@ public function __construct( $this->shipmentLoaderFactory = $shipmentLoaderFactory; $this->creditmemoLoaderFactory = $creditmemoLoaderFactory; $this->storeManager = $storeManager; + $this->observerManager = $observerManager; } /** @@ -123,11 +133,11 @@ public function createOrder($orderData) $order = $orderCreateModel ->importPostData($orderData['order']) ->createOrder(); - $transactionOrder = $this->getOrderItemForTransaction($order); - $this->invoiceOrder($transactionOrder); - $this->shipOrder($transactionOrder); + $orderItem = $this->getOrderItemForTransaction($order); + $this->invoiceOrder($orderItem); + $this->shipOrder($orderItem); if ($orderData['refund'] === "yes") { - $this->refundOrder($transactionOrder, $order->getBaseGrandTotal()); + $this->refundOrder($orderItem); } $registryItems = [ 'rule_data', @@ -239,21 +249,13 @@ protected function shipOrder(\Magento\Sales\Model\Order\Item $orderItem) /** * @param \Magento\Sales\Model\Order\Item $orderItem - * @param string $storeCreditAmount * @return void */ - protected function refundOrder(\Magento\Sales\Model\Order\Item $orderItem, $storeCreditAmount = '') + protected function refundOrder(\Magento\Sales\Model\Order\Item $orderItem) { - $creditmemoData = [ - $orderItem->getId() => $orderItem->getQtyToRefund(), - ]; - if (!empty($storeCreditAmount)) { - $creditmemoData['refund_customerbalance_return_enable'] = '1'; - $creditmemoData['refund_customerbalance_return'] = '32'; - } $creditmemoLoader = $this->creditmemoLoaderFactory->create(); $creditmemoLoader->setOrderId($orderItem->getOrderId()); - $creditmemoLoader->setCreditmemo($creditmemoData); + $creditmemoLoader->setCreditmemo($this->getCreditmemoData($orderItem)); $creditmemo = $creditmemoLoader->load(); if ($creditmemo && $creditmemo->isValidGrandTotal()) { $creditmemo->setOfflineRequested(true); @@ -265,6 +267,26 @@ protected function refundOrder(\Magento\Sales\Model\Order\Item $orderItem, $stor } } + /** + * @param \Magento\Sales\Model\Order\Item $orderItem + * @return array + */ + public function getCreditmemoData(\Magento\Sales\Model\Order\Item $orderItem) + { + $data = [$orderItem->getId() => $orderItem->getQtyToRefund()]; + foreach ($this->observerManager->getObservers() as $observer) { + if (is_callable([$observer, 'getCreditmemoData'])) { + $params = new Object([ + 'order_item' => $orderItem, + 'credit_memo' => $data + ]); + $data = $observer->getCreditmemoData($params); + } + } + + return $data; + } + /** * Set phrase renderer * @return void diff --git a/dev/tools/Magento/Tools/SampleData/Module/SalesRule/Setup/Rule.php b/dev/tools/Magento/Tools/SampleData/Module/SalesRule/Setup/Rule.php index bdbc881ab481d..55ff375ec4dab 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/SalesRule/Setup/Rule.php +++ b/dev/tools/Magento/Tools/SampleData/Module/SalesRule/Setup/Rule.php @@ -75,7 +75,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing sales rules' . PHP_EOL); + $this->logger->log('Installing sales rules:'); $file = 'SalesRule/sales_rules.csv'; $fileName = $this->fixtureHelper->getPath($file); $csvReader = $this->csvReaderFactory->create(['fileName' => $fileName, 'mode' => 'r']); @@ -91,8 +91,7 @@ public function run() $rule = $this->ruleFactory->create(); $rule->loadPost($row); $rule->save(); - $this->logger->log('.'); + $this->logger->logInline('.'); } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/TargetRule/Setup/Rule.php b/dev/tools/Magento/Tools/SampleData/Module/TargetRule/Setup/Rule.php index aaa5fc41dfc76..005a86f799110 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/TargetRule/Setup/Rule.php +++ b/dev/tools/Magento/Tools/SampleData/Module/TargetRule/Setup/Rule.php @@ -115,7 +115,7 @@ protected function getConditionFromCategory($categoryPath, $ruleType = 'Rule') */ public function run() { - $this->logger->log('Installing related product rules' . PHP_EOL); + $this->logger->log('Installing related product rules:'); $this->postInstaller->removeSetupResourceType('Magento\Tools\SampleData\Module\Catalog\Setup\ProductLink'); $entityFileAssociation = [ \Magento\TargetRule\Model\Rule::RELATED_PRODUCTS => 'related', @@ -160,10 +160,9 @@ public function run() ->setPositionsLimit(empty($row['limit']) ? 0 : $row['limit']); $rule->loadPost($ruleConditions); $rule->save(); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Tax/Setup/Tax.php b/dev/tools/Magento/Tools/SampleData/Module/Tax/Setup/Tax.php index e57ae17ede9bf..140ba315541ed 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Tax/Setup/Tax.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Tax/Setup/Tax.php @@ -88,7 +88,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing taxes' . PHP_EOL); + $this->logger->log('Installing taxes:'); $fixtureFile = 'Tax/tax_rate.csv'; $fixtureFilePath = $this->fixtureHelper->getPath($fixtureFile); /** @var \Magento\Tools\SampleData\Helper\Csv\Reader $csvReader */ @@ -101,7 +101,7 @@ public function run() ->setRate($data['rate']); $taxData = $this->taxRateBuilder->create(); $this->taxRateRepository->save($taxData); - $this->logger->log('.'); + $this->logger->logInline('.'); } $fixtureFile = 'Tax/tax_rule.csv'; @@ -119,8 +119,7 @@ public function run() ->setPosition($data['position']); $taxRule = $this->ruleBuilder->create(); $this->taxRuleRepository->save($taxRule); - $this->logger->log('.'); + $this->logger->logInline('.'); } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/Theme/Setup.php b/dev/tools/Magento/Tools/SampleData/Module/Theme/Setup.php index b1ffbd418d869..6ea7e6fa1bd49 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Theme/Setup.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Theme/Setup.php @@ -112,10 +112,10 @@ public function __construct( */ public function run() { - $this->logger->log('Installing theme' . PHP_EOL); + $this->logger->log('Installing theme:'); $this->assignTheme(); $this->addHeadInclude(); - $this->logger->log('.' . PHP_EOL); + $this->logger->log('.'); } /** @@ -148,7 +148,8 @@ protected function addHeadInclude() if (!$fileName) { continue; } - $styleContent .= file_get_contents($fileName); + $style = file_get_contents($fileName); + $styleContent .= preg_replace('/^\/\*[\s\S]+\*\//', '', $style); } if (empty($styleContent)) { return; diff --git a/dev/tools/Magento/Tools/SampleData/Module/Widget/Setup/CmsBlock.php b/dev/tools/Magento/Tools/SampleData/Module/Widget/Setup/CmsBlock.php index 78aa2d684ad77..3a253af25c58f 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Widget/Setup/CmsBlock.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Widget/Setup/CmsBlock.php @@ -92,7 +92,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing Widgets' . PHP_EOL); + $this->logger->log('Installing Widgets:'); $pageGroupConfig = [ 'pages' => [ 'block' => '', @@ -150,10 +150,9 @@ public function run() ->setWidgetParameters(['block_id' => $block->getId()]) ->setPageGroups([$pageGroup]); $widgetInstance->save(); - $this->logger->log('.'); + $this->logger->logInline('.'); } } - $this->logger->log(PHP_EOL); } /** diff --git a/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist.php b/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist.php index 6114732a390a4..706915f2ae574 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist.php @@ -65,7 +65,7 @@ public function __construct( */ public function run() { - $this->logger->log('Installing wishlists' . PHP_EOL); + $this->logger->log('Installing wishlists:'); $fixtureFile = 'Wishlist/wishlist.csv'; $fixtureFilePath = $this->fixtureHelper->getPath($fixtureFile); @@ -86,8 +86,7 @@ public function run() } $productSkuList = explode("\n", $row['product_list']); $this->wishlistHelper->addProductsToWishlist($wishlist, $productSkuList); - $this->logger->log('.'); + $this->logger->logInline('.'); } - $this->logger->log(PHP_EOL); } } diff --git a/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist/Helper.php b/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist/Helper.php index fec6fd6e460de..37f20b4a95193 100644 --- a/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist/Helper.php +++ b/dev/tools/Magento/Tools/SampleData/Module/Wishlist/Setup/Wishlist/Helper.php @@ -5,7 +5,7 @@ namespace Magento\Tools\SampleData\Module\Wishlist\Setup\Wishlist; /** - * Common functionality for installation of sample data for both Wishlist and MultipleWishlist modules + * Common functionality for installation of sample data for Wishlists */ class Helper { diff --git a/dev/tools/Magento/Tools/SampleData/ObserverManager.php b/dev/tools/Magento/Tools/SampleData/ObserverManager.php new file mode 100644 index 0000000000000..09b4e4f78fdbf --- /dev/null +++ b/dev/tools/Magento/Tools/SampleData/ObserverManager.php @@ -0,0 +1,60 @@ +objectManager = $objectManager; + $this->moduleList = $moduleList; + } + + /** + * @return array + */ + public function getObservers() + { + if (!is_null($this->observers)) { + return $this->observers; + } + + $this->observers = []; + foreach ($this->moduleList->getNames() as $module) { + $parts = explode('_', $module); + $class = 'Magento\Tools\SampleData\Module\\' . $parts[1] . '\Observer'; + if (class_exists($class)) { + $this->observers[] = $this->objectManager->get($class); + } + } + + return $this->observers; + } +} diff --git a/dev/tools/Magento/Tools/SampleData/composer.json b/dev/tools/Magento/Tools/SampleData/composer.json index 0a6f6c233aa9f..74ba1996aa50c 100644 --- a/dev/tools/Magento/Tools/SampleData/composer.json +++ b/dev/tools/Magento/Tools/SampleData/composer.json @@ -1,12 +1,11 @@ { - "name": "magento/sample-data-scripts", + "name": "magento/sample-data", "description": "Sample Data scripts", - "version": "0.1.0-alpha102", + "version": "0.1.0-alpha108", "require": { - "magento/framework": "0.1.0-alpha102", + "magento/framework": "0.1.0-alpha108", "magento/magento-composer-installer": "*", - "magento/sample-data-media": "dev-master", - "magento/sample-data-styles": "dev-master" + "magento/sample-data-media": "0.1.0-alpha108" }, "type": "magento2-component", "extra": { diff --git a/dev/tools/Magento/Tools/SampleData/fixtures/Cms/styles.css b/dev/tools/Magento/Tools/SampleData/fixtures/Cms/styles.css index 41bb1f86cdbd5..89929ebc46f40 100644 --- a/dev/tools/Magento/Tools/SampleData/fixtures/Cms/styles.css +++ b/dev/tools/Magento/Tools/SampleData/fixtures/Cms/styles.css @@ -1 +1,4 @@ -.cms-index-index .page-title{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.widget .block-promo img{max-width:none}.block-promo{box-sizing:border-box;overflow:hidden;position:relative;display:block;width:100%;color:#333 !important}.block-promo:hover{text-decoration:none}.block-promo .content{display:block;box-sizing:border-box;position:absolute;z-index:1;overflow:hidden;padding:25px 35px 35px}.block-promo .title{display:block;font-weight:300;font-size:32px;font-size:3.2rem;line-height:1.2;margin-bottom:15px}.block-promo .info{display:block;font-weight:300;font-size:22px;font-size:2.2rem;margin-bottom:20px}.block-promo .more{font-size:16px;font-size:1.6rem}.block-promo .icon.more{display:inline-block;text-decoration:none}.block-promo .icon.more:after{font-family:'luma-icons';content:'\e608';font-size:12px;line-height:inherit;color:inherit;overflow:hidden;speak:none;font-weight:normal;-webkit-font-smoothing:antialiased;display:inline-block;vertical-align:middle;text-align:center;margin:0 0 0 5px}.block-promo .button.more{font-size:18px;font-size:1.8rem;background-image:none;background:#1979c3;padding:7px 15px;color:#fff;border:1px solid #1979c3;cursor:pointer;display:inline-block;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:14px;font-size:1.4rem;font-weight:600;box-sizing:border-box;vertical-align:middle;border-radius:3px;text-decoration:none;padding:10px 15px}.block-promo .button.more:focus,.block-promo .button.more:active{background:#006bb4;border:1px solid #006bb4;color:#fff}.block-promo .button.more:hover{background:#006bb4;border:1px solid #006bb4;color:#fff}.block-promo .button.more.disabled,.block-promo .button.more[disabled],fieldset[disabled] .block-promo .button.more{cursor:default;pointer-events:none;opacity:.5}.block-promo .title+.button{margin-top:10px}.block-promo sup{top:-0.2em}.block-promo-2columns .content{padding:20px 25px}.womens-main .content,.womens-pants .content,.training-main .content,.training-erin .content,.sale-main .content,.sale-women .content,.mens-main .content,.mens-pants .content,.gear-main .content,.gear-equipment .content,.new-main .content,.new-eco .content,.home-main .content,.home-performance .content,.home-eco .content,.collection-eco .content,.collection-performance .content{background-color:rgba(255,255,255,0.9)}.home-pants{max-width:417px}.home-pants .content{top:0;left:0;width:80%}.home-pants .title{display:block;font-weight:600;font-family:Halvetica Neue,Helvetica,Arial,sans-serif;white-space:nowrap;margin-bottom:0}.home-t-shirts{background:#ffdd16}.home-erin{height:373px;max-width:426px}.home-erin .content{top:0;right:0;width:60%}.home-performance{height:664px;max-width:415px}.home-performance .content{top:25px;right:25px;left:25px}.home-eco{height:274px;max-width:858px}.new-performance .icon.more{white-space:nowrap}.block-promo-hp .bg-white,.block-promo-hp .home-erin .content{padding:20px}.womens-erin{background:#f4f4f4}.womens-erin .content{padding:20px 35px}.training-main{height:372px;max-width:1280px}.training-main .title{margin-bottom:0;line-height:1.4}.training-main .title span{font-weight:600}.training-erin{height:214px;max-width:1280px}.training-erin .content{padding:15px;text-align:center}.training-erin .info{margin-bottom:0}.training-on-demand,.training-videos{color:#fff !important}.training-on-demand .content,.training-videos .content{position:static;text-align:center}.training-on-demand .icon.calendar,.training-videos .icon.calendar,.training-on-demand .icon.download,.training-videos .icon.download{margin-top:-10px;display:block;text-decoration:none}.training-on-demand .icon.calendar>span,.training-videos .icon.calendar>span,.training-on-demand .icon.download>span,.training-videos .icon.download>span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.training-on-demand .icon.calendar:before,.training-videos .icon.calendar:before,.training-on-demand .icon.download:before,.training-videos .icon.download:before{font-family:'luma-icons';font-size:32px;line-height:inherit;color:inherit;overflow:hidden;speak:none;font-weight:normal;-webkit-font-smoothing:antialiased;display:inline-block;vertical-align:middle;text-align:center}.training-on-demand .icon.calendar:before,.training-videos .icon.calendar:before{content:'\e612'}.training-on-demand .icon.download:before,.training-videos .icon.download:before{content:'\e626'}.training-on-demand .icon.more,.training-videos .icon.more{position:absolute;left:0;right:0;bottom:25px}.training-on-demand .info,.training-videos .info{font-size:16px}.training-on-demand{background:#00ade2}.training-videos{background:#5a5e62}.sale-main{max-width:1080px}.sale-women,.sale-mens{max-width:580px;height:372px}.sale-mens .content{top:0;right:0;width:60%}.sale-20-off .content,.sale-free-shipping .content,.sale-womens-t-shirts .content{padding:15px 20px}.sale-20-off{background:#f4f4f4}.sale-20-off .title{font-size:40px;font-size:4rem;font-weight:700;white-space:nowrap}.sale-20-off img{position:absolute;z-index:0;bottom:0;right:0}.sale-20-off .content{width:75%;position:relative}.sale-free-shipping{background:#71b54e;color:#fff !important}.sale-free-shipping .content{position:static}.sale-free-shipping img{display:block;margin:0 auto 10px;max-width:100% !important}.sale-womens-t-shirts{background:#fedd16}.sale-womens-t-shirts .content{position:static}.sale-womens-t-shirts img{max-width:95% !important}.mens-main .content{width:45%}.womens-main,.home-main,.mens-main,.new-main,.sale-main,.gear-main{height:450px}.womens-t-shirts,.mens-t-shirts{background:#ffdd17}.womens-t-shirts img,.mens-t-shirts img{max-width:100% !important}.womens-t-shirts .content,.mens-t-shirts .content{position:static}.womens-pants,.mens-pants,.gear-fitnes,.gear-equipment,.new-performance,.new-eco{height:372px;max-width:580px}.womens-pants .info span,.mens-pants .info span{display:block;font-size:44px;font-size:4.4rem;font-family:Halvetica Neue,Helvetica,Arial,sans-serif;line-height:1.2;font-weight:600;white-space:nowrap}.womens-category-pants,.womens-category-tanks,.womens-category-shorts,.mens-category-tees,.mens-category-hoodies,.mens-category-shorts,.gear-category-bags,.gear-category-equipment,.gear-category-watches{background:#f4f4f4;min-height:170px}.womens-category-pants img,.womens-category-tanks img,.womens-category-shorts img,.mens-category-tees img,.mens-category-hoodies img,.mens-category-shorts img,.gear-category-bags img,.gear-category-equipment img,.gear-category-watches img{max-width:100% !important;position:absolute;z-index:0;top:0;right:0;left:60%}.womens-category-pants .content,.womens-category-tanks .content,.womens-category-shorts .content,.mens-category-tees .content,.mens-category-hoodies .content,.mens-category-shorts .content,.gear-category-bags .content,.gear-category-equipment .content,.gear-category-watches .content{padding:20px 0 50px 20px !important;position:static;width:60%;z-index:1}.womens-category-pants .title,.womens-category-tanks .title,.womens-category-shorts .title,.mens-category-tees .title,.mens-category-hoodies .title,.mens-category-shorts .title,.gear-category-bags .title,.gear-category-equipment .title,.gear-category-watches .title,.womens-category-pants .info,.womens-category-tanks .info,.womens-category-shorts .info,.mens-category-tees .info,.mens-category-hoodies .info,.mens-category-shorts .info,.gear-category-bags .info,.gear-category-equipment .info,.gear-category-watches .info{font-size:18px;font-size:1.8rem}.womens-category-pants .title,.womens-category-tanks .title,.womens-category-shorts .title,.mens-category-tees .title,.mens-category-hoodies .title,.mens-category-shorts .title,.gear-category-bags .title,.gear-category-equipment .title,.gear-category-watches .title{font-weight:400;margin-bottom:5px}.womens-category-pants .more,.womens-category-tanks .more,.womens-category-shorts .more,.mens-category-tees .more,.mens-category-hoodies .more,.mens-category-shorts .more,.gear-category-bags .more,.gear-category-equipment .more,.gear-category-watches .more{position:absolute;z-index:1;bottom:20px}.gear-fitnes .content,.new-performance .content{right:0;top:0;width:65%}.collection-eco,.collection-performance{height:200px;max-width:1280px}.collection-eco .content,.collection-performance .content{padding:15px;text-align:center}.collection-eco .info,.collection-performance .info{margin-bottom:0}.collection-erin{background:#f4f4f4}.collection-erin .content{padding:20px 35px}.content-heading{text-align:center;margin:10px 0 25px}.content-heading .title{margin:0 0 5px}.content-heading .info{margin-bottom:0}.categories-menu .title{text-transform:uppercase;margin-bottom:10px;display:block}.categories-menu a:link,.categories-menu a:visited,.categories-menu a:hover,.categories-menu a:active{color:#333}.categories-menu .items{margin-bottom:40px}.categories-menu .items:last-child{margin-bottom:0}.cms-content-important{display:block;background:#f5f5f5}.cms-content-important h2{margin-top:0}.cms-content table{border:none}.cms-content table>thead>tr>th,.cms-content table>tbody>tr>th,.cms-content table>tfoot>tr>th,.cms-content table>thead>tr>td,.cms-content table>tbody>tr>td,.cms-content table>tfoot>tr>td{border:none}.cms-content table>thead>tr>th,.cms-content table>thead>tr>td{border-bottom:1px solid #ccc}.cms-content table>tbody>tr:nth-child(even)>td,.cms-content table>tbody>tr:nth-child(even)>th{background:#f7f7f7}.cms-content table th{font-weight:400}.cms-content table td{font-weight:600}.cms-content .block .block-title{margin-bottom:15px}.cms-content .block .block-title>strong{display:none}.cms-content .block .box-title{display:inline-block;margin:0 0 15px}.cms-content .block .box-title>span{font-size:18px;font-size:1.8rem;font-weight:600;line-height:1.1;margin-top:20px;margin-top:2rem;margin-bottom:10px;margin-bottom:1rem;font-weight:300}.cms-content .block .block-content p:last-child{margin-bottom:0}.sale-main,.mens-main,.gear-main,.womens-main{max-width:1080px}.sale-women,.sale-mens,.mens-pants,.womens-pants,.gear-fitnes,.gear-equipment,.new-performance,.new-eco{max-width:580px}.training-main,.training-erin,.collection-eco,.collection-performance,.home-main{max-width:1280px}@media only screen and (max-width:399px){.womens-pants img{width:250%;float:right;margin:-70px -140px 0 0}.mens-main img{margin-left:-180px}.training-main img,.gear-main img,.womens-main img{margin-left:-210px}.home-main img{margin-left:-310px}.sale-main img,.mens-pants img,.home-eco img{margin-left:-150px}.sale-mens img,.gear-fitnes img,.new-performance img{margin-left:-60px}.new-main img,.sale-women img,.training-erin img,.gear-equipment img{margin-left:-120px}.new-eco img{margin-left:-80px}.home-pants,.home-performance{height:580px}.home-pants img,.home-performance img{margin-left:-50px}}@media only screen and (max-width:767px){.womens-main .content,.mens-main .content,.gear-main .content,.new-main .content,.home-main .content,.training-main .content,.sale-main .content{top:20px;right:0;width:65%}.training-main .title{font-size:20px;font-size:2rem}.womens-erin .content,.collection-erin .content{position:static}.womens-erin img,.collection-erin img{display:block;margin:0 auto;max-width:75% !important}.sale-women .content{width:60%;bottom:20px;left:0}.sale-main .content{top:auto;bottom:20px}.sale-20-off{min-height:185px}.sale-20-off .title{font-size:40px;font-size:4rem}.womens-category-pants .title,.womens-category-tanks .title,.womens-category-shorts .title,.mens-category-tees .title,.mens-category-hoodies .title,.mens-category-shorts .title,.gear-category-bags .title,.gear-category-equipment .title,.gear-category-watches .title{font-size:16px;font-size:1.6rem}.womens-category-pants .info,.womens-category-tanks .info,.womens-category-shorts .info,.mens-category-tees .info,.mens-category-hoodies .info,.mens-category-shorts .info,.gear-category-bags .info,.gear-category-equipment .info,.gear-category-watches .info{font-size:14px;font-size:1.4rem}.womens-pants .info span,.mens-pants .info span{font-size:40px;font-size:4rem}.womens-pants .content,.mens-pants .content{max-width:220px;bottom:20px}.home-eco .content{width:65%;top:20px;right:0}.gear-fitnes .content,.new-performance .content,.home-erin .content{padding-top:30px}.gear-equipment .content,.new-eco .content{left:0;bottom:20px;max-width:220px}.training-erin .content{right:10px;bottom:10px;left:10px}.training-erin .title{margin-bottom:10px;font-size:18px;font-size:1.8rem}.training-erin .info{font-size:12px;font-size:1.2rem;margin-bottom:0}.training-on-demand .content,.training-videos .content{padding-top:25px;padding-bottom:45px}.home-pants img{position:absolute;z-index:0;bottom:-10px}.home-pants .title{font-size:40px;font-size:4rem}.home-performance img{position:absolute;z-index:0;top:-20px}.home-pants,.home-performance{height:580px}.womens-main .content,.training-main .content,.gear-main .content{top:auto;bottom:20px}.home-t-shirts .image{display:block;padding:20px 20px 0}.home-t-shirts img{max-width:100% !important}.home-t-shirts .content{position:static}.collection-eco .content,.collection-performance .content{right:10px;bottom:10px;left:10px}.collection-eco .title,.collection-performance .title{margin-bottom:10px;font-size:18px;font-size:1.8rem}.collection-eco .info,.collection-performance .info{font-size:12px;font-size:1.2rem}.collection-erin .title{font-size:18px;font-size:1.8rem}.collection-erin .info{font-size:12px;font-size:1.2rem}.content-heading .title{font-size:30px;font-size:3rem}.content-heading .info{font-size:14px;font-size:1.4rem}.cms-content-important{padding:15px;margin:0 -15px 15px}.cms-content table{margin:10px 0 0}.cms-content table thead th{font-size:11px;font-size:1.1rem}.cms-content ul li{margin-bottom:5px}.cms-content .block .box{margin-bottom:30px}.blocks-promo{margin-left:-15px;margin-right:-15px}.block-promo{margin-bottom:8px}.block-promo .title{font-size:22px;font-size:2.2rem}.block-promo .info{font-size:16px;font-size:1.6rem;margin-bottom:10px}.block-promo .more{font-size:14px;font-size:1.4rem}.block-promo .icon.more:after{font-size:10px;font-size:1rem}.block-promo .button.more{font-size:12px;font-size:1.2rem}.block-promo .content{padding:15px 20px 20px}.block-promo .button.more{padding:8px 12px}}@media all and (min-width:640px),print{.block-promo{margin-bottom:16px}.block-promo-wrapper:before,.block-promo-wrapper:after{content:"";display:table}.block-promo-wrapper:after{clear:both}.block-promo-wrapper .block-promo{float:left;border-right:16px solid #fff}.block-promo-2columns .block-promo{width:50%}.block-promo-3columns .block-promo{width:33.3%}.block-promo-2columns .block-promo:nth-child(2n),.block-promo-3columns .block-promo:nth-child(3n){border-right:0}}@media all and (min-width:768px),print{.block-promo-hp{margin:0 -8px}.block-promo-hp .block-promo{border-left:8px solid #fff;border-right:8px solid #fff}.block-promo-wrapper .home-performance{float:right}.home-pants,.home-erin,.home-performance{width:33.3%}.home-t-shirts,.home-eco{width:66.7%}.womens-main .content,.mens-main .content,.gear-main .content,.new-main .content,.home-main .content,.training-main .content,.sale-main .content{top:40px;right:40px;width:40%}.womens-t-shirts,.mens-t-shirts{height:372px}.womens-pants .content,.mens-pants .content{width:47%;left:20px;top:20px}.womens-erin,.home-t-shirts,.collection-erin{display:table}.womens-erin .content,.home-t-shirts .content,.collection-erin .content,.womens-erin .image,.home-t-shirts .image,.collection-erin .image{display:table-cell}.womens-erin .content,.home-t-shirts .content,.collection-erin .content{position:static}.womens-erin .image,.home-t-shirts .image,.collection-erin .image{vertical-align:bottom}.womens-erin img,.home-t-shirts img,.collection-erin img{float:right}.home-t-shirts{height:276px}.home-t-shirts .content{width:40%}.home-t-shirts .image{width:60%;vertical-align:middle;text-align:center;padding-left:10px}.home-t-shirts img{max-width:100% !important}.womens-category-pants,.womens-category-tanks,.womens-category-shorts,.mens-category-tees,.mens-category-hoodies,.mens-category-shorts,.gear-category-bags,.gear-category-equipment,.gear-category-watches{height:210px}.sale-women .content{width:50%;left:20px;bottom:20px}.sale-20-off .title{font-size:44px;font-size:4.4rem}.sale-20-off .info{font-size:18px;font-size:1.8rem}.sale-20-off,.sale-free-shipping,.sale-womens-t-shirts{height:205px}.sale-free-shipping .title{font-size:25px;font-size:2.5rem}.sale-free-shipping .info{font-size:16px;font-size:1.6rem}.sale-womens-t-shirts .title{font-size:20px;font-size:2rem;margin-bottom:5px}.sale-womens-t-shirts .info{font-size:16px;font-size:1.6rem;margin-bottom:5px}.home-eco .content{width:70%;top:45px;right:45px}.gear-equipment .content,.new-eco .content{left:20px;bottom:20px;width:60%}.new-eco .content{width:70%}.training-erin .content{width:73%;top:16px;bottom:16px;right:16px}.training-erin .info{font-size:16px;font-size:1.6rem;display:block;padding:0 10%}.training-on-demand,.training-videos{height:208px}.home-pants{height:664px}.home-pants .title{font-size:44px !important;font-size:4.4rem !important;line-height:1.2}.collection-eco .content,.collection-performance .content{width:60%;top:16px;bottom:16px;left:50%;margin-left:-30%}.collection-eco .title,.collection-performance .title{font-size:40px;font-size:4rem}.collection-eco .info,.collection-performance .info{font-size:22px;font-size:2.2rem;display:block;padding:0 10%}.collection-erin{height:164px}.collection-erin .content{width:70%}.collection-erin .image{width:30%}.collection-erin .title{font-size:40px;font-size:4rem}.collection-erin .info{font-size:22px;font-size:2.2rem}.content-heading{position:relative}.content-heading:before{content:'';display:block;height:1px;width:100%;background:-moz-radial-gradient(center, ellipse cover, #fff 25%, #cecece 100%);background:-webkit-gradient(radial, center center, 0, center center, 100%, color-stop(25%, #fff), color-stop(100%, #cecece));background:-webkit-radial-gradient(center, ellipse cover, #fff 25%, #cecece 100%);background:-ms-radial-gradient(center, ellipse cover, #fff 25%, #cecece 100%);background:radial-gradient(ellipse at center, #fff 25%, #cecece 100%);position:absolute;top:50%;z-index:0}.content-heading .title,.content-heading .info{position:relative;z-index:1}.content-heading .title{font-size:38px;font-size:3.8rem}.content-heading .info{font-size:18px;font-size:1.8rem}.cms-content-important{font-size:22px;font-size:2.2rem;font-weight:300;padding:20px;margin:0 0 35px -20px}.cms-content table{margin:40px 0 0}.cms-content ul li{margin-bottom:15px}.cms-content .block .block-content:before,.cms-content .block .block-content:after{content:"";display:table}.cms-content .block .block-content:after{clear:both}.cms-content .block .box{width:48%;margin-bottom:40px}.cms-content .block .box:nth-child(1){float:left;clear:left}.cms-content .block .box:nth-child(2){float:right}.cms-content .block .box:nth-child(2)+*{clear:both}.cms-content .block .box:nth-last-child(1),.cms-content .block .box:nth-last-child(2){margin-bottom:0}.privacy-policy-content{box-sizing:border-box;width:77.7%;float:right;padding-left:2%}.privacy-policy .block-collapsible-nav{box-sizing:border-box;width:22.3%;float:left}} \ No newline at end of file +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ +.cms-index-index .page-title{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.widget .block-promo img{max-width:none}.block-promo{box-sizing:border-box;overflow:hidden;position:relative;display:block;width:100%;color:#333 !important}.block-promo:hover{text-decoration:none}.block-promo .content{display:block;box-sizing:border-box;position:absolute;z-index:1;overflow:hidden;padding:25px 35px 35px}.block-promo .title{display:block;font-weight:300;font-size:3.2rem;line-height:1.2;margin-bottom:15px}.block-promo .info{display:block;font-weight:300;font-size:2.2rem;margin-bottom:20px}.block-promo .more{font-size:1.6rem}.block-promo .icon.more{display:inline-block;text-decoration:none}.block-promo .icon.more:after{font-family:'icons-blank-theme';content:'\e608';font-size:12px;line-height:inherit;color:inherit;overflow:hidden;speak:none;font-weight:normal;-webkit-font-smoothing:antialiased;display:inline-block;vertical-align:middle;text-align:center;margin:0 0 0 5px}.block-promo .button.more{font-size:1.8rem;background-image:none;background:#1979c3;padding:7px 15px;color:#fff;border:1px solid #1979c3;cursor:pointer;display:inline-block;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:1.4rem;font-weight:700;box-sizing:border-box;vertical-align:middle;border-radius:3px;text-decoration:none;padding:10px 15px}.block-promo .button.more:focus,.block-promo .button.more:active{background:#006bb4;border:1px solid #006bb4;color:#fff}.block-promo .button.more:hover{background:#006bb4;border:1px solid #006bb4;color:#fff}.block-promo .button.more.disabled,.block-promo .button.more[disabled],fieldset[disabled] .block-promo .button.more{cursor:default;pointer-events:none;opacity:.5}.block-promo .title+.button{margin-top:10px}.block-promo sup{top:-0.2em}.block-promo-2columns .content{padding:20px 25px}.womens-main .content,.womens-pants .content,.training-main .content,.training-erin .content,.sale-main .content,.sale-women .content,.mens-main .content,.mens-pants .content,.gear-main .content,.gear-equipment .content,.new-main .content,.new-eco .content,.home-main .content,.home-performance .content,.home-eco .content,.collection-eco .content,.collection-performance .content{background-color:rgba(255,255,255,0.9)}.sale-main,.mens-main,.gear-main,.womens-main{max-width:1080px}.sale-women,.sale-mens,.mens-pants,.womens-pants,.gear-fitnes,.gear-equipment,.new-performance,.new-eco{max-width:580px}.training-main,.training-erin,.collection-eco,.collection-performance,.home-main{max-width:1280px}.home-pants .content{top:0;left:0;width:80%}.home-pants .title{display:block;font-weight:600;font-family:Halvetica Neue,Helvetica,Arial,sans-serif;white-space:nowrap;margin-bottom:0}.home-t-shirts{background:#ffdd16}.home-erin{height:373px}.home-erin .content{top:0;right:0;width:60%}.home-performance{height:664px}.home-performance .content{top:25px;right:25px;left:25px}.home-eco{height:274px}.new-performance .icon.more{white-space:nowrap}.block-promo-hp .bg-white,.block-promo-hp .home-erin .content{padding:20px}.womens-erin{background:#f4f4f4}.womens-erin .content{padding:20px 35px}.training-main{height:372px}.training-main .title{margin-bottom:0;line-height:1.4}.training-main .title span{font-weight:600}.training-erin{height:214px}.training-erin .content{padding:15px;text-align:center}.training-erin .info{margin-bottom:0}.training-on-demand,.training-videos{color:#fff !important}.training-on-demand .content,.training-videos .content{position:static;text-align:center}.training-on-demand .icon.calendar,.training-videos .icon.calendar,.training-on-demand .icon.download,.training-videos .icon.download{margin-top:-10px;display:block;text-decoration:none}.training-on-demand .icon.calendar>span,.training-videos .icon.calendar>span,.training-on-demand .icon.download>span,.training-videos .icon.download>span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.training-on-demand .icon.calendar:before,.training-videos .icon.calendar:before,.training-on-demand .icon.download:before,.training-videos .icon.download:before{font-family:'icons-blank-theme';font-size:32px;line-height:inherit;color:inherit;overflow:hidden;speak:none;font-weight:normal;-webkit-font-smoothing:antialiased;display:inline-block;vertical-align:middle;text-align:center}.training-on-demand .icon.calendar:before,.training-videos .icon.calendar:before{content:'\e612'}.training-on-demand .icon.download:before,.training-videos .icon.download:before{content:'\e626'}.training-on-demand .icon.more,.training-videos .icon.more{position:absolute;left:0;right:0;bottom:25px}.training-on-demand .info,.training-videos .info{font-size:16px}.training-on-demand{background:#00ade2}.training-videos{background:#5a5e62}.sale-women,.sale-mens{height:372px}.sale-mens .content{top:0;right:0;width:60%}.sale-20-off .content,.sale-free-shipping .content,.sale-womens-t-shirts .content{padding:15px 20px}.sale-20-off{background:#f4f4f4}.sale-20-off .title{font-size:4rem;font-weight:700;white-space:nowrap}.sale-20-off img{position:absolute;z-index:0;bottom:0;right:0}.sale-20-off .content{width:75%;position:relative}.sale-free-shipping{background:#71b54e;color:#fff !important}.sale-free-shipping .content{position:static}.sale-free-shipping img{display:block;margin:0 auto 10px;max-width:100% !important}.sale-womens-t-shirts{background:#fedd16}.sale-womens-t-shirts .content{position:static}.sale-womens-t-shirts img{max-width:95% !important}.mens-main .content{width:45%}.womens-main,.home-main,.mens-main,.new-main,.sale-main,.gear-main{height:450px}.womens-t-shirts,.mens-t-shirts{background:#ffdd17}.womens-t-shirts img,.mens-t-shirts img{max-width:100% !important}.womens-t-shirts .content,.mens-t-shirts .content{position:static}.womens-pants,.mens-pants,.gear-fitnes,.gear-equipment,.new-performance,.new-eco{height:372px}.womens-pants .info span,.mens-pants .info span{display:block;font-size:4.4rem;font-family:Halvetica Neue,Helvetica,Arial,sans-serif;line-height:1.2;font-weight:600;white-space:nowrap}.womens-category-pants,.womens-category-tanks,.womens-category-shorts,.mens-category-tees,.mens-category-hoodies,.mens-category-shorts,.gear-category-bags,.gear-category-equipment,.gear-category-watches{background:#f4f4f4;min-height:170px}.womens-category-pants img,.womens-category-tanks img,.womens-category-shorts img,.mens-category-tees img,.mens-category-hoodies img,.mens-category-shorts img,.gear-category-bags img,.gear-category-equipment img,.gear-category-watches img{max-width:100% !important;position:absolute;z-index:0;top:0;right:0;left:60%}.womens-category-pants .content,.womens-category-tanks .content,.womens-category-shorts .content,.mens-category-tees .content,.mens-category-hoodies .content,.mens-category-shorts .content,.gear-category-bags .content,.gear-category-equipment .content,.gear-category-watches .content{padding:20px 0 50px 20px !important;position:static;width:60%;z-index:1}.womens-category-pants .title,.womens-category-tanks .title,.womens-category-shorts .title,.mens-category-tees .title,.mens-category-hoodies .title,.mens-category-shorts .title,.gear-category-bags .title,.gear-category-equipment .title,.gear-category-watches .title,.womens-category-pants .info,.womens-category-tanks .info,.womens-category-shorts .info,.mens-category-tees .info,.mens-category-hoodies .info,.mens-category-shorts .info,.gear-category-bags .info,.gear-category-equipment .info,.gear-category-watches .info{font-size:1.8rem}.womens-category-pants .title,.womens-category-tanks .title,.womens-category-shorts .title,.mens-category-tees .title,.mens-category-hoodies .title,.mens-category-shorts .title,.gear-category-bags .title,.gear-category-equipment .title,.gear-category-watches .title{font-weight:400;margin-bottom:5px}.womens-category-pants .more,.womens-category-tanks .more,.womens-category-shorts .more,.mens-category-tees .more,.mens-category-hoodies .more,.mens-category-shorts .more,.gear-category-bags .more,.gear-category-equipment .more,.gear-category-watches .more{position:absolute;z-index:1;bottom:20px}.gear-fitnes .content,.new-performance .content{right:0;top:0;width:65%}.collection-eco,.collection-performance{height:200px}.collection-eco .content,.collection-performance .content{padding:15px;text-align:center}.collection-eco .info,.collection-performance .info{margin-bottom:0}.collection-erin{background:#f4f4f4}.collection-erin .content{padding:20px 35px}.content-heading{text-align:center;margin:10px 0 25px}.content-heading .title{margin:0 0 5px}.content-heading .info{margin-bottom:0}.categories-menu .title{text-transform:uppercase;margin-bottom:10px;display:block}.categories-menu a:link,.categories-menu a:visited,.categories-menu a:hover,.categories-menu a:active{color:#333}.categories-menu .items{margin-bottom:40px}.categories-menu .items:last-child{margin-bottom:0}.cms-content-important{display:block;background:#f5f5f5}.cms-content-important h2{margin-top:0}.cms-content table{border:none}.cms-content table>thead>tr>th,.cms-content table>tbody>tr>th,.cms-content table>tfoot>tr>th,.cms-content table>thead>tr>td,.cms-content table>tbody>tr>td,.cms-content table>tfoot>tr>td{border:none}.cms-content table>thead>tr>th,.cms-content table>thead>tr>td{border-bottom:1px solid #d1d1d1}.cms-content table>tbody>tr:nth-child(even)>td,.cms-content table>tbody>tr:nth-child(even)>th{background:#f7f7f7}.cms-content table th{font-weight:400}.cms-content table td{font-weight:600}.cms-content .block .block-title{margin-bottom:15px}.cms-content .block .block-title>strong{display:none}.cms-content .block .box-title{display:inline-block;margin:0 0 15px}.cms-content .block .box-title>span{font-size:1.8rem;line-height:1.1;margin-top:1.5rem;margin-bottom:1rem;font-weight:300}.cms-content .block .block-content p:last-child{margin-bottom:0}@media only screen and (max-width:399px){.womens-pants img{width:250%;float:right;margin:-70px -140px 0 0}.mens-main img{margin-left:-180px}.training-main img,.gear-main img,.womens-main img{margin-left:-210px}.home-main img{margin-left:-310px}.sale-main img,.mens-pants img,.home-eco img{margin-left:-150px}.sale-mens img,.gear-fitnes img,.new-performance img{margin-left:-60px}.new-main img,.sale-women img,.training-erin img,.gear-equipment img{margin-left:-120px}.new-eco img{margin-left:-80px}.home-pants,.home-performance{height:580px}.home-pants img,.home-performance img{margin-left:-50px}}@media only screen and (max-width:767px){.home-pants{max-width:417px}.home-erin{max-width:426px}.home-performance{max-width:415px}.home-eco{max-width:858px}.home-pants,.home-performance{height:580px}.womens-main .content,.mens-main .content,.gear-main .content,.new-main .content,.home-main .content,.training-main .content,.sale-main .content{top:20px;right:0;width:65%}.training-main .title{font-size:2rem}.womens-erin .content,.collection-erin .content{position:static}.womens-erin img,.collection-erin img{display:block;margin:0 auto;max-width:75% !important}.sale-women .content{width:60%;bottom:20px;left:0}.sale-main .content{top:auto;bottom:20px}.sale-20-off{min-height:185px}.sale-20-off .title{font-size:4rem}.womens-category-pants .title,.womens-category-tanks .title,.womens-category-shorts .title,.mens-category-tees .title,.mens-category-hoodies .title,.mens-category-shorts .title,.gear-category-bags .title,.gear-category-equipment .title,.gear-category-watches .title{font-size:1.6rem}.womens-category-pants .info,.womens-category-tanks .info,.womens-category-shorts .info,.mens-category-tees .info,.mens-category-hoodies .info,.mens-category-shorts .info,.gear-category-bags .info,.gear-category-equipment .info,.gear-category-watches .info{font-size:1.4rem}.womens-pants .info span,.mens-pants .info span{font-size:4rem}.womens-pants .content,.mens-pants .content{max-width:220px;bottom:20px}.home-eco .content{width:65%;top:20px;right:0}.gear-fitnes .content,.new-performance .content,.home-erin .content{padding-top:30px}.gear-equipment .content,.new-eco .content{left:0;bottom:20px;max-width:220px}.training-erin .content{right:10px;bottom:10px;left:10px}.training-erin .title{margin-bottom:10px;font-size:1.8rem}.training-erin .info{font-size:1.2rem;margin-bottom:0}.training-on-demand .content,.training-videos .content{padding-top:25px;padding-bottom:45px}.home-pants img{position:absolute;z-index:0;bottom:-10px}.home-pants .title{font-size:4rem}.home-performance img{position:absolute;z-index:0;top:-20px}.womens-main .content,.training-main .content,.gear-main .content{top:auto;bottom:20px}.home-t-shirts .image{display:block;padding:20px 20px 0}.home-t-shirts img{max-width:100% !important}.home-t-shirts .content{position:static}.collection-eco .content,.collection-performance .content{right:10px;bottom:10px;left:10px}.collection-eco .title,.collection-performance .title{margin-bottom:10px;font-size:1.8rem}.collection-eco .info,.collection-performance .info{font-size:1.2rem}.collection-erin .title{font-size:1.8rem}.collection-erin .info{font-size:1.2rem}.content-heading .title{font-size:3rem}.content-heading .info{font-size:1.4rem}.cms-content-important{padding:15px;margin:0 -15px 15px}.cms-content table{margin:10px 0 0}.cms-content table thead th{font-size:1.1rem}.cms-content ul li{margin-bottom:5px}.cms-content .block .box{margin-bottom:30px}.blocks-promo{margin-left:-15px;margin-right:-15px}.block-promo{margin-bottom:8px}.block-promo .title{font-size:2.2rem}.block-promo .info{font-size:1.6rem;margin-bottom:10px}.block-promo .more{font-size:1.4rem}.block-promo .icon.more:after{font-size:1rem}.block-promo .button.more{font-size:1.2rem}.block-promo .content{padding:15px 20px 20px}.block-promo .button.more{padding:8px 12px}}@media all and (min-width:640px),print{.block-promo{margin-bottom:16px}.block-promo-wrapper:before,.block-promo-wrapper:after{content:"";display:table}.block-promo-wrapper:after{clear:both}.block-promo-wrapper .block-promo{float:left;border-right:16px solid #fff}.block-promo-2columns .block-promo{width:50%}.block-promo-3columns .block-promo{width:33.3%}.block-promo-2columns .block-promo:nth-child(2n),.block-promo-3columns .block-promo:nth-child(3n){border-right:0}}@media all and (min-width:768px),print{.block-promo-hp{margin:0 -8px}.block-promo-hp .block-promo{border-left:8px solid #fff;border-right:8px solid #fff}.block-promo-wrapper .home-performance{float:right}.home-pants,.home-erin,.home-performance{width:33.3%}.home-t-shirts,.home-eco{width:66.7%}.womens-main .content,.mens-main .content,.gear-main .content,.new-main .content,.home-main .content,.training-main .content,.sale-main .content{top:40px;right:40px;width:40%}.womens-t-shirts,.mens-t-shirts{height:372px}.womens-pants .content,.mens-pants .content{width:47%;left:20px;top:20px}.womens-erin,.home-t-shirts,.collection-erin{display:table}.womens-erin .content,.home-t-shirts .content,.collection-erin .content,.womens-erin .image,.home-t-shirts .image,.collection-erin .image{display:table-cell}.womens-erin .content,.home-t-shirts .content,.collection-erin .content{position:static}.womens-erin .image,.home-t-shirts .image,.collection-erin .image{vertical-align:bottom}.womens-erin img,.home-t-shirts img,.collection-erin img{float:right}.home-t-shirts{height:276px}.home-t-shirts .content{width:40%}.home-t-shirts .image{width:60%;vertical-align:middle;text-align:center;padding-left:10px}.home-t-shirts img{max-width:100% !important}.womens-category-pants,.womens-category-tanks,.womens-category-shorts,.mens-category-tees,.mens-category-hoodies,.mens-category-shorts,.gear-category-bags,.gear-category-equipment,.gear-category-watches{height:210px}.sale-women .content{width:50%;left:20px;bottom:20px}.sale-20-off .title{font-size:4.4rem}.sale-20-off .info{font-size:1.8rem}.sale-20-off,.sale-free-shipping,.sale-womens-t-shirts{height:205px}.sale-free-shipping .title{font-size:2.5rem}.sale-free-shipping .info{font-size:1.6rem}.sale-womens-t-shirts .title{font-size:2rem;margin-bottom:5px}.sale-womens-t-shirts .info{font-size:1.6rem;margin-bottom:5px}.home-eco .content{width:70%;top:45px;right:45px}.gear-equipment .content,.new-eco .content{left:20px;bottom:20px;width:60%}.new-eco .content{width:70%}.training-erin .content{width:73%;top:16px;bottom:16px;right:16px}.training-erin .info{font-size:1.6rem;display:block;padding:0 10%}.training-on-demand,.training-videos{height:208px}.home-pants{height:664px}.home-pants .title{font-size:44px !important;font-size:4.4rem !important;line-height:1.2}.collection-eco .content,.collection-performance .content{width:60%;top:16px;bottom:16px;left:50%;margin-left:-30%}.collection-eco .title,.collection-performance .title{font-size:4rem}.collection-eco .info,.collection-performance .info{font-size:2.2rem;display:block;padding:0 10%}.collection-erin{height:164px}.collection-erin .content{width:70%}.collection-erin .image{width:30%}.collection-erin .title{font-size:4rem}.collection-erin .info{font-size:2.2rem}.content-heading{position:relative}.content-heading:before{content:'';display:block;height:1px;width:100%;background:-moz-radial-gradient(center, ellipse cover, #fff 25%, #cecece 100%);background:-webkit-gradient(radial, center center, 0, center center, 100%, color-stop(25%, #fff), color-stop(100%, #cecece));background:-webkit-radial-gradient(center, ellipse cover, #fff 25%, #cecece 100%);background:-ms-radial-gradient(center, ellipse cover, #fff 25%, #cecece 100%);background:radial-gradient(ellipse at center, #fff 25%, #cecece 100%);position:absolute;top:50%;z-index:0}.content-heading .title,.content-heading .info{position:relative;z-index:1}.content-heading .title{font-size:3.8rem}.content-heading .info{font-size:1.8rem}.cms-content-important{font-size:2.2rem;font-weight:300;padding:20px;margin:0 0 35px -20px}.cms-content table{margin:40px 0 0}.cms-content ul li{margin-bottom:15px}.cms-content .block .block-content:before,.cms-content .block .block-content:after{content:"";display:table}.cms-content .block .block-content:after{clear:both}.cms-content .block .box{width:48%;margin-bottom:40px}.cms-content .block .box:nth-child(1){float:left;clear:left}.cms-content .block .box:nth-child(2){float:right}.cms-content .block .box:nth-child(2)+*{clear:both}.cms-content .block .box:nth-last-child(1),.cms-content .block .box:nth-last-child(2){margin-bottom:0}.privacy-policy-content{box-sizing:border-box;width:77.7%;float:right;padding-left:2%}.privacy-policy .block-collapsible-nav{box-sizing:border-box;width:22.3%;float:left}} \ No newline at end of file diff --git a/dev/tools/Magento/Tools/SampleData/fixtures/Contact/styles.css b/dev/tools/Magento/Tools/SampleData/fixtures/Contact/styles.css index fb713c6281ddc..9d2655aa5de94 100644 --- a/dev/tools/Magento/Tools/SampleData/fixtures/Contact/styles.css +++ b/dev/tools/Magento/Tools/SampleData/fixtures/Contact/styles.css @@ -1 +1,4 @@ +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ .contact-index-index .fieldset{margin-bottom:20px}.contact-index-index .fieldset .legend{padding-bottom:0}.contact-info-number{display:block;font-size:36px;font-size:3.6rem;line-height:36px;font-weight:300}@media only screen and (max-width:767px){.contact-info-number{font-weight:300;margin-bottom:10px}}@media all and (min-width:768px),print{._rwd_width{min-width:0 !important;max-width:auto !important}._rwd_width_float{width:100% !important;float:none !important}.contact-index-index .fieldset .legend{border:none}.contact-index-index .column.main .widget.static.block{float:left;width:70%}.contact-info-number{margin-bottom:15px}.column:not(.sidebar-main) .form.contact,.column:not(.sidebar-additional) .form.contact{width:27%;float:right}} \ No newline at end of file diff --git a/dev/tools/Magento/Tools/SampleData/fixtures/GiftCard/styles.css b/dev/tools/Magento/Tools/SampleData/fixtures/GiftCard/styles.css index 4ba64bd806695..37b9199124fd2 100644 --- a/dev/tools/Magento/Tools/SampleData/fixtures/GiftCard/styles.css +++ b/dev/tools/Magento/Tools/SampleData/fixtures/GiftCard/styles.css @@ -1 +1,4 @@ +/** + * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) + */ .giftcard-mailed{background:#fedd16}.giftcard-mailed .content{position:static}.giftcard-mailed img{max-width:100% !important;margin-left:20px;position:absolute;z-index:0;bottom:0}.giftcard-virtual .content{left:0;top:0;width:65%}.giftcard-virtual img{position:absolute;z-index:0;bottom:0;right:0;max-width:100% !important}@media only screen and (max-width:767px){.giftcard-mailed,.giftcard-virtual{min-height:275px}.giftcard-virtual img{max-width:80% !important}}@media all and (min-width:768px),print{.giftcard-virtual,.giftcard-mailed{height:420px}.womens-erin{height:164px}.womens-erin .content{width:70%}.womens-erin .image{width:30%}} \ No newline at end of file diff --git a/dev/tools/Magento/Tools/SampleData/install.php b/dev/tools/Magento/Tools/SampleData/install.php index d8940c85850bc..62dd0fea9d721 100644 --- a/dev/tools/Magento/Tools/SampleData/install.php +++ b/dev/tools/Magento/Tools/SampleData/install.php @@ -25,5 +25,5 @@ $params[State::PARAM_MODE] = State::MODE_DEVELOPER; $bootstrap = Bootstrap::create(BP, $params); -$app = $bootstrap->createApplication('Magento\Tools\SampleData\Installer', ['data' => $data]); +$app = $bootstrap->createApplication('Magento\Tools\SampleData\InstallerApp', ['data' => $data]); $bootstrap->run($app); diff --git a/dev/tools/Magento/Tools/View/Deployer.php b/dev/tools/Magento/Tools/View/Deployer.php index 4d81956c213cd..5a7572c707848 100644 --- a/dev/tools/Magento/Tools/View/Deployer.php +++ b/dev/tools/Magento/Tools/View/Deployer.php @@ -92,8 +92,8 @@ public function deploy(ObjectManagerFactory $omFactory, array $locales) $this->count = 0; $this->errorCount = 0; foreach ($appFiles as $info) { - list($fileArea, $fileThemePath, , $module, $filePath) = $info; - $this->deployAppFile($area, $fileArea, $themePath, $fileThemePath, $locale, $module, $filePath); + list(, , , $module, $filePath) = $info; + $this->deployFile($filePath, $area, $themePath, $locale, $module); } foreach ($libFiles as $filePath) { $this->deployFile($filePath, $area, $themePath, $locale, null); @@ -166,29 +166,6 @@ private function emulateApplicationArea($areaCode) $this->assetPublisher = $objectManager->get('Magento\Framework\App\View\Asset\Publisher'); } - /** - * Deploy a static view file that belongs to the application - * - * @param string $area - * @param string $fileArea - * @param string $themePath - * @param string $fileThemePath - * @param string $locale - * @param string $module - * @param string $filePath - * @return void - */ - private function deployAppFile($area, $fileArea, $themePath, $fileThemePath, $locale, $module, $filePath) - { - if ($fileArea && $fileArea != $area) { - return; - } - if ($fileThemePath && $fileThemePath != $themePath) { - return; - } - $this->deployFile($filePath, $area, $themePath, $locale, $module); - } - /** * Deploy a static view file * @@ -205,21 +182,36 @@ private function deployFile($filePath, $area, $themePath, $locale, $module) if (substr($filePath, -5) == '.less') { $requestedPath = preg_replace('/.less$/', '.css', $filePath); } - $logModule = $module ? "<{$module}>" : (null === $module ? '' : ''); + $logMessage = "Processing file '$filePath' for area '$area', theme '$themePath', locale '$locale'"; + if ($module) { + $logMessage .= ", module '$module'"; + } + $this->logger->logDebug($logMessage); try { $asset = $this->assetRepo->createAsset( $requestedPath, ['area' => $area, 'theme' => $themePath, 'locale' => $locale, 'module' => $module] ); - $this->logger->logDebug("{$logModule} {$filePath} -> {$asset->getPath()}"); + $this->logger->logDebug("\tDeploying the file to '{$asset->getPath()}'", '.'); if ($this->isDryRun) { $asset->getContent(); } else { $this->assetPublisher->publish($asset); } $this->count++; + } catch (\Magento\Framework\View\Asset\File\NotFoundException $e) { + // File was not found by Fallback (possibly because it's wrong context for it) - there is nothing to publish + $this->logger->logDebug( + "\tNotice: Could not find file '$filePath'. This file may not be relevant for the theme or area." + ); + } catch (\Less_Exception_Compiler $e) { + $this->logger->logDebug( + "\tNotice: Could not parse LESS file '$filePath'. " + . "This may indicate that the file is incomplete, but this is acceptable. " + . "The file '$filePath' will be combined with another LESS file." + ); } catch (\Exception $e) { - $this->logger->logError("{$logModule} {$filePath}"); + $this->logger->logError($e->getMessage() . " ($logMessage)"); $this->logger->logDebug((string)$e); $this->errorCount++; } diff --git a/dev/tools/Magento/Tools/View/Deployer/Log.php b/dev/tools/Magento/Tools/View/Deployer/Log.php index 438da0297dc4c..61b98343ff32f 100644 --- a/dev/tools/Magento/Tools/View/Deployer/Log.php +++ b/dev/tools/Magento/Tools/View/Deployer/Log.php @@ -23,6 +23,13 @@ class Log */ private $verbosity; + /** + * If last output printed inline + * + * @var bool + */ + private $isInline = false; + /** * @param int $verbosity */ @@ -40,6 +47,7 @@ public function __construct($verbosity) public function logMessage($msg) { if ($this->verbosity !== self::SILENT) { + $this->terminateLine(); echo "{$msg}\n"; } } @@ -53,6 +61,7 @@ public function logMessage($msg) public function logError($msg) { if ($this->verbosity & self::ERROR) { + $this->terminateLine(); echo "ERROR: {$msg}\n"; } } @@ -61,12 +70,30 @@ public function logError($msg) * Log a debug message * * @param string $msg + * @param string $altInline Alternative message for normal mode (printed inline) * @return void */ - public function logDebug($msg) + public function logDebug($msg, $altInline = '') { if ($this->verbosity & self::DEBUG) { + $this->terminateLine(); echo "{$msg}\n"; + } elseif ($altInline && $this->verbosity !== self::SILENT) { + echo $altInline; + $this->isInline = true; + } + } + + /** + * Ensures the next log message will be printed on new line + * + * @return void + */ + private function terminateLine() + { + if ($this->isInline) { + $this->isInline = false; + echo "\n"; } } } diff --git a/dev/tools/Magento/Tools/View/deploy.php b/dev/tools/Magento/Tools/View/deploy.php index 469efc6403b3b..1a156a7d64019 100644 --- a/dev/tools/Magento/Tools/View/deploy.php +++ b/dev/tools/Magento/Tools/View/deploy.php @@ -48,6 +48,14 @@ $objectManager = $omFactory->create( [\Magento\Framework\App\State::PARAM_MODE => \Magento\Framework\App\State::MODE_DEFAULT] ); + +/** @var \Magento\Framework\App\DeploymentConfig $deploymentConfig */ +$deploymentConfig = $objectManager->get('Magento\Framework\App\DeploymentConfig'); +$isAppInstalled = $deploymentConfig->isAvailable(); +if (!$isAppInstalled) { + throw new \Exception('Please install the Magento application before running this process.'); +} + $logger = new \Magento\Tools\View\Deployer\Log($verbosity); /** @var \Magento\Tools\View\Deployer $deployer */ $deployer = $objectManager->create( diff --git a/index.php b/index.php index 877bf13d930e3..be1bf6aa9e0c0 100644 --- a/index.php +++ b/index.php @@ -17,7 +17,21 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -require __DIR__ . '/app/bootstrap.php'; +try { + require __DIR__ . '/app/bootstrap.php'; +} catch (\Exception $e) { + echo << +
    +

    + Autoload error

    +
    +

    {$e->getMessage()}

    + +HTML; + exit(1); +} + $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication('Magento\Framework\App\Http'); diff --git a/lib/internal/Magento/Framework/App/Cache/Manager.php b/lib/internal/Magento/Framework/App/Cache/Manager.php new file mode 100644 index 0000000000000..995bd4db465bf --- /dev/null +++ b/lib/internal/Magento/Framework/App/Cache/Manager.php @@ -0,0 +1,136 @@ +cacheTypeList = $cacheTypeList; + $this->cacheState = $cacheState; + $this->pool = $pool; + } + + /** + * Updates cache status for the requested types + * + * @param string[] $types + * @param bool $isEnabled + * @return array List of types with changed status + */ + public function setEnabled(array $types, $isEnabled) + { + $changedStatusTypes = []; + $isUpdated = false; + foreach ($types as $type) { + if ($this->cacheState->isEnabled($type) === $isEnabled) { // no need to poke it, if is not going to change + continue; + } + $this->cacheState->setEnabled($type, $isEnabled); + $isUpdated = true; + $changedStatusTypes[] = $type; + } + if ($isUpdated) { + $this->cacheState->persist(); + } + return $changedStatusTypes; + } + + /** + * Cleans up caches + * + * @param array $types + * @return void + */ + public function clean(array $types) + { + foreach ($types as $type) { + $frontend = $this->pool->get($type); + $frontend->clean(); + } + } + + /** + * Flushes specified cache storages + * + * @param string[] $types + * @return void + */ + public function flush(array $types) + { + $flushedBackend = []; + foreach ($types as $type) { + $backend = $this->pool->get($type)->getBackend(); + if (in_array($backend, $flushedBackend, true)) { // it was already flushed from another frontend + continue; + } + $backend->clean(); + $flushedBackend[] = $backend; + } + } + + /** + * Presents summary about cache status + * + * @return array + */ + public function getStatus() + { + $result = []; + foreach ($this->cacheTypeList->getTypes() as $type) { + $result[$type['id']] = $type['status']; + } + return $result; + } + + /** + * @return array + */ + public function getAvailableTypes() + { + $result = []; + foreach ($this->cacheTypeList->getTypes() as $type) { + $result[] = $type['id']; + } + return $result; + } +} diff --git a/lib/internal/Magento/Framework/App/Cache/ManagerApp.php b/lib/internal/Magento/Framework/App/Cache/ManagerApp.php index 88ed326d74fe7..a8c035ff01524 100644 --- a/lib/internal/Magento/Framework/App/Cache/ManagerApp.php +++ b/lib/internal/Magento/Framework/App/Cache/ManagerApp.php @@ -23,20 +23,6 @@ class ManagerApp implements AppInterface const KEY_FLUSH = 'flush'; /**#@- */ - /** - * Cache types list - * - * @var TypeListInterface - */ - private $cacheTypeList; - - /** - * Cache state service - * - * @var StateInterface - */ - private $cacheState; - /** * Console response * @@ -45,40 +31,34 @@ class ManagerApp implements AppInterface private $response; /** - * Cache types pool + * Requested changes * - * @var Type\FrontendPool + * @var array */ - private $pool; + private $requestArgs; /** - * Requested changes + * Cache manager * - * @var array + * @var Manager */ - private $request; + private $cacheManager; /** * Constructor * - * @param TypeListInterface $cacheTypeList - * @param StateInterface $cacheState + * @param Manager $cacheManager * @param Response $response - * @param Type\FrontendPool $pool - * @param array $request + * @param array $requestArgs */ public function __construct( - TypeListInterface $cacheTypeList, - StateInterface $cacheState, + Manager $cacheManager, Response $response, - Type\FrontendPool $pool, - array $request + array $requestArgs ) { - $this->cacheTypeList = $cacheTypeList; - $this->cacheState = $cacheState; + $this->cacheManager = $cacheManager; $this->response = $response; - $this->pool = $pool; - $this->request = $request; + $this->requestArgs = $requestArgs; } /** @@ -87,125 +67,69 @@ public function __construct( */ public function launch() { - $this->response->terminateOnSend(false); + $output = []; $types = $this->getRequestedTypes(); - $queue = $this->updateStatus($types); - $this->clean($queue, $types); - return $this->response; - } - /** - * Maps requested type from request into the current registry of types - * - * @return string[] - */ - private function getRequestedTypes() - { - $requested = isset($this->request[self::KEY_TYPES]) ? explode(',', $this->request[self::KEY_TYPES]) : []; - $result = []; - foreach (array_keys($this->cacheTypeList->getTypes()) as $type) { - if (empty($requested) || in_array($type, $requested)) { - $result[] = $type; - } - } - return $result; - } - - /** - * Updates cache status for the requested types - * - * @param string[] $types - * @return string[] Queue of affected cache types that need cleanup - */ - private function updateStatus($types) - { - if (!isset($this->request[self::KEY_SET])) { - return []; - } - $isEnabled = (bool)(int)$this->request[self::KEY_SET]; - $isUpdated = false; - $cleanQueue = []; - foreach ($types as $type) { - if ($this->cacheState->isEnabled($type) === $isEnabled) { // no need to poke it, if is not going to change - continue; - } - $this->cacheState->setEnabled($type, $isEnabled); - $isUpdated = true; + $enabledTypes = []; + if (isset($this->requestArgs[self::KEY_SET])) { + $isEnabled = (bool)(int)$this->requestArgs[self::KEY_SET]; + $changedTypes = $this->cacheManager->setEnabled($types, $isEnabled); if ($isEnabled) { - $cleanQueue[] = $type; + $enabledTypes = $changedTypes; + } + if ($changedTypes) { + $output[] = 'Changed cache status:'; + foreach ($changedTypes as $type) { + $output[] = sprintf('%30s: %d -> %d', $type, !$isEnabled, $isEnabled); + } + } else { + $output[] = 'There is nothing to change in cache status'; } } - if ($isUpdated) { - $this->cacheState->persist(); + if (isset($this->requestArgs[self::KEY_FLUSH])) { + $this->cacheManager->flush($types); + $output[] = 'Flushed cache types: ' . join(', ', $types); + } elseif (isset($this->requestArgs[self::KEY_CLEAN])) { + $this->cacheManager->clean($types); + $output[] = 'Cleaned cache types: ' . join(', ', $types); + } elseif (!empty($enabledTypes)) { + $this->cacheManager->clean($enabledTypes); + $output[] = 'Cleaned cache types: ' . join(', ', $enabledTypes); } - return $cleanQueue; - } - - /** - * Cleans up or flushes caches (depending on what was requested) - * - * Types listed at the "required" argument are mandatory to clean. - * But try flush first, as it is more efficient. So if something was requested or required and flushed, then there - * is no need to clean it anymore. - * - * @param string[] $required - * @param string[] $requested - * @return void - */ - private function clean($required, $requested) - { - $flushed = $this->flush($requested); - if (isset($this->request[self::KEY_CLEAN])) { - $types = array_merge($requested, $required); - } else { - $types = $required; - } - foreach ($types as $type) { - $frontend = $this->pool->get($type); - if (in_array($type, $flushed)) { // it was already flushed - continue; - } - $frontend->clean(); + $output[] = 'Current status:'; + foreach ($this->cacheManager->getStatus() as $cache => $status) { + $output[] = sprintf('%30s: %d', $cache, $status); } + $this->response->setBody(join("\n", $output)); + return $this->response; } /** - * Flushes specified cache storages - * - * Returns array of types which were flushed + * Maps requested type from request into the current registry of types * - * @param string[] $types * @return string[] + * @throws \InvalidArgumentException */ - private function flush($types) + private function getRequestedTypes() { - $result = []; - if (isset($this->request[self::KEY_FLUSH])) { - foreach ($types as $type) { - $frontend = $this->pool->get($type); - $backend = $frontend->getBackend(); - if (in_array($backend, $result, true)) { // it was already flushed from another frontend - continue; - } - $backend->clean(); - $result[$type] = $backend; - } + $requestedTypes = []; + if (isset($this->requestArgs[self::KEY_TYPES])) { + $requestedTypes = explode(',', $this->requestArgs[self::KEY_TYPES]); + $requestedTypes = array_filter(array_map('trim', $requestedTypes), 'strlen'); } - return array_keys($result); - } - - /** - * Presents summary about cache status - * - * @return array - */ - public function getStatusSummary() - { - $result = []; - foreach ($this->cacheTypeList->getTypes() as $type) { - $result[$type['id']] = $type['status']; + $availableTypes = $this->cacheManager->getAvailableTypes(); + if (empty($requestedTypes)) { + return $availableTypes; + } else { + $unsupportedTypes = array_diff($requestedTypes, $availableTypes); + if ($unsupportedTypes) { + throw new \InvalidArgumentException( + "The following requested cache types are not supported: '" . join("', '", $unsupportedTypes) + . "'.\nSupported types: " . join(", ", $availableTypes) . "" + ); + } + return array_values(array_intersect($availableTypes, $requestedTypes)); } - return $result; } /** @@ -213,6 +137,9 @@ public function getStatusSummary() */ public function catchException(App\Bootstrap $bootstrap, \Exception $exception) { + $this->response->setBody($exception->getMessage()); + $this->response->terminateOnSend(false); + $this->response->sendResponse(); return false; } } diff --git a/lib/internal/Magento/Framework/App/Cache/State.php b/lib/internal/Magento/Framework/App/Cache/State.php index 81453c6efb175..92e861aec2f4e 100644 --- a/lib/internal/Magento/Framework/App/Cache/State.php +++ b/lib/internal/Magento/Framework/App/Cache/State.php @@ -6,77 +6,57 @@ */ namespace Magento\Framework\App\Cache; +use Magento\Framework\App\Cache\Type\ConfigSegment; +use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\DeploymentConfig\Writer; + class State implements StateInterface { - /** - * Cache identifier used to store cache type statuses - */ - const CACHE_ID = 'core_cache_options'; - /** * Disallow cache */ const PARAM_BAN_CACHE = 'global_ban_use_cache'; /** - * Persistent storage of cache type statuses + * Deployment configuration * - * @var State\OptionsInterface + * @var DeploymentConfig */ - private $_options; + private $config; /** - * Cache frontend to delegate actual cache operations to + * Deployment configuration storage writer * - * @var \Magento\Framework\Cache\FrontendInterface + * @var Writer */ - private $_cacheFrontend; + private $writer; /** * Associative array of cache type codes and their statuses (enabled/disabled) * * @var array */ - private $_typeStatuses = []; + private $statuses; /** - * @param State\OptionsInterface $options - * @param \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool - * @param bool $banAll Whether all cache types are forced to be disabled + * Whether all cache types are forced to be disabled + * + * @var bool */ - public function __construct( - State\OptionsInterface $options, - \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool, - $banAll = false - ) { - $this->_options = $options; - $this->_cacheFrontend = - $cacheFrontendPool->get(\Magento\Framework\App\Cache\Frontend\Pool::DEFAULT_FRONTEND_ID); - $this->_loadTypeStatuses($banAll); - } + private $banAll; /** - * Load statuses (enabled/disabled) of cache types + * Constructor * - * @param bool $forceDisableAll - * @return void + * @param DeploymentConfig $config + * @param Writer $writer + * @param bool $banAll */ - private function _loadTypeStatuses($forceDisableAll = false) + public function __construct(DeploymentConfig $config, Writer $writer, $banAll = false) { - $typeOptions = $this->_cacheFrontend->load(self::CACHE_ID); - if ($typeOptions !== false) { - $typeOptions = unserialize($typeOptions); - } else { - $typeOptions = $this->_options->getAllOptions(); - if ($typeOptions !== false) { - $this->_cacheFrontend->save(serialize($typeOptions), self::CACHE_ID); - } - } - if ($typeOptions) { - foreach ($typeOptions as $cacheType => $isTypeEnabled) { - $this->setEnabled($cacheType, $isTypeEnabled && !$forceDisableAll); - } - } + $this->config = $config; + $this->writer = $writer; + $this->banAll = $banAll; } /** @@ -87,7 +67,8 @@ private function _loadTypeStatuses($forceDisableAll = false) */ public function isEnabled($cacheType) { - return isset($this->_typeStatuses[$cacheType]) ? (bool)$this->_typeStatuses[$cacheType] : false; + $this->load(); + return isset($this->statuses[$cacheType]) ? (bool)$this->statuses[$cacheType] : false; } /** @@ -99,7 +80,8 @@ public function isEnabled($cacheType) */ public function setEnabled($cacheType, $isEnabled) { - $this->_typeStatuses[$cacheType] = (int)$isEnabled; + $this->load(); + $this->statuses[$cacheType] = (int)$isEnabled; } /** @@ -109,7 +91,24 @@ public function setEnabled($cacheType, $isEnabled) */ public function persist() { - $this->_options->saveAllOptions($this->_typeStatuses); - $this->_cacheFrontend->remove(self::CACHE_ID); + $this->load(); + $segment = new ConfigSegment($this->statuses); + $this->writer->update($segment); + } + + /** + * Load statuses (enabled/disabled) of cache types + * + * @return void + */ + private function load() + { + if (null === $this->statuses) { + $this->statuses = []; + if ($this->banAll) { + return; + } + $this->statuses = $this->config->getSegment(ConfigSegment::SEGMENT_KEY) ?: []; + } } } diff --git a/lib/internal/Magento/Framework/App/Cache/State/Options.php b/lib/internal/Magento/Framework/App/Cache/State/Options.php deleted file mode 100644 index c532a1532c8d8..0000000000000 --- a/lib/internal/Magento/Framework/App/Cache/State/Options.php +++ /dev/null @@ -1,76 +0,0 @@ -_init('core_cache_option', 'code'); - } - - /** - * Get all cache options - * - * @return array|false - */ - public function getAllOptions() - { - $adapter = $this->_getReadAdapter(); - if ($adapter) { - /** - * Check if table exist (it protect upgrades. cache settings checked before upgrades) - */ - if ($adapter->isTableExists($this->getMainTable())) { - $select = $adapter->select()->from($this->getMainTable(), ['code', 'value']); - return $adapter->fetchPairs($select); - } - } - return false; - } - - /** - * Save all options to option table - * - * @param array $options - * @return $this - * @throws \Exception - */ - public function saveAllOptions($options) - { - $adapter = $this->_getWriteAdapter(); - if (!$adapter) { - return $this; - } - - $data = []; - foreach ($options as $code => $value) { - $data[] = [$code, $value]; - } - - $adapter->beginTransaction(); - try { - $this->_getWriteAdapter()->delete($this->getMainTable()); - if ($data) { - $this->_getWriteAdapter()->insertArray($this->getMainTable(), ['code', 'value'], $data); - } - } catch (\Exception $e) { - $adapter->rollback(); - throw $e; - } - $adapter->commit(); - - return $this; - } -} diff --git a/lib/internal/Magento/Framework/App/Cache/State/OptionsInterface.php b/lib/internal/Magento/Framework/App/Cache/State/OptionsInterface.php deleted file mode 100644 index 197291d31b535..0000000000000 --- a/lib/internal/Magento/Framework/App/Cache/State/OptionsInterface.php +++ /dev/null @@ -1,23 +0,0 @@ - $value) { + if (!preg_match('/^[a-z_]+$/i', $key)) { + throw new \InvalidArgumentException("Invalid cache type key: {$key}"); + } + $data[$key] = (int)$value; + } + parent::__construct($data); + } + + /** + * {@inheritdoc} + */ + public function getKey() + { + return self::SEGMENT_KEY; + } +} diff --git a/lib/internal/Magento/Framework/App/Console/Response.php b/lib/internal/Magento/Framework/App/Console/Response.php index 1a55dcb56fc3b..1da4034b6038b 100644 --- a/lib/internal/Magento/Framework/App/Console/Response.php +++ b/lib/internal/Magento/Framework/App/Console/Response.php @@ -20,6 +20,13 @@ class Response implements \Magento\Framework\App\ResponseInterface */ protected $code = 0; + /** + * Text to output on send response + * + * @var string + */ + private $body; + /** * Set whether to terminate process on send or not * @@ -29,10 +36,14 @@ class Response implements \Magento\Framework\App\ResponseInterface /** * Send response to client + * * @return int */ public function sendResponse() { + if (!empty($this->body)) { + echo $this->body; + } if ($this->terminateOnSend) { exit($this->code); } @@ -40,6 +51,29 @@ public function sendResponse() } /** + * Get body + * + * @return string + */ + public function getBody() + { + return $this->body; + } + + /** + * Set body + * + * @param string $body + * @return void + */ + public function setBody($body) + { + $this->body = $body; + } + + /** + * Set exit code + * * @param int $code * @return void */ diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig.php b/lib/internal/Magento/Framework/App/DeploymentConfig.php index cb98d1942390b..8911207942283 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig.php @@ -83,6 +83,7 @@ public function get($key = null, $defaultValue = null) */ public function isAvailable() { + $this->data = null; $this->load(); return $this->isAvailable; } diff --git a/lib/internal/Magento/Framework/App/Http.php b/lib/internal/Magento/Framework/App/Http.php index 89f04c1f949cf..ca92933673b91 100644 --- a/lib/internal/Magento/Framework/App/Http.php +++ b/lib/internal/Magento/Framework/App/Http.php @@ -20,14 +20,6 @@ */ class Http implements \Magento\Framework\AppInterface { - /**#@+ - * Parameters for redirecting if the application is not installed - */ - const NOT_INSTALLED_URL_PATH_PARAM = 'MAGE_NOT_INSTALLED_URL_PATH'; - const NOT_INSTALLED_URL_PARAM = 'MAGE_NOT_INSTALLED_URL'; - const NOT_INSTALLED_URL_PATH = 'setup/'; - /**#@-*/ - /** * @var \Magento\Framework\ObjectManagerInterface */ @@ -141,8 +133,8 @@ public function launch() public function catchException(Bootstrap $bootstrap, \Exception $exception) { $result = $this->handleDeveloperMode($bootstrap, $exception) - || $this->handleBootstrapErrors($bootstrap) - || $this->handleSessionException($bootstrap, $exception) + || $this->handleBootstrapErrors($bootstrap, $exception) + || $this->handleSessionException($exception) || $this->handleInitException($exception) || $this->handleGenericReport($bootstrap, $exception); return $result; @@ -159,8 +151,12 @@ private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception { if ($bootstrap->isDeveloperMode()) { if (Bootstrap::ERR_IS_INSTALLED == $bootstrap->getErrorCode()) { - $this->redirectToSetup($bootstrap); - return true; + try { + $this->redirectToSetup($bootstrap, $exception); + return true; + } catch (\Exception $e) { + $exception = $e; + } } $this->_response->setHttpResponseCode(500); $this->_response->setHeader('Content-Type', 'text/plain'); @@ -172,25 +168,36 @@ private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception } /** - * If not installed, redirect to setup + * If not installed, try to redirect to installation wizard * * @param Bootstrap $bootstrap + * @param \Exception $exception * @return void + * @throws \Exception */ - private function redirectToSetup(Bootstrap $bootstrap) + private function redirectToSetup(Bootstrap $bootstrap, \Exception $exception) { - $path = $this->getInstallerRedirectPath($bootstrap->getParams()); - $this->_response->setRedirect($path); - $this->_response->sendHeaders(); + $setupInfo = new SetupInfo($bootstrap->getParams()); + $projectRoot = $this->_filesystem->getDirectoryRead(DirectoryList::ROOT)->getAbsolutePath(); + if ($setupInfo->isAvailable()) { + $this->_response->setRedirect($setupInfo->getUrl()); + $this->_response->sendHeaders(); + } else { + $newMessage = $exception->getMessage() . "\nNOTE: web setup wizard is not accessible.\n" + . 'In order to install, use Magento Setup CLI or configure web access to the following directory: ' + . $setupInfo->getDir($projectRoot); + throw new \Exception($newMessage, 0, $exception); + } } /** * Handler for bootstrap errors * * @param Bootstrap $bootstrap + * @param \Exception &$exception * @return bool */ - private function handleBootstrapErrors(Bootstrap $bootstrap) + private function handleBootstrapErrors(Bootstrap $bootstrap, \Exception &$exception) { $bootstrapCode = $bootstrap->getErrorCode(); if (Bootstrap::ERR_MAINTENANCE == $bootstrapCode) { @@ -198,8 +205,12 @@ private function handleBootstrapErrors(Bootstrap $bootstrap) return true; } if (Bootstrap::ERR_IS_INSTALLED == $bootstrapCode) { - $this->redirectToSetup($bootstrap); - return true; + try { + $this->redirectToSetup($bootstrap, $exception); + return true; + } catch (\Exception $e) { + $exception = $e; + } } return false; } @@ -207,15 +218,13 @@ private function handleBootstrapErrors(Bootstrap $bootstrap) /** * Handler for session errors * - * @param Bootstrap $bootstrap * @param \Exception $exception * @return bool */ - private function handleSessionException(Bootstrap $bootstrap, \Exception $exception) + private function handleSessionException(\Exception $exception) { if ($exception instanceof \Magento\Framework\Session\Exception) { - $path = $this->getBaseUrlPath($bootstrap->getParams()); - $this->_response->setRedirect($path); + $this->_response->setRedirect($this->_request->getDistroBaseUrl()); $this->_response->sendHeaders(); return true; } @@ -257,44 +266,4 @@ private function handleGenericReport(Bootstrap $bootstrap, \Exception $exception require $this->_filesystem->getDirectoryRead(DirectoryList::PUB)->getAbsolutePath('errors/report.php'); return true; } - - /** - * Determines redirect URL when application is not installed - * - * @param array $server - * @return string - */ - public function getInstallerRedirectPath($server) - { - if (isset($server[self::NOT_INSTALLED_URL_PARAM])) { - return $server[self::NOT_INSTALLED_URL_PARAM]; - } - if (isset($server[self::NOT_INSTALLED_URL_PATH_PARAM])) { - $urlPath = $server[self::NOT_INSTALLED_URL_PATH_PARAM]; - } else { - $urlPath = self::NOT_INSTALLED_URL_PATH; - } - return $this->getBaseUrlPath($server) . $urlPath; - } - - /** - * Determines a base URL path from the environment - * - * @param string $server - * @return string - */ - private function getBaseUrlPath($server) - { - $result = ''; - if (isset($server['SCRIPT_NAME'])) { - $envPath = str_replace('\\', '/', dirname($server['SCRIPT_NAME'])); - if ($envPath != '.' && $envPath != '/') { - $result = $envPath; - } - } - if (!preg_match('/\/$/', $result)) { - $result .= '/'; - } - return $result; - } } diff --git a/lib/internal/Magento/Framework/App/ObjectManager.php b/lib/internal/Magento/Framework/App/ObjectManager.php index 0b5c8eeff44de..ae1402a38a651 100644 --- a/lib/internal/Magento/Framework/App/ObjectManager.php +++ b/lib/internal/Magento/Framework/App/ObjectManager.php @@ -21,9 +21,6 @@ class ObjectManager extends \Magento\Framework\ObjectManager\ObjectManager /** * Retrieve object manager * - * TODO: Temporary solution for serialization, should be removed when Serialization problem is resolved - * - * @deprecated * @return ObjectManager * @throws \RuntimeException */ diff --git a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php index 89348b66d7a6c..165a5f00e9fa2 100644 --- a/lib/internal/Magento/Framework/App/ObjectManagerFactory.php +++ b/lib/internal/Magento/Framework/App/ObjectManagerFactory.php @@ -41,7 +41,7 @@ class ObjectManagerFactory * * @var string */ - protected $_configClassName = 'Magento\Framework\Interception\ObjectManager\Config'; + protected $_configClassName = 'Magento\Framework\Interception\ObjectManager\ConfigInterface'; /** * Environment factory class name @@ -111,7 +111,7 @@ public function create(array $arguments, $useCompiled = true) /** @var EnvironmentInterface $env */ $env = $enFactory->createEnvironment(); - /** @var \Magento\Framework\Interception\ObjectManager\Config $diConfig */ + /** @var \Magento\Framework\Interception\ObjectManager\ConfigInterface $diConfig */ $diConfig = $env->getDiConfig(); $appMode = isset($arguments[State::PARAM_MODE]) ? $arguments[State::PARAM_MODE] : State::MODE_DEFAULT; @@ -136,7 +136,7 @@ public function create(array $arguments, $useCompiled = true) 'Magento\Framework\ObjectManager\RelationsInterface' => $relations, 'Magento\Framework\Interception\DefinitionInterface' => $definitionFactory->createPluginDefinition(), 'Magento\Framework\ObjectManager\ConfigInterface' => $diConfig, - 'Magento\Framework\Interception\ObjectManager\Config' => $diConfig, + 'Magento\Framework\Interception\ObjectManager\ConfigInterface' => $diConfig, 'Magento\Framework\ObjectManager\DefinitionInterface' => $definitions, 'Magento\Framework\Stdlib\BooleanUtils' => $booleanUtils, 'Magento\Framework\ObjectManager\Config\Mapper\Dom' => $argumentMapper, diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index 392174adfdf06..718377b52041e 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -90,15 +90,15 @@ class Http extends \Zend_Controller_Request_Http implements protected $cookieReader; /** - * @var \Magento\Framework\App\Config\ReinitableConfigInterface + * @var \Magento\Framework\ObjectManagerInterface */ - protected $_config; + protected $_objectManager; /** * @param \Magento\Framework\App\Route\ConfigInterface\Proxy $routeConfig * @param PathInfoProcessorInterface $pathInfoProcessor * @param \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader - * @param \Magento\Framework\App\Config\ReinitableConfigInterface $config + * @param \Magento\Framework\ObjectManagerInterface $objectManager, * @param string|null $uri * @param array $directFrontNames */ @@ -106,11 +106,11 @@ public function __construct( \Magento\Framework\App\Route\ConfigInterface\Proxy $routeConfig, PathInfoProcessorInterface $pathInfoProcessor, \Magento\Framework\Stdlib\Cookie\CookieReaderInterface $cookieReader, - \Magento\Framework\App\Config\ReinitableConfigInterface $config, + \Magento\Framework\ObjectManagerInterface $objectManager, $uri = null, $directFrontNames = [] ) { - $this->_config = $config; + $this->_objectManager = $objectManager; $this->_routeConfig = $routeConfig; $this->_directFrontNames = $directFrontNames; parent::__construct($uri); @@ -579,6 +579,27 @@ public function getDistroBaseUrl() return 'http://localhost/'; } + /** + * Determines a base URL path from environment + * + * @param array $server + * @return string + */ + public static function getDistroBaseUrlPath($server) + { + $result = ''; + if (isset($server['SCRIPT_NAME'])) { + $envPath = str_replace('\\', '/', dirname(str_replace('\\', '/', $server['SCRIPT_NAME']))); + if ($envPath != '.' && $envPath != '/') { + $result = $envPath; + } + } + if (!preg_match('/\/$/', $result)) { + $result .= '/'; + } + return $result; + } + /** * Retrieve full action name * @@ -624,9 +645,12 @@ public function isSecure() if ($this->immediateRequestSecure()) { return true; } + /* TODO: Untangle Config dependence on Scope, so that this class can be instantiated even if app is not + installed MAGETWO-31756 */ // Check if a proxy sent a header indicating an initial secure request + $config = $this->_objectManager->get('Magento\Framework\App\Config'); $offLoaderHeader = trim( - (string)$this->_config->getValue( + (string)$config->getValue( self::XML_PATH_OFFLOADER_HEADER, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT ) diff --git a/lib/internal/Magento/Framework/App/Resource/ConnectionFactory.php b/lib/internal/Magento/Framework/App/Resource/ConnectionFactory.php index ba8315769fbcd..312ea29613085 100644 --- a/lib/internal/Magento/Framework/App/Resource/ConnectionFactory.php +++ b/lib/internal/Magento/Framework/App/Resource/ConnectionFactory.php @@ -7,6 +7,7 @@ namespace Magento\Framework\App\Resource; use Magento\Framework\Model\Resource\Type\Db\ConnectionFactory as ModelConnectionFactory; +use Magento\Framework\DB\Adapter\DdlCache; class ConnectionFactory extends ModelConnectionFactory { @@ -20,10 +21,9 @@ class ConnectionFactory extends ModelConnectionFactory public function create(array $connectionConfig) { $connection = parent::create($connectionConfig); - /** @var \Magento\Framework\App\CacheInterface $cache */ - $cache = $this->objectManager->get('Magento\Framework\App\CacheInterface'); - $connection->setCacheAdapter($cache->getFrontend()); - + /** @var \Magento\Framework\App\Cache\Type\FrontendPool $pool */ + $pool = $this->objectManager->get('Magento\Framework\App\Cache\Type\FrontendPool'); + $connection->setCacheAdapter($pool->get(DdlCache::TYPE_IDENTIFIER)); return $connection; } } diff --git a/lib/internal/Magento/Framework/App/SetupInfo.php b/lib/internal/Magento/Framework/App/SetupInfo.php new file mode 100644 index 0000000000000..da707f20519da --- /dev/null +++ b/lib/internal/Magento/Framework/App/SetupInfo.php @@ -0,0 +1,150 @@ +server = $server; + if (empty($server['DOCUMENT_ROOT'])) { + throw new \InvalidArgumentException('DOCUMENT_ROOT variable is unavailable.'); + } + $this->docRoot = str_replace('\\', '/', $server['DOCUMENT_ROOT']); + $this->projectRoot = $projectRoot ?: $this->detectProjectRoot(); + $this->projectRoot = str_replace('\\', '/', $this->projectRoot); + } + + /** + * Automatically detects project root from current environment + * + * Assumptions: + * if the current setup application relative path is at the end of script path, then it is setup application + * otherwise it is the "main" application + * + * @return mixed + * @throws \InvalidArgumentException + */ + private function detectProjectRoot() + { + if (empty($this->server['SCRIPT_FILENAME'])) { + throw new \InvalidArgumentException('Project root cannot be automatically detected.'); + } + $haystack = str_replace('\\', '/', dirname($this->server['SCRIPT_FILENAME'])); + $needle = '/' . $this->getPath(); + $isSetupApp = preg_match('/^(.+?)' . preg_quote($needle, '/') . '$/', $haystack, $matches); + if ($isSetupApp) { + return $matches[1]; + } + return $haystack; + } + + /** + * Gets setup application URL + * + * @return string + */ + public function getUrl() + { + if (isset($this->server[self::PARAM_NOT_INSTALLED_URL])) { + return $this->server[self::PARAM_NOT_INSTALLED_URL]; + } + return Request\Http::getDistroBaseUrlPath($this->server) . $this->getPath() . '/'; + } + + /** + * Gets the "main" application URL + * + * @return string + */ + public function getProjectUrl() + { + $isProjectInDocRoot = false !== strpos($this->projectRoot . '/', $this->docRoot . '/'); + if (!$isProjectInDocRoot || empty($this->server['HTTP_HOST'])) { + return ''; + } + return 'http://' . $this->server['HTTP_HOST'] . substr($this->projectRoot . '/', strlen($this->docRoot)); + } + + /** + * Gets setup application directory path in the filesystem + * + * @param string $projectRoot + * @return string + */ + public function getDir($projectRoot) + { + return rtrim($projectRoot, '/') . '/' . $this->getPath(); + } + + /** + * Checks if the setup application is available in current document root + * + * @return bool + */ + public function isAvailable() + { + $setupDir = $this->getDir($this->projectRoot); + $isSubDir = false !== strpos($setupDir . '/', $this->docRoot . '/'); + return $isSubDir && realpath($setupDir); + } + + /** + * Gets relative path to setup application + * + * @return string + */ + private function getPath() + { + if (isset($this->server[self::PARAM_NOT_INSTALLED_URL_PATH])) { + return trim($this->server[self::PARAM_NOT_INSTALLED_URL_PATH], '/'); + } + return self::DEFAULT_PATH; + } +} diff --git a/lib/internal/Magento/Framework/AppInterface.php b/lib/internal/Magento/Framework/AppInterface.php index 88815304ed899..0d7eba988973a 100644 --- a/lib/internal/Magento/Framework/AppInterface.php +++ b/lib/internal/Magento/Framework/AppInterface.php @@ -16,7 +16,7 @@ interface AppInterface /** * Magento version */ - const VERSION = '0.1.0-alpha107'; + const VERSION = '0.1.0-alpha108'; /** * Launch application diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Less.php b/lib/internal/Magento/Framework/Css/PreProcessor/Less.php index 6ee1e44b8b93b..c67d0934bf558 100644 --- a/lib/internal/Magento/Framework/Css/PreProcessor/Less.php +++ b/lib/internal/Magento/Framework/Css/PreProcessor/Less.php @@ -42,7 +42,7 @@ public function process(\Magento\Framework\View\Asset\PreProcessor\Chain $chain) $cssTrimmedContent = trim($cssContent); if (!empty($cssTrimmedContent)) { $chain->setContent($cssContent); - $chain->setContentType('css'); } + $chain->setContentType('css'); } } diff --git a/lib/internal/Magento/Framework/DB/Adapter/DdlCache.php b/lib/internal/Magento/Framework/DB/Adapter/DdlCache.php new file mode 100644 index 0000000000000..341acd87e1d7a --- /dev/null +++ b/lib/internal/Magento/Framework/DB/Adapter/DdlCache.php @@ -0,0 +1,35 @@ +get(self::TYPE_IDENTIFIER), self::CACHE_TAG); + } +} diff --git a/lib/internal/Magento/Framework/Encryption/CryptFactory.php b/lib/internal/Magento/Framework/Encryption/CryptFactory.php deleted file mode 100644 index 4668ca242a0e0..0000000000000 --- a/lib/internal/Magento/Framework/Encryption/CryptFactory.php +++ /dev/null @@ -1,39 +0,0 @@ -_objectManager = $objectManager; - } - - /** - * Create new magento crypt instance - * - * @param array $data - * @return \Magento\Framework\Encryption\Crypt - */ - public function create($data = []) - { - return $this->_objectManager->create('Magento\Framework\Encryption\Crypt', $data); - } -} diff --git a/lib/internal/Magento/Framework/Encryption/Encryptor.php b/lib/internal/Magento/Framework/Encryption/Encryptor.php index e82c98df220f0..eb7c2d57b0305 100644 --- a/lib/internal/Magento/Framework/Encryption/Encryptor.php +++ b/lib/internal/Magento/Framework/Encryption/Encryptor.php @@ -12,50 +12,91 @@ class Encryptor implements EncryptorInterface { /** - * Crypt key + * Array key of encryption key in deployment config */ const PARAM_CRYPT_KEY = 'crypt/key'; + /**#@+ + * Hash and Cipher versions + */ + const HASH_VERSION_MD5 = 0; + + const HASH_VERSION_SHA256 = 1; + + const HASH_VERSION_LATEST = 1; + + const CIPHER_BLOWFISH = 0; + + const CIPHER_RIJNDAEL_128 = 1; + + const CIPHER_RIJNDAEL_256 = 2; + + const CIPHER_LATEST = 2; + /**#@-*/ + /** * Default length of salt in bytes */ const DEFAULT_SALT_LENGTH = 32; /** - * @var \Magento\Framework\Math\Random + * Indicate cipher + * + * @var int */ - protected $_randomGenerator; + protected $cipher = self::CIPHER_LATEST; /** - * Cryptographic key + * Version of encryption key * - * @var string + * @var int */ - protected $_cryptKey; + protected $keyVersion; /** - * @var \Magento\Framework\Encryption\CryptFactory + * Array of encryption keys + * + * @var string[] */ - protected $_cryptFactory; + protected $keys = []; /** - * @var \Magento\Framework\Encryption\Crypt + * @var \Magento\Framework\Math\Random */ - protected $_crypt; + protected $randomGenerator; /** * @param \Magento\Framework\Math\Random $randomGenerator - * @param \Magento\Framework\Encryption\CryptFactory $cryptFactory * @param DeploymentConfig $deploymentConfig */ public function __construct( \Magento\Framework\Math\Random $randomGenerator, - \Magento\Framework\Encryption\CryptFactory $cryptFactory, DeploymentConfig $deploymentConfig ) { - $this->_randomGenerator = $randomGenerator; - $this->_cryptFactory = $cryptFactory; - $this->_cryptKey = $deploymentConfig->get(self::PARAM_CRYPT_KEY); + $this->randomGenerator = $randomGenerator; + // load all possible keys + $this->keys = preg_split('/\s+/s', trim($deploymentConfig->get(self::PARAM_CRYPT_KEY))); + $this->keyVersion = count($this->keys) - 1; + } + + /** + * Check whether specified cipher version is supported + * + * Returns matched supported version or throws exception + * + * @param int $version + * @return int + * @throws \Exception + */ + public function validateCipher($version) + { + $types = [self::CIPHER_BLOWFISH, self::CIPHER_RIJNDAEL_128, self::CIPHER_RIJNDAEL_256]; + + $version = (int)$version; + if (!in_array($version, $types, true)) { + throw new \Exception(__('Not supported cipher version')); + } + return $version; } /** @@ -80,7 +121,7 @@ public function getHash($password, $salt = false) $salt = self::DEFAULT_SALT_LENGTH; } if (is_integer($salt)) { - $salt = $this->_randomGenerator->getRandomString($salt); + $salt = $this->randomGenerator->getRandomString($salt); } return $this->hash($salt . $password) . ':' . $salt; } @@ -89,11 +130,15 @@ public function getHash($password, $salt = false) * Hash a string * * @param string $data + * @param int $version * @return string */ - public function hash($data) + public function hash($data, $version = self::HASH_VERSION_LATEST) { - return md5($data); + if (self::HASH_VERSION_MD5 === $version) { + return md5($data); + } + return hash('sha256', $data); } /** @@ -101,50 +146,110 @@ public function hash($data) * * @param string $password * @param string $hash - * @throws \InvalidArgumentException * @return bool */ public function validateHash($password, $hash) { - $hashArr = explode(':', $hash); - switch (count($hashArr)) { - case 1: - return $this->hash($password) === $hash; - case 2: - return $this->hash($hashArr[1] . $password) === $hashArr[0]; - default: - break; + return $this->validateHashByVersion( + $password, + $hash, + self::HASH_VERSION_SHA256 + ) || $this->validateHashByVersion( + $password, + $hash, + self::HASH_VERSION_MD5 + ); + } + + /** + * Validate hash by specified version + * + * @param string $password + * @param string $hash + * @param int $version + * @return bool + */ + public function validateHashByVersion($password, $hash, $version = self::HASH_VERSION_LATEST) + { + // look for salt + $hashArr = explode(':', $hash, 2); + if (1 === count($hashArr)) { + return $this->hash($password, $version) === $hash; } - throw new \InvalidArgumentException('Invalid hash.'); + list($hash, $salt) = $hashArr; + return $this->hash($salt . $password, $version) === $hash; } /** - * Encrypt a string + * Prepend key and cipher versions to encrypted data after encrypting * * @param string $data * @return string */ public function encrypt($data) { - if (empty($this->_cryptKey)) { + $crypt = $this->getCrypt(); + if (null === $crypt) { return $data; } - return base64_encode($this->_getCrypt()->encrypt((string)$data)); + return $this->keyVersion . ':' . $this->cipher . ':' . (MCRYPT_MODE_CBC === + $crypt->getMode() ? $crypt->getInitVector() . ':' : '') . base64_encode( + $crypt->encrypt((string)$data) + ); } /** - * Decrypt a string + * Look for key and crypt versions in encrypted data before decrypting + * + * Unsupported/unspecified key version silently fallback to the oldest we have + * Unsupported cipher versions eventually throw exception + * Unspecified cipher version fallback to the oldest we support * * @param string $data * @return string */ public function decrypt($data) { - if (empty($this->_cryptKey)) { - return $data; - } + if ($data) { + $parts = explode(':', $data, 4); + $partsCount = count($parts); - return trim($this->_getCrypt()->decrypt(base64_decode((string)$data))); + $initVector = false; + // specified key, specified crypt, specified iv + if (4 === $partsCount) { + list($keyVersion, $cryptVersion, $iv, $data) = $parts; + $initVector = $iv ? $iv : false; + $keyVersion = (int)$keyVersion; + $cryptVersion = self::CIPHER_RIJNDAEL_256; + // specified key, specified crypt + } elseif (3 === $partsCount) { + list($keyVersion, $cryptVersion, $data) = $parts; + $keyVersion = (int)$keyVersion; + $cryptVersion = (int)$cryptVersion; + // no key version = oldest key, specified crypt + } elseif (2 === $partsCount) { + list($cryptVersion, $data) = $parts; + $keyVersion = 0; + $cryptVersion = (int)$cryptVersion; + // no key version = oldest key, no crypt version = oldest crypt + } elseif (1 === $partsCount) { + $keyVersion = 0; + $cryptVersion = self::CIPHER_BLOWFISH; + // not supported format + } else { + return ''; + } + // no key for decryption + if (!isset($this->keys[$keyVersion])) { + return ''; + } + $crypt = $this->getCrypt($this->keys[$keyVersion], $cryptVersion, $initVector); + if (null === $crypt) { + return ''; + } + return trim($crypt->decrypt(base64_decode((string)$data))); + } + return ''; } /** @@ -152,27 +257,80 @@ public function decrypt($data) * * @param string|null $key NULL value means usage of the default key specified on constructor * @return \Magento\Framework\Encryption\Crypt + * @throws \Exception */ public function validateKey($key) { - return $this->_getCrypt($key); + if (preg_match('/\s/s', $key)) { + throw new \Exception(__('The encryption key format is invalid.')); + } + return $this->getCrypt($key); } /** - * Instantiate crypt model + * Attempt to append new key & version * - * @param string|null $key NULL value means usage of the default key specified on constructor - * @return \Magento\Framework\Encryption\Crypt + * @param string $key + * @return $this */ - protected function _getCrypt($key = null) + public function setNewKey($key) { - if ($key === null) { - if (!$this->_crypt) { - $this->_crypt = $this->_cryptFactory->create(['key' => $this->_cryptKey]); - } - return $this->_crypt; + $this->validateKey($key); + $this->keys[] = $key; + $this->keyVersion += 1; + return $this; + } + + /** + * Export current keys as string + * + * @return string + */ + public function exportKeys() + { + return implode("\n", $this->keys); + } + + /** + * Initialize crypt module if needed + * + * By default initializes with latest key and crypt versions + * + * @param string $key + * @param int $cipherVersion + * @param bool $initVector + * @return Crypt|null + */ + protected function getCrypt($key = null, $cipherVersion = null, $initVector = true) + { + if (null === $key && null === $cipherVersion) { + $cipherVersion = self::CIPHER_RIJNDAEL_256; + } + + if (null === $key) { + $key = $this->keys[$this->keyVersion]; + } + + if (!$key) { + return null; + } + + if (null === $cipherVersion) { + $cipherVersion = $this->cipher; + } + $cipherVersion = $this->validateCipher($cipherVersion); + + if ($cipherVersion === self::CIPHER_RIJNDAEL_128) { + $cipher = MCRYPT_RIJNDAEL_128; + $mode = MCRYPT_MODE_ECB; + } elseif ($cipherVersion === self::CIPHER_RIJNDAEL_256) { + $cipher = MCRYPT_RIJNDAEL_256; + $mode = MCRYPT_MODE_CBC; } else { - return $this->_cryptFactory->create(['key' => $key]); + $cipher = MCRYPT_BLOWFISH; + $mode = MCRYPT_MODE_ECB; } + + return new Crypt($key, $cipher, $mode, $initVector); } } diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php index 186134bbc3297..0f6a781312fb7 100644 --- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php +++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php @@ -120,8 +120,7 @@ public function setConfig($config = []) * @param int $port * @param boolean $secure * @return $this - * - * @deprecated since 1.4.0.0-rc1 @TODO MAGETWO-31680 + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function connect($host, $port = 80, $secure = false) { diff --git a/lib/internal/Magento/Framework/Interception/Config/Config.php b/lib/internal/Magento/Framework/Interception/Config/Config.php index d71940c08a5fa..360c8e8f45331 100644 --- a/lib/internal/Magento/Framework/Interception/Config/Config.php +++ b/lib/internal/Magento/Framework/Interception/Config/Config.php @@ -11,7 +11,7 @@ class Config implements \Magento\Framework\Interception\ConfigInterface /** * Type configuration * - * @var \Magento\Framework\ObjectManager\ConfigInterface + * @var \Magento\Framework\Interception\ObjectManager\ConfigInterface */ protected $_omConfig; @@ -74,7 +74,7 @@ class Config implements \Magento\Framework\Interception\ConfigInterface * @param \Magento\Framework\Config\ScopeListInterface $scopeList * @param \Magento\Framework\Cache\FrontendInterface $cache * @param \Magento\Framework\ObjectManager\RelationsInterface $relations - * @param \Magento\Framework\Interception\ObjectManager\Config $omConfig + * @param \Magento\Framework\Interception\ObjectManager\ConfigInterface $omConfig * @param \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions * @param string $cacheId */ @@ -83,7 +83,7 @@ public function __construct( \Magento\Framework\Config\ScopeListInterface $scopeList, \Magento\Framework\Cache\FrontendInterface $cache, \Magento\Framework\ObjectManager\RelationsInterface $relations, - \Magento\Framework\Interception\ObjectManager\Config $omConfig, + \Magento\Framework\Interception\ObjectManager\ConfigInterface $omConfig, \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions, $cacheId = 'interception' ) { @@ -166,6 +166,9 @@ protected function _inheritInterception($type) */ public function hasPlugins($type) { - return isset($this->_intercepted[$type]) ? $this->_intercepted[$type] : $this->_inheritInterception($type); + if (isset($this->_intercepted[$type])) { + return $this->_intercepted[$type]; + } + return $this->_inheritInterception($type); } } diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php new file mode 100644 index 0000000000000..2818966423ff2 --- /dev/null +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Compiled.php @@ -0,0 +1,54 @@ +interceptionConfig = $interceptionConfig; + } + + /** + * Retrieve instance type with interception processing + * + * @param string $instanceName + * @return string + */ + public function getInstanceType($instanceName) + { + $type = parent::getInstanceType($instanceName); + if ($this->interceptionConfig && $this->interceptionConfig->hasPlugins($instanceName)) { + return $type . '\\Interceptor'; + } + return $type; + } + + /** + * Retrieve instance type without interception processing + * + * @param string $instanceName + * @return string + */ + public function getOriginalInstanceType($instanceName) + { + return parent::getInstanceType($instanceName); + } +} diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/Config.php b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Developer.php similarity index 85% rename from lib/internal/Magento/Framework/Interception/ObjectManager/Config.php rename to lib/internal/Magento/Framework/Interception/ObjectManager/Config/Developer.php index 0b7dfb0098333..ba008bd4821e8 100644 --- a/lib/internal/Magento/Framework/Interception/ObjectManager/Config.php +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/Config/Developer.php @@ -4,9 +4,11 @@ * * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Framework\Interception\ObjectManager; +namespace Magento\Framework\Interception\ObjectManager\Config; -class Config extends \Magento\Framework\ObjectManager\Config\ProxyConfig +use Magento\Framework\Interception\ObjectManager\ConfigInterface; + +class Developer extends \Magento\Framework\ObjectManager\Config\Config implements ConfigInterface { /** * @var \Magento\Framework\Interception\ConfigInterface diff --git a/lib/internal/Magento/Framework/Interception/ObjectManager/ConfigInterface.php b/lib/internal/Magento/Framework/Interception/ObjectManager/ConfigInterface.php new file mode 100644 index 0000000000000..40480e34b7942 --- /dev/null +++ b/lib/internal/Magento/Framework/Interception/ObjectManager/ConfigInterface.php @@ -0,0 +1,24 @@ +getTranslationList('windowstotimezone'); - ksort($zones); - foreach ($zones as $code => $name) { - $name = trim($name); - $options[] = ['label' => empty($name) ? $code : $name . ' (' . $code . ')', 'value' => $code]; + $zones = $this->getTranslationList('timezonetowindows'); + foreach ($zones as $windowsTimezones => $isoTimezones) { + $windowsTimezones = trim($windowsTimezones); + $options[] = ['label' => empty($windowsTimezones) ? $isoTimezones : $windowsTimezones . ' (' . $isoTimezones . ')', 'value' => $isoTimezones]; } return $this->_sortOptionArray($options); } diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php b/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php index d52eb60d8eea7..aead4c8901f03 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/Collection/AbstractCollection.php @@ -504,7 +504,7 @@ public function join($table, $cond, $cols = '*') $alias = $table; } - if (!isset($this->_joinedTables[$table])) { + if (!isset($this->_joinedTables[$alias])) { $this->getSelect()->join([$alias => $this->getTable($table)], $cond, $cols); $this->_joinedTables[$alias] = true; } diff --git a/lib/internal/Magento/Framework/Module/DbVersionInfo.php b/lib/internal/Magento/Framework/Module/DbVersionInfo.php new file mode 100644 index 0000000000000..30dabf861ad9d --- /dev/null +++ b/lib/internal/Magento/Framework/Module/DbVersionInfo.php @@ -0,0 +1,162 @@ +moduleList = $moduleList; + $this->moduleResource = $moduleResource; + $this->resourceResolver = $resourceResolver; + } + + /** + * Check if DB schema is up to date + * + * @param string $moduleName + * @param string $resourceName + * @return bool + */ + public function isSchemaUpToDate($moduleName, $resourceName) + { + $dbVer = $this->moduleResource->getDbVersion($resourceName); + return $this->isModuleVersionEqual($moduleName, $dbVer); + } + + /** + * @param string $moduleName + * @param string $resourceName + * @return bool + */ + public function isDataUpToDate($moduleName, $resourceName) + { + $dataVer = $this->moduleResource->getDataVersion($resourceName); + return $this->isModuleVersionEqual($moduleName, $dataVer); + } + + /** + * Get array of errors if DB is out of date, return [] if DB is current + * + * @return string[] Array of errors, each error contains module name, current version, required version, + * and type (schema or data). The array will be empty if all schema and data are current. + */ + public function getDbVersionErrors() + { + $errors = []; + foreach ($this->moduleList->getNames() as $moduleName) { + foreach ($this->resourceResolver->getResourceList($moduleName) as $resourceName) { + if (!$this->isSchemaUpToDate($moduleName, $resourceName)) { + $errors[] = $this->getSchemaInfo($moduleName, $resourceName); + } + + if (!$this->isDataUpToDate($moduleName, $resourceName)) { + $errors[] = $this->getDataInfo($moduleName, $resourceName); + } + } + } + return $errors; + } + + /** + * Check if DB schema is up to date, version info if it is not. + * + * @param string $moduleName + * @param string $resourceName + * @return string[] Contains current and needed version strings + */ + private function getSchemaInfo($moduleName, $resourceName) + { + $dbVer = $this->moduleResource->getDbVersion($resourceName); // version saved in DB + $module = $this->moduleList->getOne($moduleName); + $configVer = $module['schema_version']; + $dbVer = $dbVer ?: 'none'; + return [ + self::KEY_CURRENT => $dbVer, + self::KEY_REQUIRED => $configVer, + self::KEY_MODULE => $moduleName, + self::KEY_TYPE => 'schema' + ]; + } + + /** + * Get error data for an out-of-date schema or data. + * + * @param string $moduleName + * @param string $resourceName + * @return string[] + */ + private function getDataInfo($moduleName, $resourceName) + { + $dataVer = $this->moduleResource->getDataVersion($resourceName); + $module = $this->moduleList->getOne($moduleName); + $configVer = $module['schema_version']; + $dataVer = $dataVer ?: 'none'; + return [ + self::KEY_CURRENT => $dataVer, + self::KEY_REQUIRED => $configVer, + self::KEY_MODULE => $moduleName, + self::KEY_TYPE => 'data' + ]; + } + + /** + * Check if DB data is up to date + * + * @param string $moduleName + * @param string|bool $version + * @return bool + * @throws \UnexpectedValueException + */ + private function isModuleVersionEqual($moduleName, $version) + { + $module = $this->moduleList->getOne($moduleName); + if (empty($module['schema_version'])) { + throw new \UnexpectedValueException("Schema version for module '$moduleName' is not specified"); + } + $configVer = $module['schema_version']; + + return ($version !== false + && version_compare($configVer, $version) === SetupInterface::VERSION_COMPARE_EQUAL); + } +} diff --git a/lib/internal/Magento/Framework/Module/Manager.php b/lib/internal/Magento/Framework/Module/Manager.php index d35970146b2cf..e5613986fa9a6 100644 --- a/lib/internal/Magento/Framework/Module/Manager.php +++ b/lib/internal/Magento/Framework/Module/Manager.php @@ -8,6 +8,7 @@ */ namespace Magento\Framework\Module; +use Magento\Framework\Module\Plugin\DbStatusValidator; use Magento\Framework\Module\Updater\SetupInterface; class Manager @@ -27,27 +28,19 @@ class Manager */ private $_outputConfigPaths; - /** - * @var ResourceInterface - */ - private $_moduleResource; - /** * @param Output\ConfigInterface $outputConfig * @param ModuleListInterface $moduleList - * @param ResourceInterface $moduleResource * @param array $outputConfigPaths */ public function __construct( Output\ConfigInterface $outputConfig, ModuleListInterface $moduleList, - ResourceInterface $moduleResource, array $outputConfigPaths = [] ) { $this->_outputConfig = $outputConfig; $this->_moduleList = $moduleList; $this->_outputConfigPaths = $outputConfigPaths; - $this->_moduleResource = $moduleResource; } /** @@ -98,47 +91,4 @@ protected function _isCustomOutputConfigEnabled($moduleName) } return true; } - - /** - * Check if DB schema is up to date - * - * @param string $moduleName - * @param string $resourceName - * @return bool - */ - public function isDbSchemaUpToDate($moduleName, $resourceName) - { - $dbVer = $this->_moduleResource->getDbVersion($resourceName); - return $this->isModuleVersionEqual($moduleName, $dbVer); - } - - /** - * @param string $moduleName - * @param string $resourceName - * @return bool - */ - public function isDbDataUpToDate($moduleName, $resourceName) - { - $dataVer = $this->_moduleResource->getDataVersion($resourceName); - return $this->isModuleVersionEqual($moduleName, $dataVer); - } - - /** - * Check if DB data is up to date - * - * @param string $moduleName - * @param string|bool $version - * @return bool - * @throws \UnexpectedValueException - */ - private function isModuleVersionEqual($moduleName, $version) - { - $module = $this->_moduleList->getOne($moduleName); - if (empty($module['schema_version'])) { - throw new \UnexpectedValueException("Schema version for module '$moduleName' is not specified"); - } - $configVer = $module['schema_version']; - - return ($version !== false && version_compare($configVer, $version) === SetupInterface::VERSION_COMPARE_EQUAL); - } } diff --git a/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php b/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php index 3c629b0cb0496..d5b04050fd460 100644 --- a/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php +++ b/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php @@ -7,6 +7,7 @@ namespace Magento\Framework\Module\Plugin; use Magento\Framework\Cache\FrontendInterface; +use Magento\Framework\Module\DbVersionInfo; class DbStatusValidator { @@ -16,36 +17,20 @@ class DbStatusValidator private $cache; /** - * @var \Magento\Framework\Module\ModuleListInterface + * @var DbVersionInfo */ - private $moduleList; - - /** - * @var \Magento\Framework\Module\ResourceResolverInterface - */ - private $resourceResolver; - - /** - * @var \Magento\Framework\Module\Manager - */ - private $moduleManager; + private $dbVersionInfo; /** * @param FrontendInterface $cache - * @param \Magento\Framework\Module\ModuleListInterface $moduleList - * @param \Magento\Framework\Module\ResourceResolverInterface $resourceResolver - * @param \Magento\Framework\Module\Manager $moduleManager + * @param DbVersionInfo $dbVersionInfo */ public function __construct( FrontendInterface $cache, - \Magento\Framework\Module\ModuleListInterface $moduleList, - \Magento\Framework\Module\ResourceResolverInterface $resourceResolver, - \Magento\Framework\Module\Manager $moduleManager + DbVersionInfo $dbVersionInfo ) { $this->cache = $cache; - $this->moduleList = $moduleList; - $this->resourceResolver = $resourceResolver; - $this->moduleManager = $moduleManager; + $this->dbVersionInfo = $dbVersionInfo; } /** @@ -63,9 +48,12 @@ public function aroundDispatch( \Magento\Framework\App\RequestInterface $request ) { if (!$this->cache->load('db_is_up_to_date')) { - if (!$this->isDbUpToDate()) { + $errors = $this->dbVersionInfo->getDbVersionErrors(); + if ($errors) { + $formattedErrors = $this->formatErrors($errors); throw new \Magento\Framework\Module\Exception( - 'Looks like database is outdated. Please, use setup tool to perform update' + 'Please update your database: Run "php –f index.php update" from the Magento root/setup directory.' + . PHP_EOL . 'The following modules are outdated:' . PHP_EOL . implode(PHP_EOL, $formattedErrors) ); } else { $this->cache->save('true', 'db_is_up_to_date'); @@ -75,21 +63,20 @@ public function aroundDispatch( } /** - * Check if DB is up to date + * Format each error in the error data from getOutOfDataDbErrors into a single message * - * @return bool + * @param array $errorsData array of error data from getOutOfDateDbErrors + * @return array Messages that can be used to log the error */ - private function isDbUpToDate() + private function formatErrors($errorsData) { - foreach ($this->moduleList->getNames() as $moduleName) { - foreach ($this->resourceResolver->getResourceList($moduleName) as $resourceName) { - $isSchemaUpToDate = $this->moduleManager->isDbSchemaUpToDate($moduleName, $resourceName); - $isDataUpToDate = $this->moduleManager->isDbDataUpToDate($moduleName, $resourceName); - if (!$isSchemaUpToDate || !$isDataUpToDate) { - return false; - } - } + $formattedErrors = []; + foreach ($errorsData as $error) { + $formattedErrors[] = $error[DbVersionInfo::KEY_MODULE] . + ' ' . $error[DbVersionInfo::KEY_TYPE] . + ': current version - ' . $error[DbVersionInfo::KEY_CURRENT ] . + ', required version - ' . $error[DbVersionInfo::KEY_REQUIRED]; } - return true; + return $formattedErrors; } } diff --git a/lib/internal/Magento/Framework/Module/Updater.php b/lib/internal/Magento/Framework/Module/Updater.php index b150cf1879ad5..6716daf54329d 100644 --- a/lib/internal/Magento/Framework/Module/Updater.php +++ b/lib/internal/Magento/Framework/Module/Updater.php @@ -24,26 +24,26 @@ class Updater protected $_setupFactory; /** - * @var \Magento\Framework\Module\Manager + * @var DbVersionInfo */ - private $_moduleManager; + private $_dbVersionInfo; /** * @param Updater\SetupFactory $setupFactory * @param ModuleListInterface $moduleList * @param ResourceResolverInterface $resourceResolver - * @param Manager $moduleManager + * @param DbVersionInfo $dbVersionInfo */ public function __construct( Updater\SetupFactory $setupFactory, ModuleListInterface $moduleList, ResourceResolverInterface $resourceResolver, - \Magento\Framework\Module\Manager $moduleManager + DbVersionInfo $dbVersionInfo ) { $this->_moduleList = $moduleList; $this->_resourceResolver = $resourceResolver; $this->_setupFactory = $setupFactory; - $this->_moduleManager = $moduleManager; + $this->_dbVersionInfo = $dbVersionInfo; } /** @@ -55,7 +55,7 @@ public function updateData() { foreach ($this->_moduleList->getNames() as $moduleName) { foreach ($this->_resourceResolver->getResourceList($moduleName) as $resourceName) { - if (!$this->_moduleManager->isDbDataUpToDate($moduleName, $resourceName)) { + if (!$this->_dbVersionInfo->isDataUpToDate($moduleName, $resourceName)) { $this->_setupFactory->create($resourceName, $moduleName)->applyDataUpdates(); } } diff --git a/lib/internal/Magento/Framework/Object.php b/lib/internal/Magento/Framework/Object.php index 91ca1428831c2..438cdad543fa3 100644 --- a/lib/internal/Magento/Framework/Object.php +++ b/lib/internal/Magento/Framework/Object.php @@ -167,7 +167,7 @@ public function addData(array $arr) */ public function setData($key, $value = null) { - if (is_array($key)) { + if ($key === (array)$key) { if ($this->_data !== $key) { $this->_hasDataChanges = true; } @@ -189,14 +189,14 @@ public function setData($key, $value = null) */ public function unsetData($key = null) { - if (is_null($key)) { + if ($key === null) { $this->setData([]); } elseif (is_string($key)) { - if (array_key_exists($key, $this->_data)) { + if (isset($this->_data[$key]) || array_key_exists($key, $this->_data)) { $this->_hasDataChanges = true; unset($this->_data[$key]); } - } elseif (is_array($key)) { + } elseif ($key === (array)$key) { foreach ($key as $element) { $this->unsetData($element); } @@ -219,6 +219,7 @@ public function unsetData($key = null) * @param string|int $index * @return mixed */ + public function getData($key = '', $index = null) { if ('' === $key) { @@ -229,14 +230,14 @@ public function getData($key = '', $index = null) if (strpos($key, '/')) { $data = $this->getDataByPath($key); } else { - $data = $this->getDataByKey($key); + $data = $this->_getData($key); } if ($index !== null) { - if (is_array($data)) { + if ($data === (array)$data) { $data = isset($data[$index]) ? $data[$index] : null; } elseif (is_string($data)) { - $data = explode("\n", $data); + $data = explode(PHP_EOL, $data); $data = isset($data[$index]) ? $data[$index] : null; } elseif ($data instanceof \Magento\Framework\Object) { $data = $data->getData($index); @@ -261,7 +262,7 @@ public function getDataByPath($path) $data = $this->_data; foreach ($keys as $key) { - if (is_array($data) && isset($data[$key])) { + if ((array)$data === $data && isset($data[$key])) { $data = $data[$key]; } elseif ($data instanceof \Magento\Framework\Object) { $data = $data->getDataByKey($key); @@ -291,7 +292,10 @@ public function getDataByKey($key) */ protected function _getData($key) { - return isset($this->_data[$key]) ? $this->_data[$key] : null; + if (isset($this->_data[$key])) { + return $this->_data[$key]; + } + return null; } /** @@ -540,7 +544,7 @@ protected function _underscore($name) if (isset(self::$_underscoreCache[$name])) { return self::$_underscoreCache[$name]; } - $result = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $name)); + $result = strtolower(trim(preg_replace('/([A-Z]+|[0-9]+)/', "_$1", $name), '_')); self::$_underscoreCache[$name] = $result; return $result; } @@ -583,7 +587,7 @@ public function serialize($keys = [], $valueSeparator = '=', $fieldSeparator = ' */ public function setOrigData($key = null, $data = null) { - if (is_null($key)) { + if ($key === null) { $this->_origData = $this->_data; } else { $this->_origData[$key] = $data; @@ -599,10 +603,13 @@ public function setOrigData($key = null, $data = null) */ public function getOrigData($key = null) { - if (is_null($key)) { + if ($key === null) { return $this->_origData; } - return isset($this->_origData[$key]) ? $this->_origData[$key] : null; + if (isset($this->_origData[$key])) { + return $this->_origData[$key]; + } + return null; } /** @@ -682,7 +689,7 @@ public function offsetSet($offset, $value) */ public function offsetExists($offset) { - return array_key_exists($offset, $this->_data); + return isset($this->_data[$offset]) || array_key_exists($offset, $this->_data); } /** @@ -706,6 +713,9 @@ public function offsetUnset($offset) */ public function offsetGet($offset) { - return isset($this->_data[$offset]) ? $this->_data[$offset] : null; + if (isset($this->_data[$offset])) { + return $this->_data[$offset]; + } + return null; } } diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php b/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php index eb5d26b9ccf7c..46660989b8212 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php +++ b/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php @@ -100,7 +100,10 @@ public function isShared($type) */ public function getInstanceType($instanceName) { - return isset($this->virtualTypes[$instanceName]) ? $this->virtualTypes[$instanceName] : $instanceName; + if (isset($this->virtualTypes[$instanceName])) { + return $this->virtualTypes[$instanceName]; + } + return $instanceName; } /** @@ -112,7 +115,10 @@ public function getInstanceType($instanceName) */ public function getPreference($type) { - return isset($this->preferences[$type]) ? $this->preferences[$type] : $type; + if (isset($this->preferences[$type])) { + return $this->preferences[$type]; + } + return $type; } /** diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/Config.php b/lib/internal/Magento/Framework/ObjectManager/Config/Config.php index 7110ba1cef9ca..f3ce44d0d2800 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Config/Config.php +++ b/lib/internal/Magento/Framework/ObjectManager/Config/Config.php @@ -113,9 +113,10 @@ public function setCache(ConfigCacheInterface $cache) */ public function getArguments($type) { - return isset($this->_mergedArguments[$type]) - ? $this->_mergedArguments[$type] - : $this->_collectConfiguration($type); + if (isset($this->_mergedArguments[$type])) { + return $this->_mergedArguments[$type]; + } + return $this->_collectConfiguration($type); } /** diff --git a/lib/internal/Magento/Framework/ObjectManager/Config/ProxyConfig.php b/lib/internal/Magento/Framework/ObjectManager/Config/ProxyConfig.php deleted file mode 100644 index 3516934f90f85..0000000000000 --- a/lib/internal/Magento/Framework/ObjectManager/Config/ProxyConfig.php +++ /dev/null @@ -1,120 +0,0 @@ -subjectConfig = $config; - } - - /** - * Set class relations - * - * @param RelationsInterface $relations - * - * @return void - */ - public function setRelations(RelationsInterface $relations) - { - $this->subjectConfig->setRelations($relations); - } - - /** - * Set configuration cache instance - * - * @param ConfigCacheInterface $cache - * - * @return void - */ - public function setCache(ConfigCacheInterface $cache) - { - $this->subjectConfig->setCache($cache); - } - - /** - * Retrieve list of arguments per type - * - * @param string $type - * - * @return array - */ - public function getArguments($type) - { - return $this->subjectConfig->getArguments($type); - } - - /** - * Check whether type is shared - * - * @param string $type - * - * @return bool - */ - public function isShared($type) - { - return $this->subjectConfig->isShared($type); - } - - /** - * Retrieve instance type - * - * @param string $instanceName - * - * @return mixed - */ - public function getInstanceType($instanceName) - { - return $this->subjectConfig->getInstanceType($instanceName); - } - - /** - * Retrieve preference for type - * - * @param string $type - * - * @return string - * @throws \LogicException - */ - public function getPreference($type) - { - return $this->subjectConfig->getPreference($type); - } - - /** - * Extend configuration - * - * @param array $configuration - * - * @return void - */ - public function extend(array $configuration) - { - $this->subjectConfig->extend($configuration); - } - - /** - * Returns list of virtual types - * - * @return array - */ - public function getVirtualTypes() - { - return $this->subjectConfig->getVirtualTypes(); - } -} diff --git a/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php b/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php index 70035ef5741ce..a738793e0af27 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php +++ b/lib/internal/Magento/Framework/ObjectManager/Environment/AbstractEnvironment.php @@ -13,7 +13,7 @@ abstract class AbstractEnvironment implements EnvironmentInterface { /** - * @var \Magento\Framework\Interception\ObjectManager\Config + * @var \Magento\Framework\Interception\ObjectManager\ConfigInterface */ protected $config; diff --git a/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php b/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php index ffc4cec2c4077..a21852fd37657 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php +++ b/lib/internal/Magento/Framework/ObjectManager/Environment/Compiled.php @@ -41,13 +41,13 @@ class Compiled extends AbstractEnvironment implements EnvironmentInterface /** * Returns initialized compiled config * - * @return \Magento\Framework\Interception\ObjectManager\Config + * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface */ public function getDiConfig() { if (!$this->config) { - $this->config = new \Magento\Framework\Interception\ObjectManager\Config( - new \Magento\Framework\ObjectManager\Config\Compiled($this->getConfigData()) + $this->config = new \Magento\Framework\Interception\ObjectManager\Config\Compiled( + $this->getConfigData() ); } diff --git a/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php b/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php index dfed5ece5126a..88c2ffeff0626 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php +++ b/lib/internal/Magento/Framework/ObjectManager/Environment/Developer.php @@ -17,7 +17,7 @@ class Developer extends AbstractEnvironment implements EnvironmentInterface /**#@- */ /** - * @var \Magento\Framework\Interception\ObjectManager\Config + * @var \Magento\Framework\Interception\ObjectManager\ConfigInterface */ protected $config; @@ -29,16 +29,14 @@ class Developer extends AbstractEnvironment implements EnvironmentInterface /** * Returns initialized di config entity * - * @return \Magento\Framework\Interception\ObjectManager\Config + * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface */ public function getDiConfig() { if (!$this->config) { - $this->config = new \Magento\Framework\Interception\ObjectManager\Config( - new \Magento\Framework\ObjectManager\Config\Config( - $this->envFactory->getRelations(), - $this->envFactory->getDefinitions() - ) + $this->config = new \Magento\Framework\Interception\ObjectManager\Config\Developer( + $this->envFactory->getRelations(), + $this->envFactory->getDefinitions() ); } diff --git a/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php b/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php index 6398ac2088a7b..adfe0b7173bb6 100644 --- a/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php +++ b/lib/internal/Magento/Framework/ObjectManager/EnvironmentInterface.php @@ -20,7 +20,7 @@ public function getMode(); /** * Return config object * - * @return \Magento\Framework\Interception\ObjectManager\Config + * @return \Magento\Framework\Interception\ObjectManager\ConfigInterface */ public function getDiConfig(); diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php b/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php index 3ca4343cb00f4..788afb22868db 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php @@ -84,6 +84,7 @@ public function setArguments($arguments) * * @return object * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * */ protected function createObject($type, $args) @@ -142,6 +143,57 @@ protected function createObject($type, $args) $args[10], $args[11] ); + case 13: + return new $type( + $args[0], + $args[1], + $args[2], + $args[3], + $args[4], + $args[5], + $args[6], + $args[7], + $args[8], + $args[9], + $args[10], + $args[11], + $args[12] + ); + case 14: + return new $type( + $args[0], + $args[1], + $args[2], + $args[3], + $args[4], + $args[5], + $args[6], + $args[7], + $args[8], + $args[9], + $args[10], + $args[11], + $args[12], + $args[13] + ); + case 15: + return new $type( + $args[0], + $args[1], + $args[2], + $args[3], + $args[4], + $args[5], + $args[6], + $args[7], + $args[8], + $args[9], + $args[10], + $args[11], + $args[12], + $args[13], + $args[14] + ); default: $reflection = new \ReflectionClass($type); return $reflection->newInstanceArgs($args); @@ -164,22 +216,33 @@ protected function createObject($type, $args) protected function resolveArgument(&$argument, $paramType, $paramDefault, $paramName, $requestedType) { if ($paramType && $argument !== $paramDefault && !is_object($argument)) { - if (!isset($argument['instance']) || !is_array($argument)) { + $argumentType = $argument['instance']; + if (!isset($argument['instance']) || $argument !== (array)$argument) { throw new \UnexpectedValueException( 'Invalid parameter configuration provided for $' . $paramName . ' argument of ' . $requestedType ); } - $argumentType = $argument['instance']; - $isShared = (isset($argument['shared']) ? $argument['shared'] : $this->config->isShared($argumentType)); - $argument = $isShared - ? $this->objectManager->get($argumentType) - : $this->objectManager->create($argumentType); - } elseif (is_array($argument)) { + + if (isset($argument['shared'])) { + $isShared = $argument['shared']; + } else { + $isShared = $this->config->isShared($argumentType); + } + + if ($isShared) { + $argument = $this->objectManager->get($argumentType); + } else { + $argument = $this->objectManager->create($argumentType); + } + + } else if ($argument === (array)$argument) { if (isset($argument['argument'])) { - $argument = isset($this->globalArguments[$argument['argument']]) - ? $this->globalArguments[$argument['argument']] - : $paramDefault; - } elseif (!empty($argument)) { + if (isset($this->globalArguments[$argument['argument']])) { + $argument = $this->globalArguments[$argument['argument']]; + } else { + $argument = $paramDefault; + } + } else if (!empty($argument)) { $this->parseArray($argument); } } @@ -195,17 +258,26 @@ protected function resolveArgument(&$argument, $paramType, $paramDefault, $param protected function parseArray(&$array) { foreach ($array as $key => $item) { - if (is_array($item)) { + if ($item === (array)$item) { if (isset($item['instance'])) { - $itemType = $item['instance']; - $isShared = (isset($item['shared'])) ? $item['shared'] : $this->config->isShared($itemType); - $array[$key] = $isShared - ? $this->objectManager->get($itemType) - : $this->objectManager->create($itemType); + if (isset($item['shared'])) { + $isShared = $item['shared']; + } else { + $isShared = $this->config->isShared($item['instance']); + } + + if ($isShared) { + $array[$key] = $this->objectManager->get($item['instance']); + } else { + $array[$key] = $this->objectManager->create($item['instance']); + } + } elseif (isset($item['argument'])) { - $array[$key] = isset($this->globalArguments[$item['argument']]) - ? $this->globalArguments[$item['argument']] - : null; + if (isset($this->globalArguments[$item['argument']])) { + $array[$key] = $this->globalArguments[$item['argument']]; + } else { + $array[$key] = null; + } } else { $this->parseArray($array[$key]); } diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php b/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php index 1aa8e3ce48db2..ebd47eba75659 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/Compiled.php @@ -29,18 +29,20 @@ public function create($requestedType, array $arguments = []) if (isset($arguments[$key])) { $argument = $arguments[$key]; } else { - if (is_array($argument)) { - if (array_key_exists('__val__', $argument)) { + if ($argument === (array)$argument) { + if (isset($argument['__val__']) || array_key_exists('__val__', $argument)) { $argument = $argument['__val__']; - if (is_array($argument)) { + if ($argument === (array)$argument) { $this->parseArray($argument); } } elseif (isset($argument['__non_shared__'])) { $argument = $this->objectManager->create($argument['__instance__']); } elseif (isset($argument['__arg__'])) { - $argument = isset($this->globalArguments[$argument['__arg__']]) - ? $this->globalArguments[$argument['__arg__']] - : $argument['__default__']; + if (isset($this->globalArguments[$argument['__arg__']])) { + $argument = $this->globalArguments[$argument['__arg__']]; + } else { + $argument = $argument['__default__']; + } } } else { $argument = $this->objectManager->get($argument); diff --git a/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php b/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php index 06cd6201c335a..039a0f238ae59 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php +++ b/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Production.php @@ -27,7 +27,7 @@ protected function _resolveArguments($requestedType, array $parameters, array $a foreach ($parameters as $parameter) { list($paramName, $paramType, $paramRequired, $paramDefault) = $parameter; $argument = null; - if (!empty($arguments) && array_key_exists($paramName, $arguments)) { + if (!empty($arguments) && (isset($arguments[$paramName]) || array_key_exists($paramName, $arguments))) { $argument = $arguments[$paramName]; } elseif ($paramRequired) { $argument = ['instance' => $paramType]; diff --git a/lib/internal/Magento/Framework/Search/Request/Aggregation/Status.php b/lib/internal/Magento/Framework/Search/Request/Aggregation/Status.php new file mode 100644 index 0000000000000..99f587a220936 --- /dev/null +++ b/lib/internal/Magento/Framework/Search/Request/Aggregation/Status.php @@ -0,0 +1,17 @@ +aggregationStatus = $aggregationStatus; + } + /** * Clean not binder queries and filters * @@ -34,6 +50,7 @@ public function clean(array $requestData) $this->clear(); $this->requestData = $requestData; $this->cleanQuery($requestData['query']); + $this->cleanAggregations(); $requestData = $this->requestData; $this->clear(); @@ -93,6 +110,18 @@ private function cleanQuery($queryName) } } + /** + * Clean aggregations if we don't need to process them + * + * @return void + */ + private function cleanAggregations() + { + if (!$this->aggregationStatus->isEnabled()) { + $this->requestData['aggregations'] = []; + } + } + /** * Clear don't bind filters * diff --git a/lib/internal/Magento/Framework/Session/Validator.php b/lib/internal/Magento/Framework/Session/Validator.php index 0d2edbe70f5a2..dd751deda02f5 100644 --- a/lib/internal/Magento/Framework/Session/Validator.php +++ b/lib/internal/Magento/Framework/Session/Validator.php @@ -77,10 +77,12 @@ public function validate(SessionManagerInterface $session) if (!isset($_SESSION[self::VALIDATOR_KEY])) { $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment(); } else { - if (!$this->_validate()) { + try { + $this->_validate(); + } catch (Exception $e) { $session->destroy(['clear_storage' => false]); // throw core session exception - throw new Exception(''); + throw $e; } } } @@ -89,7 +91,7 @@ public function validate(SessionManagerInterface $session) * Validate data * * @return bool - * + * @throws Exception * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ protected function _validate() @@ -102,14 +104,14 @@ protected function _validate() $this->_scopeType ) && $sessionData[self::VALIDATOR_REMOTE_ADDR_KEY] != $validatorData[self::VALIDATOR_REMOTE_ADDR_KEY] ) { - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_REMOTE_ADDR_KEY . ' value.'); } if ($this->_scopeConfig->getValue( self::XML_PATH_USE_HTTP_VIA, $this->_scopeType ) && $sessionData[self::VALIDATOR_HTTP_VIA_KEY] != $validatorData[self::VALIDATOR_HTTP_VIA_KEY] ) { - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_HTTP_VIA_KEY . ' value.'); } $httpXForwardedKey = $sessionData[self::VALIDATOR_HTTP_X_FORWARDED_FOR_KEY]; @@ -119,7 +121,7 @@ protected function _validate() $this->_scopeType ) && $httpXForwardedKey != $validatorXForwarded ) { - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_HTTP_X_FORWARDED_FOR_KEY . ' value.'); } if ($this->_scopeConfig->getValue( self::XML_PATH_USE_USER_AGENT, @@ -131,7 +133,7 @@ protected function _validate() return true; } } - return false; + throw new Exception('Invalid session ' . self::VALIDATOR_HTTP_USER_AGENT_KEY . ' value.'); } return true; diff --git a/lib/internal/Magento/Framework/View/Asset/File.php b/lib/internal/Magento/Framework/View/Asset/File.php index d61a8933f2be7..f0d43f7edd0ae 100644 --- a/lib/internal/Magento/Framework/View/Asset/File.php +++ b/lib/internal/Magento/Framework/View/Asset/File.php @@ -100,14 +100,14 @@ private function join($path, $item) /** * {@inheritdoc} - * @throws \LogicException if file cannot be resolved + * @throws File\NotFoundException if file cannot be resolved */ public function getSourceFile() { if (null === $this->resolvedFile) { $this->resolvedFile = $this->source->getFile($this); if (false === $this->resolvedFile) { - throw new \LogicException("Unable to resolve the source file for '{$this->getPath()}'"); + throw new File\NotFoundException("Unable to resolve the source file for '{$this->getPath()}'"); } } return $this->resolvedFile; diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled_rollback.php b/lib/internal/Magento/Framework/View/Asset/File/NotFoundException.php similarity index 50% rename from dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled_rollback.php rename to lib/internal/Magento/Framework/View/Asset/File/NotFoundException.php index 7c31f403a1c63..617cf5580692c 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_enabled_rollback.php +++ b/lib/internal/Magento/Framework/View/Asset/File/NotFoundException.php @@ -3,4 +3,8 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -include __DIR__ . '/empty_storage.php'; +namespace Magento\Framework\View\Asset\File; + +class NotFoundException extends \LogicException +{ +} diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 7b3377e150e8e..81eab2eb3ae61 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -2,7 +2,7 @@ "name": "magento/framework", "description": "N/A", "type": "magento2-library", - "version": "0.1.0-alpha107", + "version": "0.1.0-alpha108", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/lib/web/mage/backend/notification.js b/lib/web/mage/backend/notification.js index fa23bad8989bf..99b970c176397 100644 --- a/lib/web/mage/backend/notification.js +++ b/lib/web/mage/backend/notification.js @@ -41,6 +41,26 @@ define([ $('#messages').html(response.html_message); } } catch(e) {} + }, + + /** + * Adds new message. + * + * @param {Object} data - Data with a message to be displayed. + */ + add: function(data){ + var message = $.tmpl(this.options.templates.global, data); + + $("#messages").append(message); + + return this; + }, + + /** + * Removes error messages. + */ + clear: function(){ + $('#messages').html(''); } }); diff --git a/lib/web/mage/backend/validation.js b/lib/web/mage/backend/validation.js index 104e423f29a5a..8ace0acd5ab54 100644 --- a/lib/web/mage/backend/validation.js +++ b/lib/web/mage/backend/validation.js @@ -151,14 +151,26 @@ attributes[data.attribute] = data.message; } + $('body').notification('clear'); + _.each(attributes, function(message, code) { element = this._getByCode(code); + if(!element.length){ + $('body').notification('add', { + error: true, + message: message + }); + + return; + } + element .addClass('validate-ajax-error') .data('msg-validate-ajax-error', message); this.validate.element(element); + }, this); }, diff --git a/lib/web/mage/tabs.js b/lib/web/mage/tabs.js index e3dcb5645384f..5c0a9110eaefe 100644 --- a/lib/web/mage/tabs.js +++ b/lib/web/mage/tabs.js @@ -104,12 +104,13 @@ define([ * @private */ _processPanels: function() { + this.contents = this.element.find(this.options.content); + this.collapsibles = this.element.find(this.options.collapsibleElement); this.headers = this.element.find(this.options.header); if (this.headers.length === 0) { this.headers = this.collapsibles; } - this.contents = this.element.find(this.options.content); this.triggers = this.element.find(this.options.trigger); if (this.triggers.length === 0) { this.triggers = this.headers; diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js index 80404eef56f0a..6a9e5617ff1f5 100644 --- a/lib/web/mage/validation.js +++ b/lib/web/mage/validation.js @@ -23,7 +23,7 @@ * @param {string} */ isEmpty: function(value) { - return (value === '' || (value == null) || (value.length === 0) || /^\s+$/.test(value)); + return (value === '' || value === undefined || (value == null) || (value.length === 0) || /^\s+$/.test(value)); }, /** @@ -43,8 +43,8 @@ * @returns {boolean} */ isBetween: function(value, from, to){ - return (from === null || from === '' || value >= $.mage.parseNumber(from)) && - (to === null || to === '' || value <= $.mage.parseNumber(to)); + return ($.mage.isEmpty(from) || value >= $.mage.parseNumber(from)) && + ($.mage.isEmpty(to) || value <= $.mage.parseNumber(to)); }, /** @@ -81,11 +81,13 @@ } }); - $.validator.addMethod = function (name, method, message) { + $.validator.addMethod = function (name, method, message, dontSkip) { $.validator.methods[name] = method; $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name]; - $.validator.addClassRules(name, $.validator.normalizeRule(name)); + if (method.length < 3 || dontSkip) { + $.validator.addClassRules(name, $.validator.normalizeRule(name)); + } }; /** @@ -668,7 +670,8 @@ return result; }, - 'The value is not within the specified range.' + 'The value is not within the specified range.', + true ], "validate-digits": [ function(v) { @@ -714,7 +717,8 @@ return result; }, - 'The value is not within the specified range.' + 'The value is not within the specified range.', + true ], 'validate-range': [ function(v, elm) { diff --git a/pub/index.php b/pub/index.php index afc47e603e3f6..16389d234178e 100644 --- a/pub/index.php +++ b/pub/index.php @@ -8,7 +8,21 @@ use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; -require __DIR__ . '/../app/bootstrap.php'; +try { + require __DIR__ . '/../app/bootstrap.php'; +} catch (\Exception $e) { + echo << +
    +

    + Autoload error

    +
    +

    {$e->getMessage()}

    + +HTML; + exit(1); +} + $params = $_SERVER; $params[Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS] = [ DirectoryList::PUB => [DirectoryList::URL_PATH => ''], diff --git a/setup/.gitignore b/setup/.gitignore deleted file mode 100644 index a8d6c8e247a15..0000000000000 --- a/setup/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -vendor/* diff --git a/setup/.htaccess b/setup/.htaccess index a02263cb14af7..3e6764bf4bab2 100644 --- a/setup/.htaccess +++ b/setup/.htaccess @@ -1,16 +1,5 @@ -RewriteEngine On -# The following rule tells Apache that if the requested filename -# exists, simply serve it. -RewriteCond %{REQUEST_FILENAME} -s [OR] -RewriteCond %{REQUEST_FILENAME} -l [OR] -RewriteCond %{REQUEST_FILENAME} -d -RewriteRule ^.*$ - [NC,L] -# The following rewrites all other queries to index.php. The -# condition ensures that if you are using Apache aliases to do -# mass virtual hosting, the base path will be prepended to -# allow proper resolution of the index.php file; it will work -# in non-aliased environments as well, providing a safe, one-size -# fits all solution. -RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$ -RewriteRule ^(.*) - [E=BASE:%1] -RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L] \ No newline at end of file +Options -Indexes + + + RewriteEngine Off + diff --git a/setup/composer.json b/setup/composer.json deleted file mode 100644 index ca1b91e054b4c..0000000000000 --- a/setup/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "magento/project-setup", - "version": "0.1.0", - "require": { - "zendframework/zendframework": "2.3.1", - "composer/composer": "1.0.0-alpha8", - "magento/zendframework1": "1.12.9" - }, - "require-dev": { - "phpunit/phpunit": "4.1.*", - "squizlabs/php_codesniffer": "1.*", - "phpmd/phpmd" : "1.4.*" - }, - "autoload": { - "psr-4": { - "Magento\\Composer\\": "module/Magento/Composer/src/", - "Magento\\Filesystem\\": "module/Magento/Filesystem/src/", - "Magento\\Locale\\": "module/Magento/Locale/src/", - "Magento\\Setup\\": "module/Magento/Setup/src/", - "Magento\\Config\\": "module/Magento/Config/src/", - "Magento\\": ["../app/code/Magento/", "../lib/internal/Magento/"] - } - }, - "autoload-dev": { - "psr-4": { - "Magento\\Setup\\Tests\\": "module/Magento/Setup/tests/", - "Magento\\Config\\Tests\\": "module/Magento/Config/tests/" - } - } -} diff --git a/setup/config/application.config.php b/setup/config/application.config.php index ae8a662bf7e3c..79246293eb104 100644 --- a/setup/config/application.config.php +++ b/setup/config/application.config.php @@ -18,7 +18,7 @@ __DIR__ . '/autoload/{,*.}{global,local}.php', ], ], - 'listeners' => ['Magento\Setup\Mvc\Bootstrap\InitParamListener'], + 'listeners' => ['Magento\Setup\Mvc\Bootstrap\InitParamListener', 'Magento\Setup\Mvc\Console\RouteListener'], 'service_manager' => [ 'factories' => [ InitParamListener::BOOTSTRAP_PARAM => 'Magento\Setup\Mvc\Bootstrap\InitParamListener', diff --git a/setup/index.php b/setup/index.php index 15eddfac708f1..3008e9475a7aa 100644 --- a/setup/index.php +++ b/setup/index.php @@ -3,27 +3,22 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -$autoload = __DIR__ . '/vendor/autoload.php'; - -define('BP', dirname(__DIR__)); - -if (!file_exists($autoload)) { +try { + require __DIR__ . '/../app/bootstrap.php'; +} catch (\Exception $e) { if (PHP_SAPI == 'cli') { - echo "Dependencies not installed. Please run 'composer install' under /setup directory.\n"; + echo 'Autoload error: ' . $e->getMessage(); } else { echo <<

    - Whoops, it looks like setup tool dependencies are not installed.

    + Autoload error
    -

    Please run 'composer install' under /setup directory.

    +

    {$e->getMessage()}

    HTML; } exit(1); } - -require $autoload; - \Zend\Mvc\Application::init(require __DIR__ . '/config/application.config.php')->run(); diff --git a/setup/module/Magento/Composer/src/FileResolver.php b/setup/module/Magento/Composer/src/FileResolver.php deleted file mode 100644 index cdc49365a5aa0..0000000000000 --- a/setup/module/Magento/Composer/src/FileResolver.php +++ /dev/null @@ -1,54 +0,0 @@ -directoryRead = $filesystem->getDirectoryRead(DirectoryList::MODULES); - $this->iteratorFactory = $iteratorFactory; - } - - /** - * Collect files and wrap them into an Iterator object - * - * @param string $filename - * @param string $scope - * @return \Magento\Framework\Config\FileIterator - */ - public function get($filename, $scope) - { - $iterator = $this->iteratorFactory->create( - $this->directoryRead, - $this->directoryRead->search('/*/*/' . $filename) - ); - return $iterator; - } -} diff --git a/setup/module/Magento/Composer/src/Reader/Json.php b/setup/module/Magento/Composer/src/Reader/Json.php deleted file mode 100644 index 4a3abe57a9b7a..0000000000000 --- a/setup/module/Magento/Composer/src/Reader/Json.php +++ /dev/null @@ -1,61 +0,0 @@ -fileResolver = $fileResolver; - $this->fileName = $fileName; - } - - /** - * @return array - */ - public function read() - { - $fileList = $this->fileResolver->get($this->fileName, ''); - if (!count($fileList)) { - return []; - } - return $this->readFiles($fileList); - } - - /** - * @param array $fileList - * @return array - * @throws \Exception - */ - protected function readFiles($fileList) - { - $result = []; - foreach ($fileList as $content) { - $result[] = json_decode($content); - } - return $result; - } -} diff --git a/setup/module/Magento/Setup/Module.php b/setup/module/Magento/Setup/Module.php index 482b5e8f1ea24..857f9dbecdcbc 100644 --- a/setup/module/Magento/Setup/Module.php +++ b/setup/module/Magento/Setup/Module.php @@ -48,6 +48,15 @@ public function onBootstrap(EventInterface $e) [$injectTemplateListener, 'injectTemplate'], -89 ); + $response = $e->getResponse(); + if ($response instanceof \Zend\Http\Response) { + $headers = $response->getHeaders(); + if ($headers) { + $headers->addHeaderLine('Cache-Control', 'no-cache, no-store, must-revalidate'); + $headers->addHeaderLine('Pragma', 'no-cache'); + $headers->addHeaderLine('Expires', '1970-01-01'); + } + } } /** diff --git a/setup/module/Magento/Setup/config/di.config.php b/setup/module/Magento/Setup/config/di.config.php index a62d3fe174bef..27696d1ae693e 100644 --- a/setup/module/Magento/Setup/config/di.config.php +++ b/setup/module/Magento/Setup/config/di.config.php @@ -6,41 +6,27 @@ return [ 'di' => [ 'allowed_controllers' => [ - 'Magento\Setup\Controller\ReadinessCheckController', - 'Magento\Setup\Controller\ReadinessCheck\ProgressController', - 'Magento\Setup\Controller\AddDatabaseController', - 'Magento\Setup\Controller\WebConfigurationController', - 'Magento\Setup\Controller\CustomizeYourStoreController', - 'Magento\Setup\Controller\CreateAdminAccountController', - 'Magento\Setup\Controller\SuccessController', - 'Magento\Setup\Controller\Success\EncryptionController', - 'Magento\Setup\Controller\InstallController', - 'Magento\Setup\Controller\Install\ProgressController', - 'Magento\Setup\Controller\Install\ClearProgressController', - 'Magento\Setup\Controller\Install\StartController', - 'Magento\Setup\Controller\IndexController', - 'Magento\Setup\Controller\LandingController', - 'Magento\Setup\Controller\LicenseController', - 'Magento\Setup\Controller\EnvironmentController', - 'Magento\Setup\Controller\UserController', + 'Magento\Setup\Controller\Index', + 'Magento\Setup\Controller\Landing', + 'Magento\Setup\Controller\Navigation', + 'Magento\Setup\Controller\License', + 'Magento\Setup\Controller\ReadinessCheck', + 'Magento\Setup\Controller\Environment', + 'Magento\Setup\Controller\DatabaseCheck', + 'Magento\Setup\Controller\AddDatabase', + 'Magento\Setup\Controller\WebConfiguration', + 'Magento\Setup\Controller\CustomizeYourStore', + 'Magento\Setup\Controller\CreateAdminAccount', + 'Magento\Setup\Controller\Install', + 'Magento\Setup\Controller\Success', 'Magento\Setup\Controller\ConsoleController', - - 'Magento\Setup\Controller\Controls\HeaderController', - 'Magento\Setup\Controller\Controls\MenuController', - 'Magento\Setup\Controller\Controls\NavbarController', - - 'Magento\Setup\Controller\Data\FilePermissionsController', - 'Magento\Setup\Controller\Data\PhpExtensionsController', - 'Magento\Setup\Controller\Data\PhpVersionController', - 'Magento\Setup\Controller\Data\StatesController', - 'Magento\Setup\Controller\Data\DatabaseController', - 'Magento\Setup\Controller\Data\LanguagesController', ], 'instance' => [ 'preference' => [ 'Zend\EventManager\EventManagerInterface' => 'EventManager', 'Zend\ServiceManager\ServiceLocatorInterface' => 'ServiceManager', 'Magento\Framework\DB\LoggerInterface' => 'Magento\Framework\DB\Logger\Null', + 'Magento\Framework\Locale\ConfigInterface' => 'Magento\Framework\Locale\Config', ], ], ], diff --git a/setup/module/Magento/Setup/config/router.config.php b/setup/module/Magento/Setup/config/router.config.php index 346d936c5c139..498e16e35b43c 100644 --- a/setup/module/Magento/Setup/config/router.config.php +++ b/setup/module/Magento/Setup/config/router.config.php @@ -6,34 +6,30 @@ use Magento\Setup\Controller\ConsoleController; return [ - 'route_manager' => [ - 'invokables' => [ - 'setup' => 'Magento\Setup\Mvc\Router\Http\Setup', - ], - ], 'router' => [ 'routes' => [ - 'setup' => [ - 'type' => 'setup', + 'literal' => [ + 'type' => 'Literal', 'options' => [ - 'regex' => '\b.*\/(?[\w-\/]+)$', + 'route' => '/', 'defaults' => [ - '__NAMESPACE__' => 'Magento\Setup\Controller', - 'action' => 'index', + 'controller' => 'Magento\Setup\Controller\Index', + 'action' => 'index', ], - 'spec' => '%controller%', ], ], - 'home' => [ - 'type' => 'literal', + 'setup' => [ + 'type' => 'Segment', 'options' => [ - 'route' => '/', + 'route' => '[/:controller[/:action]]', + 'defaults' => [ + '__NAMESPACE__' => 'Magento\Setup\Controller', + 'controller' => 'Index', + 'action' => 'index', + ], 'constraints' => [ 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', - ], - 'defaults' => [ - 'controller' => 'Magento\Setup\Controller\IndexController', - 'action' => 'index', + 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', ], ], ], diff --git a/setup/module/Magento/Setup/config/states.config.php b/setup/module/Magento/Setup/config/states.config.php index c627189de2472..6b42c38dc4127 100644 --- a/setup/module/Magento/Setup/config/states.config.php +++ b/setup/module/Magento/Setup/config/states.config.php @@ -3,6 +3,8 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ +$base = basename($_SERVER['SCRIPT_FILENAME']); + return [ 'nav' => [ [ @@ -13,7 +15,7 @@ [ 'id' => 'root.license', 'url' => 'license', - 'templateUrl' => 'license', + 'templateUrl' => "$base/license", 'title' => 'License', 'main' => true, 'nav-bar' => false, @@ -22,7 +24,7 @@ [ 'id' => 'root.landing', 'url' => 'landing', - 'templateUrl' => 'landing', + 'templateUrl' => "$base/landing", 'title' => 'Landing', 'controller' => 'landingController', 'main' => true, @@ -32,7 +34,7 @@ [ 'id' => 'root.readiness-check', 'url' => 'readiness-check', - 'templateUrl' => 'readiness-check', + 'templateUrl' => "{$base}/readiness-check", 'title' => 'Readiness Check', 'header' => 'Step 1: Readiness Check', 'nav-bar' => true, @@ -41,7 +43,7 @@ [ 'id' => 'root.readiness-check.progress', 'url' => 'readiness-check/progress', - 'templateUrl' => 'readiness-check/progress', + 'templateUrl' => "{$base}/readiness-check/progress", 'title' => 'Readiness Check', 'header' => 'Step 1: Readiness Check', 'controller' => 'readinessCheckController', @@ -51,7 +53,7 @@ [ 'id' => 'root.add-database', 'url' => 'add-database', - 'templateUrl' => 'add-database', + 'templateUrl' => "{$base}/add-database", 'title' => 'Add a Database', 'header' => 'Step 2: Add a Database', 'controller' => 'addDatabaseController', @@ -62,7 +64,7 @@ [ 'id' => 'root.web-configuration', 'url' => 'web-configuration', - 'templateUrl' => 'web-configuration', + 'templateUrl' => "{$base}/web-configuration", 'title' => 'Web Configuration', 'header' => 'Step 3: Web Configuration', 'controller' => 'webConfigurationController', @@ -73,7 +75,7 @@ [ 'id' => 'root.customize-your-store', 'url' => 'customize-your-store', - 'templateUrl' => 'customize-your-store', + 'templateUrl' => "{$base}/customize-your-store", 'title' => 'Customize Your Store', 'header' => 'Step 4: Customize Your Store', 'controller' => 'customizeYourStoreController', @@ -83,7 +85,7 @@ [ 'id' => 'root.create-admin-account', 'url' => 'create-admin-account', - 'templateUrl' => 'create-admin-account', + 'templateUrl' => "{$base}/create-admin-account", 'title' => 'Create Admin Account', 'header' => 'Step 5: Create Admin Account', 'controller' => 'createAdminAccountController', @@ -94,7 +96,7 @@ [ 'id' => 'root.install', 'url' => 'install', - 'templateUrl' => 'install', + 'templateUrl' => "{$base}/install", 'title' => 'Install', 'header' => 'Step 6: Install', 'controller' => 'installController', @@ -104,7 +106,7 @@ [ 'id' => 'root.success', 'url' => 'success', - 'templateUrl' => 'success', + 'templateUrl' => "{$base}/success", 'controller' => 'successController', 'main' => true, 'order' => 8, diff --git a/setup/module/Magento/Setup/src/Controller/AddDatabase.php b/setup/module/Magento/Setup/src/Controller/AddDatabase.php new file mode 100644 index 0000000000000..486b5839d82a6 --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/AddDatabase.php @@ -0,0 +1,21 @@ +setTerminal(true); + return $view; + } +} diff --git a/setup/module/Magento/Setup/src/Controller/AddDatabaseController.php b/setup/module/Magento/Setup/src/Controller/AddDatabaseController.php deleted file mode 100644 index 8d62f684e1377..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/AddDatabaseController.php +++ /dev/null @@ -1,34 +0,0 @@ -view = $view; - } - - /** - * @return array|ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/ConsoleController.php b/setup/module/Magento/Setup/src/Controller/ConsoleController.php index 2748c0abd0027..baba257cd082d 100644 --- a/setup/module/Magento/Setup/src/Controller/ConsoleController.php +++ b/setup/module/Magento/Setup/src/Controller/ConsoleController.php @@ -8,11 +8,11 @@ use Magento\Framework\App\MaintenanceMode; use Magento\Setup\Model\AdminAccount; use Magento\Setup\Model\ConsoleLogger; +use Magento\Setup\Model\DeploymentConfigMapper; use Magento\Setup\Model\Installer; use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\Lists; use Magento\Setup\Model\UserConfigurationDataMapper as UserConfig; -use Magento\Setup\Module\Setup\ConfigMapper; use Zend\Console\Request as ConsoleRequest; use Zend\EventManager\EventManagerInterface; use Zend\Mvc\Controller\AbstractActionController; @@ -133,6 +133,20 @@ public static function getConsoleUsage() return $result; } + /** + * Gets command usage + * + * @return array + */ + public static function getCommandUsage() + { + $result = []; + foreach (self::getCliConfig() as $key => $cmd) { + $result[$key] = $cmd['usage']; + } + return $result; + } + /** * The CLI that this controller implements * @@ -140,19 +154,18 @@ public static function getConsoleUsage() */ private static function getCliConfig() { - $deployConfig = '--' . ConfigMapper::KEY_DB_HOST . '=' - . ' --' . ConfigMapper::KEY_DB_NAME . '=' - . ' --' . ConfigMapper::KEY_DB_USER . '=' - . ' --' . ConfigMapper::KEY_BACKEND_FRONTNAME . '=' - . ' [--' . ConfigMapper::KEY_DB_PASS . '=]' - . ' [--' . ConfigMapper::KEY_DB_PREFIX . '=]' - . ' [--' . ConfigMapper::KEY_DB_MODEL . '=]' - . ' [--' . ConfigMapper::KEY_DB_INIT_STATEMENTS . '=]' - . ' [--' . ConfigMapper::KEY_SESSION_SAVE . '=]' - . ' [--' . ConfigMapper::KEY_ENCRYPTION_KEY . '=]' + $deployConfig = '--' . DeploymentConfigMapper::KEY_DB_HOST . '=' + . ' --' . DeploymentConfigMapper::KEY_DB_NAME . '=' + . ' --' . DeploymentConfigMapper::KEY_DB_USER . '=' + . ' --' . DeploymentConfigMapper::KEY_BACKEND_FRONTNAME . '=' + . ' [--' . DeploymentConfigMapper::KEY_DB_PASS . '=]' + . ' [--' . DeploymentConfigMapper::KEY_DB_PREFIX . '=]' + . ' [--' . DeploymentConfigMapper::KEY_DB_MODEL . '=]' + . ' [--' . DeploymentConfigMapper::KEY_DB_INIT_STATEMENTS . '=]' + . ' [--' . DeploymentConfigMapper::KEY_SESSION_SAVE . '=]' + . ' [--' . DeploymentConfigMapper::KEY_ENCRYPTION_KEY . '=]' . ' [--' . Installer::ENABLE_MODULES . '=]' - . ' [--' . Installer::DISABLE_MODULES . '=]' - . ' [--' . Installer::USE_SAMPLE_DATA . ']'; + . ' [--' . Installer::DISABLE_MODULES . '=]'; $userConfig = '[--' . UserConfig::KEY_BASE_URL . '=]' . ' [--' . UserConfig::KEY_LANGUAGE . '=]' . ' [--' . UserConfig::KEY_TIMEZONE . '=]' @@ -172,9 +185,11 @@ private static function getCliConfig() self::CMD_INSTALL => [ 'route' => self::CMD_INSTALL . " {$deployConfig} {$userConfig} {$adminUser} {$salesConfig}" - . ' [--' . Installer::CLEANUP_DB . ']', + . ' [--' . Installer::CLEANUP_DB . ']' + . ' [--' . Installer::USE_SAMPLE_DATA . '=]', 'usage' => "{$deployConfig} {$userConfig} {$adminUser} {$salesConfig}" - . ' [--' . Installer::CLEANUP_DB . ']', + . ' [--' . Installer::CLEANUP_DB . ']' + . ' [--' . Installer::USE_SAMPLE_DATA . '=]', 'usage_short' => self::CMD_INSTALL . ' ', 'usage_desc' => 'Install Magento application', ], @@ -275,11 +290,23 @@ public function setEventManager(EventManagerInterface $events) return $this; } + /** + * {@inheritdoc} + */ + public function onDispatch(\Zend\Mvc\MvcEvent $e) + { + try { + return parent::onDispatch($e); + } catch (\Magento\Setup\Exception $exception) { + $this->log->log($exception->getMessage()); + return $this->getResponse(); + } + } + /** * Controller for Install Command * * @return void - * @throws \Exception */ public function installAction() { @@ -292,13 +319,12 @@ public function installAction() * Creates the config.php file * * @return void - * @throws \Exception */ public function installDeploymentConfigAction() { - $this->installer->checkInstallationFilePermissions(); /** @var \Zend\Console\Request $request */ $request = $this->getRequest(); + $this->installer->checkInstallationFilePermissions(); $this->installer->installDeploymentConfig($request->getParams()); } @@ -306,7 +332,6 @@ public function installDeploymentConfigAction() * Installs and updates database schema * * @return void - * @throws \Exception */ public function installSchemaAction() { @@ -317,11 +342,9 @@ public function installSchemaAction() * Installs and updates data fixtures * * @return void - * @throws \Exception */ public function installDataAction() { - $this->installer->checkInstallationFilePermissions(); $this->installer->installDataFixtures(); } @@ -329,11 +352,9 @@ public function installDataAction() * Updates database schema and data * * @return void - * @throws \Exception */ public function updateAction() { - $this->installer->checkInstallationFilePermissions(); $this->installer->installSchema(); $this->installer->installDataFixtures(); } @@ -366,7 +387,6 @@ public function installAdminUserAction() * Controller for Uninstall Command * * @return void - * @throws \Exception */ public function uninstallAction() { @@ -408,13 +428,13 @@ public function maintenanceAction() * Shows necessary information for installing Magento * * @return string - * @throws \Exception + * @throws \InvalidArgumentException */ public function helpAction() { $type = $this->getRequest()->getParam('type'); - $details = self::getCliConfig(); - switch ($type) { + $usages = self::getCommandUsage(); + switch($type) { case UserConfig::KEY_LANGUAGE: return $this->arrayToString($this->options->getLocaleList()); case UserConfig::KEY_CURRENCY: @@ -422,9 +442,9 @@ public function helpAction() case UserConfig::KEY_TIMEZONE: return $this->arrayToString($this->options->getTimezoneList()); default: - if (isset($details[$type])) { - if ($details[$type]['usage']) { - $formatted = $this->formatCliUsage($details[$type]['usage']); + if (isset($usages[$type])) { + if ($usages[$type]) { + $formatted = $this->formatCliUsage($usages[$type]); return "\nAvailable parameters:\n{$formatted}\n"; } return "\nThis command has no parameters.\n"; diff --git a/setup/module/Magento/Setup/src/Controller/Controls/MenuController.php b/setup/module/Magento/Setup/src/Controller/Controls/MenuController.php deleted file mode 100644 index dc920145bc013..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/Controls/MenuController.php +++ /dev/null @@ -1,49 +0,0 @@ -view = $view; - $this->view->setTemplate('/magento/setup/controls/menu.phtml'); - - $this->navigation = $navigation; - } - - /** - * @return array|ViewModel - */ - public function indexAction() - { - $this->view->setVariable('menu', $this->navigation->getMenuItems()); - $this->view->setVariable('main', $this->navigation->getMainItems()); - $this->view->setTerminal(true); - - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/CreateAdminAccount.php b/setup/module/Magento/Setup/src/Controller/CreateAdminAccount.php new file mode 100644 index 0000000000000..ed59fc9ee33bc --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/CreateAdminAccount.php @@ -0,0 +1,21 @@ +setTerminal(true); + return $view; + } +} diff --git a/setup/module/Magento/Setup/src/Controller/CreateAdminAccountController.php b/setup/module/Magento/Setup/src/Controller/CreateAdminAccountController.php deleted file mode 100644 index ecb75bf497070..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/CreateAdminAccountController.php +++ /dev/null @@ -1,34 +0,0 @@ -view = $view; - } - - /** - * @return ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/CustomizeYourStoreController.php b/setup/module/Magento/Setup/src/Controller/CustomizeYourStore.php similarity index 65% rename from setup/module/Magento/Setup/src/Controller/CustomizeYourStoreController.php rename to setup/module/Magento/Setup/src/Controller/CustomizeYourStore.php index e0de79dfdc67e..4e188b95727f7 100644 --- a/setup/module/Magento/Setup/src/Controller/CustomizeYourStoreController.php +++ b/setup/module/Magento/Setup/src/Controller/CustomizeYourStore.php @@ -9,15 +9,10 @@ use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; -class CustomizeYourStoreController extends AbstractActionController +class CustomizeYourStore extends AbstractActionController { /** - * @var \Zend\View\Model\ViewModel - */ - protected $view; - - /** - * @var \Magento\Setup\Model\Lists + * @var Lists */ protected $list; @@ -27,16 +22,11 @@ class CustomizeYourStoreController extends AbstractActionController protected $sampleData; /** - * @param ViewModel $view * @param Lists $list * @param SampleData $sampleData */ - public function __construct( - ViewModel $view, - Lists $list, - SampleData $sampleData - ) { - $this->view = $view; + public function __construct(Lists $list, SampleData $sampleData) + { $this->list = $list; $this->sampleData = $sampleData; } @@ -46,14 +36,13 @@ public function __construct( */ public function indexAction() { - $this->view->setVariables([ + $view = new ViewModel([ 'timezone' => $this->list->getTimezoneList(), 'currency' => $this->list->getCurrencyList(), 'language' => $this->list->getLocaleList(), 'isSampledataEnabled' => $this->sampleData->isDeployed(), ]); - - $this->view->setTerminal(true); - return $this->view; + $view->setTerminal(true); + return $view; } } diff --git a/setup/module/Magento/Setup/src/Controller/Data/FilePermissionsController.php b/setup/module/Magento/Setup/src/Controller/Data/FilePermissionsController.php deleted file mode 100644 index a51b70495ed43..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/Data/FilePermissionsController.php +++ /dev/null @@ -1,55 +0,0 @@ -jsonModel = $jsonModel; - $this->permissions = $permissions; - } - - /** - * @return JsonModel - */ - public function indexAction() - { - $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; - if ($this->permissions->getMissingWritableDirectoriesForInstallation()) { - $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; - } - - $data = [ - 'responseType' => $responseType, - 'data' => [ - 'required' => $this->permissions->getInstallationWritableDirectories(), - 'current' => $this->permissions->getInstallationCurrentWritableDirectories(), - ], - ]; - - return $this->jsonModel->setVariables($data); - } -} diff --git a/setup/module/Magento/Setup/src/Controller/Data/PhpExtensionsController.php b/setup/module/Magento/Setup/src/Controller/Data/PhpExtensionsController.php deleted file mode 100644 index e274a6a22ff5f..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/Data/PhpExtensionsController.php +++ /dev/null @@ -1,58 +0,0 @@ -jsonModel = $jsonModel; - $this->extensions = $extensions; - } - - /** - * @return JsonModel - */ - public function indexAction() - { - $required = $this->extensions->getRequired(); - $current = $this->extensions->getCurrent(); - - $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; - if (array_diff($required, $current)) { - $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; - } - - $data = [ - 'responseType' => $responseType, - 'data' => [ - 'required' => $required, - 'current' => $current, - ], - ]; - - return $this->jsonModel->setVariables($data); - } -} diff --git a/setup/module/Magento/Setup/src/Controller/Data/PhpVersionController.php b/setup/module/Magento/Setup/src/Controller/Data/PhpVersionController.php deleted file mode 100644 index ddf5806cd13ff..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/Data/PhpVersionController.php +++ /dev/null @@ -1,50 +0,0 @@ -jsonModel = $jsonModel; - } - - /** - * @return JsonModel - */ - public function indexAction() - { - $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; - if (version_compare(PHP_VERSION, self::PHP_VERSION_MIN, '<') === true) { - $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; - } - - $data = [ - 'responseType' => $responseType, - 'data' => [ - 'required' => self::PHP_VERSION_MIN, - 'current' => PHP_VERSION, - ], - ]; - - return $this->jsonModel->setVariables($data); - } -} diff --git a/setup/module/Magento/Setup/src/Controller/Data/StatesController.php b/setup/module/Magento/Setup/src/Controller/Data/StatesController.php deleted file mode 100644 index c72b72c9032ff..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/Data/StatesController.php +++ /dev/null @@ -1,40 +0,0 @@ -navigation = $navigation; - $this->jsonModel = $jsonModel; - } - - /** - * @return JsonModel - */ - public function indexAction() - { - return $this->jsonModel->setVariable('nav', $this->navigation->getData()); - } -} diff --git a/setup/module/Magento/Setup/src/Controller/Data/DatabaseController.php b/setup/module/Magento/Setup/src/Controller/DatabaseCheck.php similarity index 67% rename from setup/module/Magento/Setup/src/Controller/Data/DatabaseController.php rename to setup/module/Magento/Setup/src/Controller/DatabaseCheck.php index e6d40332f1223..00765648b030c 100644 --- a/setup/module/Magento/Setup/src/Controller/Data/DatabaseController.php +++ b/setup/module/Magento/Setup/src/Controller/DatabaseCheck.php @@ -2,7 +2,7 @@ /** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Setup\Controller\Data; +namespace Magento\Setup\Controller; use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\WebLogger; @@ -10,15 +10,8 @@ use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\JsonModel; -class DatabaseController extends AbstractActionController +class DatabaseCheck extends AbstractActionController { - /** - * JSON response object - * - * @var JsonModel - */ - private $jsonResponse; - /** * Installer service factory * @@ -29,12 +22,10 @@ class DatabaseController extends AbstractActionController /** * Constructor * - * @param JsonModel $response * @param InstallerFactory $installerFactory */ - public function __construct(JsonModel $response, InstallerFactory $installerFactory) + public function __construct(InstallerFactory $installerFactory) { - $this->jsonResponse = $response; $this->installerFactory = $installerFactory; } @@ -50,9 +41,9 @@ public function indexAction() $installer = $this->installerFactory->create(new WebLogger()); $password = isset($params['password']) ? $params['password'] : ''; $installer->checkDatabaseConnection($params['name'], $params['host'], $params['user'], $password); - return $this->jsonResponse->setVariables(['success' => true]); + return new JsonModel(['success' => true]); } catch (\Exception $e) { - return $this->jsonResponse->setVariables(['success' => false, 'error' => $e->getMessage()]); + return new JsonModel(['success' => false, 'error' => $e->getMessage()]); } } } diff --git a/setup/module/Magento/Setup/src/Controller/Environment.php b/setup/module/Magento/Setup/src/Controller/Environment.php new file mode 100644 index 0000000000000..43ffefeedefaf --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/Environment.php @@ -0,0 +1,143 @@ +phpInformation = $phpInformation; + $this->permissions = $permissions; + $this->versionParser = $versionParser; + } + + /** + * Verifies php version + * + * @return JsonModel + */ + public function phpVersionAction() + { + try{ + $requiredVersion = $this->phpInformation->getRequiredPhpVersion(); + } catch (\Exception $e) { + return new JsonModel( + [ + 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, + 'data' => [ + 'error' => 'phpVersionError', + 'message' => 'Cannot determine required PHP version: ' . $e->getMessage() + ], + ] + ); + } + $multipleConstraints = $this->versionParser->parseConstraints($requiredVersion); + $currentPhpVersion = new VersionConstraint('=', PHP_VERSION); + $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; + if (!$multipleConstraints->matches($currentPhpVersion)) { + $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; + } + $data = [ + 'responseType' => $responseType, + 'data' => [ + 'required' => $requiredVersion, + 'current' => PHP_VERSION, + ], + ]; + return new JsonModel($data); + } + + /** + * Verifies php verifications + * + * @return JsonModel + */ + public function phpExtensionsAction() + { + try{ + $required = $this->phpInformation->getRequired(); + $current = $this->phpInformation->getCurrent(); + + } catch (\Exception $e) { + return new JsonModel( + [ + 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, + 'data' => [ + 'error' => 'phpExtensionError', + 'message' => 'Cannot determine required PHP extensions: ' . $e->getMessage() + ], + ] + ); + } + $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; + $missing = array_values(array_diff($required, $current)); + if ($missing) { + $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; + } + $data = [ + 'responseType' => $responseType, + 'data' => [ + 'required' => $required, + 'missing' => $missing, + ], + ]; + + return new JsonModel($data); + } + + /** + * Verifies file permissions + * + * @return JsonModel + */ + public function filePermissionsAction() + { + $responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS; + if ($this->permissions->getMissingWritableDirectoriesForInstallation()) { + $responseType = ResponseTypeInterface::RESPONSE_TYPE_ERROR; + } + + $data = [ + 'responseType' => $responseType, + 'data' => [ + 'required' => $this->permissions->getInstallationWritableDirectories(), + 'current' => $this->permissions->getInstallationCurrentWritableDirectories(), + ], + ]; + + return new JsonModel($data); + } +} diff --git a/setup/module/Magento/Setup/src/Controller/IndexController.php b/setup/module/Magento/Setup/src/Controller/Index.php similarity index 52% rename from setup/module/Magento/Setup/src/Controller/IndexController.php rename to setup/module/Magento/Setup/src/Controller/Index.php index 92117a243e974..2aeab01262962 100644 --- a/setup/module/Magento/Setup/src/Controller/IndexController.php +++ b/setup/module/Magento/Setup/src/Controller/Index.php @@ -8,26 +8,13 @@ use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; -class IndexController extends AbstractActionController +class Index extends AbstractActionController { - /** - * @var ViewModel - */ - protected $view; - - /** - * @param ViewModel $view - */ - public function __construct(ViewModel $view) - { - $this->view = $view; - } - /** * @return ViewModel */ public function indexAction() { - return $this->view; + return new ViewModel; } } diff --git a/setup/module/Magento/Setup/src/Controller/Install/StartController.php b/setup/module/Magento/Setup/src/Controller/Install.php similarity index 60% rename from setup/module/Magento/Setup/src/Controller/Install/StartController.php rename to setup/module/Magento/Setup/src/Controller/Install.php index a91cc68d9488a..9d34e888f9194 100644 --- a/setup/module/Magento/Setup/src/Controller/Install/StartController.php +++ b/setup/module/Magento/Setup/src/Controller/Install.php @@ -3,32 +3,22 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Setup\Controller\Install; +namespace Magento\Setup\Controller; use Magento\Setup\Model\AdminAccount; +use Magento\Setup\Model\DeploymentConfigMapper; use Magento\Setup\Model\Installer; +use Magento\Setup\Model\Installer\ProgressFactory; use Magento\Setup\Model\InstallerFactory; use Magento\Setup\Model\UserConfigurationDataMapper as UserConfig; use Magento\Setup\Model\WebLogger; -use Magento\Setup\Module\Setup\ConfigMapper; use Zend\Json\Json; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\JsonModel; +use Zend\View\Model\ViewModel; -/** - * UI Controller that handles installation - * - * @package Magento\Setup\Controller\Install - */ -class StartController extends AbstractActionController +class Install extends AbstractActionController { - /** - * JSON Model Object - * - * @var JsonModel - */ - private $json; - /** * @var WebLogger */ @@ -39,21 +29,36 @@ class StartController extends AbstractActionController */ private $installer; + /** + * @var ProgressFactory + */ + private $progressFactory; + /** * Default Constructor * - * @param JsonModel $view * @param WebLogger $logger * @param InstallerFactory $installerFactory + * @param ProgressFactory $progressFactory */ public function __construct( - JsonModel $view, WebLogger $logger, - InstallerFactory $installerFactory + InstallerFactory $installerFactory, + ProgressFactory $progressFactory ) { - $this->json = $view; $this->log = $logger; $this->installer = $installerFactory->create($logger); + $this->progressFactory = $progressFactory; + } + + /** + * @return ViewModel + */ + public function indexAction() + { + $view = new ViewModel; + $view->setTerminal(true); + return $view; } /** @@ -61,9 +66,10 @@ public function __construct( * * @return JsonModel */ - public function indexAction() + public function startAction() { $this->log->clear(); + $json = new JsonModel; try { $data = array_merge( $this->importDeploymentConfigForm(), @@ -71,19 +77,39 @@ public function indexAction() $this->importAdminUserForm() ); $this->installer->install($data); - $this->json->setVariable( + $json->setVariable( 'key', $this->installer->getInstallInfo()[ \Magento\Framework\App\DeploymentConfig\EncryptConfig::KEY_ENCRYPTION_KEY ] ); - $this->json->setVariable('success', true); - $this->json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]); - } catch (\Exception $e) { + $json->setVariable('success', true); + $json->setVariable('messages', $this->installer->getInstallInfo()[Installer::INFO_MESSAGE]); + } catch(\Exception $e) { $this->log->logError($e); - $this->json->setVariable('success', false); + $json->setVariable('success', false); + } + return $json; + } + + /** + * Checks progress of installation + * + * @return JsonModel + */ + public function progressAction() + { + $percent = 0; + $success = false; + try { + $progress = $this->progressFactory->createFromLog($this->log); + $percent = sprintf('%d', $progress->getRatio() * 100); + $success = true; + $contents = $this->log->get(); + } catch (\Exception $e) { + $contents = [(string)$e]; } - return $this->json; + return new JsonModel(['progress' => $percent, 'success' => $success, 'console' => $contents]); } /** @@ -95,17 +121,17 @@ private function importDeploymentConfigForm() { $source = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY); $result = []; - $result[ConfigMapper::KEY_DB_HOST] = isset($source['db']['host']) ? $source['db']['host'] : ''; - $result[ConfigMapper::KEY_DB_NAME] = isset($source['db']['name']) ? $source['db']['name'] : ''; - $result[ConfigMapper::KEY_DB_USER] = isset($source['db']['user']) ? $source['db']['user'] : ''; - $result[ConfigMapper::KEY_DB_PASS] = isset($source['db']['password']) ? $source['db']['password'] : ''; - $result[ConfigMapper::KEY_DB_PREFIX] = isset($source['db']['tablePrefix']) ? $source['db']['tablePrefix'] : ''; - $result[ConfigMapper::KEY_BACKEND_FRONTNAME] = isset($source['config']['address']['admin']) - ? $source['config']['address']['admin'] - : ''; - $result[ConfigMapper::KEY_ENCRYPTION_KEY] = isset($source['config']['encrypt']['key']) - ? $source['config']['encrypt']['key'] - : ''; + $result[DeploymentConfigMapper::KEY_DB_HOST] = isset($source['db']['host']) ? $source['db']['host'] : ''; + $result[DeploymentConfigMapper::KEY_DB_NAME] = isset($source['db']['name']) ? $source['db']['name'] : ''; + $result[DeploymentConfigMapper::KEY_DB_USER] = isset($source['db']['user']) ? $source['db']['user'] :''; + $result[DeploymentConfigMapper::KEY_DB_PASS] = + isset($source['db']['password']) ? $source['db']['password'] : ''; + $result[DeploymentConfigMapper::KEY_DB_PREFIX] = + isset($source['db']['tablePrefix']) ? $source['db']['tablePrefix'] : ''; + $result[DeploymentConfigMapper::KEY_BACKEND_FRONTNAME] = isset($source['config']['address']['admin']) + ? $source['config']['address']['admin'] : ''; + $result[DeploymentConfigMapper::KEY_ENCRYPTION_KEY] = isset($source['config']['encrypt']['key']) + ? $source['config']['encrypt']['key'] : ''; return $result; } @@ -118,17 +144,18 @@ private function importUserConfigForm() { $source = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY); $result = []; + if (!empty($source['config']['address']['base_url'])) { + $result[UserConfig::KEY_BASE_URL] = $source['config']['address']['base_url']; + } $result[UserConfig::KEY_USE_SEF_URL] = isset($source['config']['rewrites']['allowed']) ? $source['config']['rewrites']['allowed'] : ''; - $result[UserConfig::KEY_BASE_URL] = isset($source['config']['address']['web']) - ? $source['config']['address']['web'] : ''; $result[UserConfig::KEY_IS_SECURE] = isset($source['config']['https']['front']) ? $source['config']['https']['front'] : ''; $result[UserConfig::KEY_IS_SECURE_ADMIN] = isset($source['config']['https']['admin']) ? $source['config']['https']['admin'] : ''; $result[UserConfig::KEY_BASE_URL_SECURE] = (isset($source['config']['https']['front']) || isset($source['config']['https']['admin'])) - ? str_replace('http:', 'https:', $source['config']['address']['web']) : ''; + ? $source['config']['https']['text'] : ''; $result[UserConfig::KEY_LANGUAGE] = isset($source['store']['language']) ? $source['store']['language'] : ''; $result[UserConfig::KEY_TIMEZONE] = isset($source['store']['timezone']) diff --git a/setup/module/Magento/Setup/src/Controller/Install/ProgressController.php b/setup/module/Magento/Setup/src/Controller/Install/ProgressController.php deleted file mode 100644 index e2f9d8d17d3d7..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/Install/ProgressController.php +++ /dev/null @@ -1,71 +0,0 @@ -logger = $logger; - $this->json = $view; - $this->progressFactory = $progressFactory; - } - - /** - * Checks progress of installation - * - * @return JsonModel - */ - public function indexAction() - { - $percent = 0; - $success = false; - try { - $progress = $this->progressFactory->createFromLog($this->logger); - $percent = sprintf('%d', $progress->getRatio() * 100); - $success = true; - $contents = $this->logger->get(); - } catch (\Exception $e) { - $contents = [(string)$e]; - } - return $this->json->setVariables(['progress' => $percent, 'success' => $success, 'console' => $contents]); - } -} diff --git a/setup/module/Magento/Setup/src/Controller/InstallController.php b/setup/module/Magento/Setup/src/Controller/InstallController.php deleted file mode 100644 index 613fda4c90c52..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/InstallController.php +++ /dev/null @@ -1,34 +0,0 @@ -view = $view; - } - - /** - * @return ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/LandingController.php b/setup/module/Magento/Setup/src/Controller/Landing.php similarity index 65% rename from setup/module/Magento/Setup/src/Controller/LandingController.php rename to setup/module/Magento/Setup/src/Controller/Landing.php index bc82e0e8973f4..ff48822b6a713 100644 --- a/setup/module/Magento/Setup/src/Controller/LandingController.php +++ b/setup/module/Magento/Setup/src/Controller/Landing.php @@ -11,18 +11,13 @@ use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Model\ViewModel; -class LandingController extends AbstractActionController +class Landing extends AbstractActionController { /** * @var ServiceLocatorInterface */ protected $serviceLocator; - /** - * @var ViewModel - */ - protected $view; - /** * @var array */ @@ -30,15 +25,12 @@ class LandingController extends AbstractActionController /** * @param ServiceLocatorInterface $serviceLocator - * @param ViewModel $view * @param DirectoryList $directoryList */ public function __construct( ServiceLocatorInterface $serviceLocator, - ViewModel $view, DirectoryList $directoryList ) { - $this->view = $view; $jsonFile = new JsonFile($directoryList->getRoot() . '/composer.json'); $this->composerJson = $jsonFile->read(); } @@ -48,10 +40,11 @@ public function __construct( */ public function indexAction() { - $this->view->setTerminal(true); - $this->view->setVariable('languages', $this->serviceLocator->get('config')['languages']); - $this->view->setVariable('location', 'en_US'); - $this->view->setVariable('version', $this->composerJson['version']); - return $this->view; + $view = new ViewModel; + $view->setTerminal(true); + $view->setVariable('languages', $this->serviceLocator->get('config')['languages']); + $view->setVariable('location', 'en_US'); + $view->setVariable('version', $this->composerJson['version']); + return $view; } } diff --git a/setup/module/Magento/Setup/src/Controller/LicenseController.php b/setup/module/Magento/Setup/src/Controller/License.php similarity index 53% rename from setup/module/Magento/Setup/src/Controller/LicenseController.php rename to setup/module/Magento/Setup/src/Controller/License.php index de1097f000e0f..c92b5c72479b5 100644 --- a/setup/module/Magento/Setup/src/Controller/LicenseController.php +++ b/setup/module/Magento/Setup/src/Controller/License.php @@ -4,7 +4,7 @@ */ namespace Magento\Setup\Controller; -use Magento\Setup\Model\License; +use Magento\Setup\Model\License as LicenseModel; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; @@ -13,32 +13,23 @@ * * @package Magento\Setup\Controller */ -class LicenseController extends AbstractActionController +class License extends AbstractActionController { - /** - * View object - * - * @var \Zend\View\Model\ViewModel - */ - protected $view; - /** * Licence Model * - * @var License + * @var LicenseModel */ protected $license; /** * Constructor * - * @param License $license - * @param ViewModel $view + * @param LicenseModel $license */ - public function __construct(License $license, ViewModel $view) + public function __construct(LicenseModel $license) { $this->license = $license; - $this->view = $view; } /** @@ -49,12 +40,13 @@ public function __construct(License $license, ViewModel $view) public function indexAction() { $contents = $this->license->getContents(); + $view = new ViewModel; if ($contents === false) { - $this->view->setTemplate('error/404'); - $this->view->setVariable('message', 'Cannot find license file.'); + $view->setTemplate('error/404'); + $view->setVariable('message', 'Cannot find license file.'); } else { - $this->view->setVariable('license', $contents); + $view->setVariable('license', $contents); } - return $this->view; + return $view; } } diff --git a/setup/module/Magento/Setup/src/Controller/Navigation.php b/setup/module/Magento/Setup/src/Controller/Navigation.php new file mode 100644 index 0000000000000..1c86b21fbb3e8 --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/Navigation.php @@ -0,0 +1,48 @@ +navigation = $navigation; + } + + /** + * @return JsonModel + */ + public function indexAction() + { + $json = new JsonModel; + return $json->setVariable('nav', $this->navigation->getData()); + } + + /** + * @return array|ViewModel + */ + public function menuAction() + { + $view = new ViewModel; + $view->setTemplate('/magento/setup/navigation/menu.phtml'); + $view->setTerminal(true); + $view->setVariable('menu', $this->navigation->getMenuItems()); + $view->setVariable('main', $this->navigation->getMainItems()); + return $view; + } +} diff --git a/setup/module/Magento/Setup/src/Controller/ReadinessCheck.php b/setup/module/Magento/Setup/src/Controller/ReadinessCheck.php new file mode 100644 index 0000000000000..7c7b5acbede96 --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/ReadinessCheck.php @@ -0,0 +1,32 @@ +setTerminal(true); + return $view; + } + + /** + * @return array|ViewModel + */ + public function progressAction() + { + $view = new ViewModel; + $view->setTemplate('/magento/setup/readiness-check/progress.phtml'); + $view->setTerminal(true); + return $view; + } +} diff --git a/setup/module/Magento/Setup/src/Controller/ReadinessCheck/ProgressController.php b/setup/module/Magento/Setup/src/Controller/ReadinessCheck/ProgressController.php deleted file mode 100644 index 0b8053c2ac205..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/ReadinessCheck/ProgressController.php +++ /dev/null @@ -1,33 +0,0 @@ -view = $view; - } - - /** - * @return array|ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/ReadinessCheckController.php b/setup/module/Magento/Setup/src/Controller/ReadinessCheckController.php deleted file mode 100644 index 9df53e6cb99f4..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/ReadinessCheckController.php +++ /dev/null @@ -1,33 +0,0 @@ -view = $view; - } - - /** - * @return array|ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/Data/ResponseTypeInterface.php b/setup/module/Magento/Setup/src/Controller/ResponseTypeInterface.php similarity index 87% rename from setup/module/Magento/Setup/src/Controller/Data/ResponseTypeInterface.php rename to setup/module/Magento/Setup/src/Controller/ResponseTypeInterface.php index a95fd9a71f274..c47caa7d9450f 100644 --- a/setup/module/Magento/Setup/src/Controller/Data/ResponseTypeInterface.php +++ b/setup/module/Magento/Setup/src/Controller/ResponseTypeInterface.php @@ -3,7 +3,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Setup\Controller\Data; +namespace Magento\Setup\Controller; interface ResponseTypeInterface { diff --git a/setup/module/Magento/Setup/src/Controller/Success.php b/setup/module/Magento/Setup/src/Controller/Success.php new file mode 100644 index 0000000000000..c8451a8397b95 --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/Success.php @@ -0,0 +1,21 @@ +setTerminal(true); + return $view; + } +} diff --git a/setup/module/Magento/Setup/src/Controller/SuccessController.php b/setup/module/Magento/Setup/src/Controller/SuccessController.php deleted file mode 100644 index 85548f2d13199..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/SuccessController.php +++ /dev/null @@ -1,34 +0,0 @@ -view = $view; - } - - /** - * @return ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - return $this->view; - } -} diff --git a/setup/module/Magento/Setup/src/Controller/WebConfiguration.php b/setup/module/Magento/Setup/src/Controller/WebConfiguration.php new file mode 100644 index 0000000000000..c7708bbf10ce1 --- /dev/null +++ b/setup/module/Magento/Setup/src/Controller/WebConfiguration.php @@ -0,0 +1,25 @@ + $setupInfo->getProjectUrl()]); + $view->setTerminal(true); + return $view; + } +} diff --git a/setup/module/Magento/Setup/src/Controller/WebConfigurationController.php b/setup/module/Magento/Setup/src/Controller/WebConfigurationController.php deleted file mode 100644 index 8269fe42a5d6b..0000000000000 --- a/setup/module/Magento/Setup/src/Controller/WebConfigurationController.php +++ /dev/null @@ -1,34 +0,0 @@ -view = $view; - } - - /** - * @return array|ViewModel - */ - public function indexAction() - { - $this->view->setTerminal(true); - - return $this->view; - } -} diff --git a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled_rollback.php b/setup/module/Magento/Setup/src/Exception.php similarity index 60% rename from dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled_rollback.php rename to setup/module/Magento/Setup/src/Exception.php index 7c31f403a1c63..19b14c09ca897 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/controllers/_files/cache/all_types_disabled_rollback.php +++ b/setup/module/Magento/Setup/src/Exception.php @@ -3,4 +3,8 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -include __DIR__ . '/empty_storage.php'; +namespace Magento\Setup; + +class Exception extends \Exception +{ +} diff --git a/setup/module/Magento/Setup/src/Model/ConsoleLogger.php b/setup/module/Magento/Setup/src/Model/ConsoleLogger.php index 64d7b770d11df..bf38f3895f4f9 100644 --- a/setup/module/Magento/Setup/src/Model/ConsoleLogger.php +++ b/setup/module/Magento/Setup/src/Model/ConsoleLogger.php @@ -15,6 +15,13 @@ */ class ConsoleLogger implements LoggerInterface { + /** + * Indicator of whether inline output is started + * + * @var bool + */ + private $isInline = false; + /** * Console * @@ -23,7 +30,7 @@ class ConsoleLogger implements LoggerInterface protected $console; /** - * Default Constructor + * Constructor */ public function __construct() { @@ -35,6 +42,7 @@ public function __construct() */ public function logSuccess($message) { + $this->terminateLine(); $this->console->writeLine("[SUCCESS]" . ($message ? ": $message" : ''), ColorInterface::LIGHT_GREEN); } @@ -43,19 +51,26 @@ public function logSuccess($message) */ public function logError(\Exception $e) { + $this->terminateLine(); $this->console->writeLine("[ERROR]: " . $e, ColorInterface::LIGHT_RED); } /** * {@inheritdoc} */ - public function log($message, $addEol = true) + public function log($message) { - if ($addEol) { - $this->console->writeLine($message, ColorInterface::LIGHT_BLUE); - } else { - $this->console->write($message, ColorInterface::LIGHT_BLUE); - } + $this->terminateLine(); + $this->console->writeLine($message, ColorInterface::LIGHT_BLUE); + } + + /** + * {@inheritdoc} + */ + public function logInline($message) + { + $this->isInline = true; + $this->console->write($message, ColorInterface::LIGHT_BLUE); } /** @@ -63,6 +78,20 @@ public function log($message, $addEol = true) */ public function logMeta($message) { + $this->terminateLine(); $this->console->writeLine($message, ColorInterface::GRAY); } + + /** + * Terminates line if the inline logging is started + * + * @return void + */ + private function terminateLine() + { + if ($this->isInline) { + $this->isInline = false; + $this->console->writeLine(''); + } + } } diff --git a/setup/module/Magento/Setup/src/Module/Setup/ConfigMapper.php b/setup/module/Magento/Setup/src/Model/DeploymentConfigMapper.php similarity index 96% rename from setup/module/Magento/Setup/src/Module/Setup/ConfigMapper.php rename to setup/module/Magento/Setup/src/Model/DeploymentConfigMapper.php index 103fa5d88b265..806da679ba536 100644 --- a/setup/module/Magento/Setup/src/Module/Setup/ConfigMapper.php +++ b/setup/module/Magento/Setup/src/Model/DeploymentConfigMapper.php @@ -3,7 +3,7 @@ * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ -namespace Magento\Setup\Module\Setup; +namespace Magento\Setup\Model; use Magento\Framework\App\DeploymentConfig\BackendConfig; use Magento\Framework\App\DeploymentConfig\DbConfig; @@ -11,7 +11,7 @@ use Magento\Framework\App\DeploymentConfig\InstallConfig; use Magento\Framework\App\DeploymentConfig\SessionConfig; -class ConfigMapper +class DeploymentConfigMapper { /**#@+ * Parameters for setup tool diff --git a/setup/module/Magento/Setup/src/Model/Installer.php b/setup/module/Magento/Setup/src/Model/Installer.php index c44216579994f..dc215a7db0cd9 100644 --- a/setup/module/Magento/Setup/src/Model/Installer.php +++ b/setup/module/Magento/Setup/src/Model/Installer.php @@ -23,11 +23,9 @@ use Magento\Framework\Shell; use Magento\Framework\Shell\CommandRenderer; use Magento\Setup\Module\ConnectionFactory; -use Magento\Setup\Module\Setup\ConfigMapper; use Magento\Setup\Module\SetupFactory; use Magento\Setup\Mvc\Bootstrap\InitParamListener; use Magento\Store\Model\Store; -use Symfony\Component\Process\PhpExecutableFinder; use Zend\ServiceManager\ServiceLocatorInterface; /** @@ -67,6 +65,11 @@ class Installer const INFO_MESSAGE = 'message'; + /** + * The lowest supported MySQL verion + */ + const MYSQL_VERSION_REQUIRED = '5.6.0'; + /** * File permissions checker * @@ -137,13 +140,6 @@ class Installer */ private $connectionFactory; - /** - * Shell executor - * - * @var Shell - */ - private $shell; - /** * Shell command renderer * @@ -180,11 +176,21 @@ class Installer private $installInfo = []; /** - * A materialized string of initialization parameters to pass on any script that's run externally by this model + * Initialization parameters for Magento application bootstrap * * @var string */ - private $execParams; + private $initParams; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + /** + * @var \Magento\Framework\App\DeploymentConfig + */ + private $deploymentConfig; /** * @var SampleData @@ -196,6 +202,7 @@ class Installer * * @param FilePermissions $filePermissions * @param Writer $deploymentConfigWriter + * @param \Magento\Framework\App\DeploymentConfig $deploymentConfig * @param SetupFactory $setupFactory * @param ModuleListInterface $moduleList * @param ModuleLoader $moduleLoader @@ -212,6 +219,7 @@ class Installer public function __construct( FilePermissions $filePermissions, Writer $deploymentConfigWriter, + \Magento\Framework\App\DeploymentConfig $deploymentConfig, SetupFactory $setupFactory, ModuleListInterface $moduleList, ModuleLoader $moduleLoader, @@ -235,13 +243,13 @@ public function __construct( $this->log = $log; $this->random = $random; $this->connectionFactory = $connectionFactory; - $this->shellRenderer = new CommandRenderer(); - $this->shell = new Shell($this->shellRenderer); + $this->shellRenderer = new CommandRenderer; $this->maintenanceMode = $maintenanceMode; $this->filesystem = $filesystem; - $this->execParams = urldecode(http_build_query($serviceManager->get(InitParamListener::BOOTSTRAP_PARAM))); + $this->initParams = $serviceManager->get(InitParamListener::BOOTSTRAP_PARAM); $this->sampleData = $sampleData; - $this->installInfo[self::INFO_MESSAGE] = []; + $this->installInfo[self::INFO_MESSAGE] = array(); + $this->deploymentConfig = $deploymentConfig; } /** @@ -261,7 +269,7 @@ public function install($request) } $script[] = ['Installing database schema:', 'installSchema', []]; $script[] = ['Installing user configuration...', 'installUserConfig', [$request]]; - $script[] = ['Installing data fixtures:', 'installDataFixtures', []]; + $script[] = ['Installing data...', 'installDataFixtures', []]; if (!empty($request[self::SALES_ORDER_INCREMENT_PREFIX])) { $script[] = [ 'Creating sales order increment prefix...', @@ -271,11 +279,11 @@ public function install($request) } $script[] = ['Installing admin user...', 'installAdminUser', [$request]]; $script[] = ['Enabling caches:', 'enableCaches', []]; - $script[] = ['Disabling Maintenance Mode:', 'setMaintenanceMode', [0]]; - $script[] = ['Post installation file permissions check...', 'checkApplicationFilePermissions', []]; if (!empty($request[Installer::USE_SAMPLE_DATA]) && $this->sampleData->isDeployed()) { - $script[] = ['Installing Sample Data...', 'installSampleData', [$request]]; + $script[] = ['Installing sample data:', 'installSampleData', [$request]]; } + $script[] = ['Disabling Maintenance Mode:', 'setMaintenanceMode', [0]]; + $script[] = ['Post installation file permissions check...', 'checkApplicationFilePermissions', []]; $estimatedModules = $this->createModulesConfig($request); $total = count($script) + count(array_filter($estimatedModules->getData())); @@ -328,22 +336,39 @@ private function createModulesConfig($request) */ private function createBackendConfig($data) { - $backendConfigData = [ - ConfigMapper::$paramMap[ConfigMapper::KEY_BACKEND_FRONTNAME] => $data[ConfigMapper::KEY_BACKEND_FRONTNAME], - ]; + $backendConfigData = array( + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_BACKEND_FRONTNAME] => + $data[DeploymentConfigMapper::KEY_BACKEND_FRONTNAME] + ); return new BackendConfig($backendConfigData); } /** * Creates encrypt deployment configuration segment + * No new encryption key will be added if there is an existing deployment config file unless user provides one. + * Old encryption keys will persist. + * A new encryption key will be generated if there is no existing deployment config file. * * @param \ArrayObject|array $data * @return \Magento\Framework\App\DeploymentConfig\SegmentInterface */ private function createEncryptConfig($data) { + $key = $data[DeploymentConfigMapper::KEY_ENCRYPTION_KEY]; + // retrieve old encryption keys + if ($this->deploymentConfig->isAvailable()) { + $encryptInfo = $this->deploymentConfig->getSegment(EncryptConfig::CONFIG_KEY); + $oldKeys = $encryptInfo[EncryptConfig::KEY_ENCRYPTION_KEY]; + $key = empty($key) ? $oldKeys : $oldKeys . "\n" . $key; + } else if (empty($key)) { + $key = md5($this->random->getRandomString(10)); + } $cryptConfigData = - [ConfigMapper::$paramMap[ConfigMapper::KEY_ENCRYPTION_KEY] => $data[ConfigMapper::KEY_ENCRYPTION_KEY]]; + [DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_ENCRYPTION_KEY] => $key]; + + // find the latest key to display + $keys = explode("\n", $key); + $this->installInfo[EncryptConfig::KEY_ENCRYPTION_KEY] = array_pop($keys); return new EncryptConfig($cryptConfigData); } @@ -356,19 +381,25 @@ private function createEncryptConfig($data) private function createDbConfig($data) { $defaultConnection = [ - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_HOST] => $data[ConfigMapper::KEY_DB_HOST], - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_INIT_STATEMENTS] => isset($data[ConfigMapper::KEY_DB_INIT_STATEMENTS]) ? $data[ConfigMapper::KEY_DB_INIT_STATEMENTS] : null, - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_MODEL] => isset($data[ConfigMapper::KEY_DB_MODEL]) ? - $data[ConfigMapper::KEY_DB_MODEL] : null, - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_NAME] => $data[ConfigMapper::KEY_DB_NAME], - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_PASS] => isset($data[ConfigMapper::KEY_DB_PASS]) ? - $data[ConfigMapper::KEY_DB_PASS] : null, - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_USER] => $data[ConfigMapper::KEY_DB_USER], + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_HOST] => + $data[DeploymentConfigMapper::KEY_DB_HOST], + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_INIT_STATEMENTS] => + isset($data[DeploymentConfigMapper::KEY_DB_INIT_STATEMENTS]) ? + $data[DeploymentConfigMapper::KEY_DB_INIT_STATEMENTS] : null, + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_MODEL] => + isset($data[DeploymentConfigMapper::KEY_DB_MODEL]) ? $data[DeploymentConfigMapper::KEY_DB_MODEL] : null, + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_NAME] => + $data[DeploymentConfigMapper::KEY_DB_NAME], + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_PASS] => + isset($data[DeploymentConfigMapper::KEY_DB_PASS]) ? $data[DeploymentConfigMapper::KEY_DB_PASS] : null, + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_USER] => + $data[DeploymentConfigMapper::KEY_DB_USER], ]; $dbConfigData = [ - ConfigMapper::$paramMap[ConfigMapper::KEY_DB_PREFIX] => isset($data[ConfigMapper::KEY_DB_PREFIX]) ? - $data[ConfigMapper::KEY_DB_PREFIX] : null, + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DB_PREFIX] => + isset($data[DeploymentConfigMapper::KEY_DB_PREFIX]) ? + $data[DeploymentConfigMapper::KEY_DB_PREFIX] : null, 'connection' => [ 'default' => $defaultConnection, ], @@ -384,7 +415,11 @@ private function createDbConfig($data) */ private function createSessionConfig($data) { - $sessionConfigData = [ConfigMapper::$paramMap[ConfigMapper::KEY_SESSION_SAVE] => isset($data[ConfigMapper::KEY_SESSION_SAVE]) ? $data[ConfigMapper::KEY_SESSION_SAVE] : null]; + $sessionConfigData = [ + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_SESSION_SAVE] => + isset($data[DeploymentConfigMapper::KEY_SESSION_SAVE]) ? + $data[DeploymentConfigMapper::KEY_SESSION_SAVE] : null + ]; return new SessionConfig($sessionConfigData); } @@ -396,7 +431,10 @@ private function createSessionConfig($data) */ private function createInstallConfig($data) { - $installConfigData = [ConfigMapper::$paramMap[ConfigMapper::KEY_DATE] => $data[ConfigMapper::KEY_DATE]]; + $installConfigData = [ + DeploymentConfigMapper::$paramMap[DeploymentConfigMapper::KEY_DATE] => + $data[DeploymentConfigMapper::KEY_DATE] + ]; return new InstallConfig($installConfigData); } @@ -487,11 +525,8 @@ public function checkApplicationFilePermissions() */ public function installDeploymentConfig($data) { + $this->checkInstallationFilePermissions(); $data[InstallConfig::KEY_DATE] = date('r'); - if (empty($data[EncryptConfig::KEY_ENCRYPTION_KEY])) { - $data[EncryptConfig::KEY_ENCRYPTION_KEY] = md5($this->random->getRandomString(10)); - } - $this->installInfo[EncryptConfig::KEY_ENCRYPTION_KEY] = $data[EncryptConfig::KEY_ENCRYPTION_KEY]; $configs = [ $this->createBackendConfig($data), @@ -512,6 +547,9 @@ public function installDeploymentConfig($data) */ public function installSchema() { + $this->assertDeploymentConfigExists(); + $this->assertDbAccessible(); + $moduleNames = $this->moduleList->getNames(); $this->log->log('Schema creation/updates:'); @@ -538,8 +576,13 @@ public function installSchema() */ public function installDataFixtures() { - $params = [$this->directoryList->getRoot() . '/dev/shell/run_data_fixtures.php', $this->execParams]; - $this->exec('-f %s -- --bootstrap=%s', $params); + $this->checkInstallationFilePermissions(); + $this->assertDeploymentConfigExists(); + $this->assertDbAccessible(); + + /** @var \Magento\Framework\Module\Updater $updater */ + $updater = $this->getObjectManager()->create('Magento\Framework\Module\Updater'); + $updater->updateData(); } /** @@ -555,9 +598,14 @@ public function installUserConfig($data) if (count($configData) === 0) { return; } - $data = urldecode(http_build_query($configData)); - $params = [$this->directoryList->getRoot() . '/dev/shell/user_config_data.php', $data, $this->execParams]; - $this->exec('-f %s -- --data=%s --bootstrap=%s', $params); + + /** @var \Magento\Backend\Model\Config\Factory $configFactory */ + $configFactory = $this->getObjectManager()->create('Magento\Backend\Model\Config\Factory'); + foreach ($configData as $key => $val) { + $configModel = $configFactory->create(); + $configModel->setDataByPath($key, $val); + $configModel->save(); + } } /** @@ -610,6 +658,7 @@ private function installOrderIncrementPrefix($orderIncrementPrefix) */ public function installAdminUser($data) { + $this->assertDeploymentConfigExists(); $setup = $this->setupFactory->createSetup($this->log); $adminAccount = $this->adminAccountFactory->create($setup, (array)$data); $adminAccount->save(); @@ -640,8 +689,14 @@ public function uninstall() */ private function enableCaches() { - $args = [$this->directoryList->getRoot() . '/dev/shell/cache.php', $this->execParams]; - $this->exec('-f %s -- --set=1 --bootstrap=%s', $args); + /** @var \Magento\Framework\App\Cache\Manager $cacheManager */ + $cacheManager = $this->getObjectManager()->create('Magento\Framework\App\Cache\Manager'); + $types = $cacheManager->getAvailableTypes(); + $enabledTypes = $cacheManager->setEnabled($types, true); + $cacheManager->clean($enabledTypes); + + $this->log->log('Current status:'); + $this->log->log(print_r($cacheManager->getStatus(), true)); } /** @@ -655,34 +710,6 @@ private function setMaintenanceMode($value) $this->maintenanceMode->set($value); } - /** - * Executes a command in CLI - * - * @param string $command - * @param array $args - * @return void - * @throws \Exception - */ - private function exec($command, $args) - { - $phpFinder = new PhpExecutableFinder(); - $phpPath = $phpFinder->find(); - if (!$phpPath) { - throw new \Exception( - 'Cannot find PHP executable path.' - . ' Please set $PATH environment variable to include the full path of the PHP executable' - ); - } - $command = $phpPath . ' ' . $command; - $actualCommand = $this->shellRenderer->render($command, $args); - $this->log->log($actualCommand); - $handle = popen($actualCommand, 'r'); - while (!feof($handle)) { - $this->log->log(fread($handle, 8192), false); - } - pclose($handle); - } - /** * Checks Database Connection * @@ -691,7 +718,7 @@ private function exec($command, $args) * @param string $dbUser * @param string $dbPass * @return boolean - * @throws \Exception + * @throws \Magento\Setup\Exception */ public function checkDatabaseConnection($dbName, $dbHost, $dbUser, $dbPass = '') { @@ -704,7 +731,20 @@ public function checkDatabaseConnection($dbName, $dbHost, $dbUser, $dbPass = '') ]); if (!$connection) { - throw new \Exception('Database connection failure.'); + throw new \Magento\Setup\Exception('Database connection failure.'); + } + + $mysqlVersion = $connection->fetchOne('SELECT version()'); + if ($mysqlVersion) { + if (preg_match('/^([0-9\.]+)/', $mysqlVersion, $matches)) { + if (isset($matches[1]) && !empty($matches[1])) { + if (version_compare($matches[1], self::MYSQL_VERSION_REQUIRED) < 0) { + throw new \Magento\Setup\Exception( + 'Sorry, but we support MySQL version '. self::MYSQL_VERSION_REQUIRED . ' or later.' + ); + } + } + } } return true; } @@ -727,10 +767,8 @@ public function getInstallInfo() private function cleanupDb() { // stops cleanup if app/etc/config.php does not exist - if ($this->filesystem->getDirectoryWrite(DirectoryList::CONFIG)->isFile('config.php')) { - $reader = new \Magento\Framework\App\DeploymentConfig\Reader($this->directoryList); - $deploymentConfig = new \Magento\Framework\App\DeploymentConfig($reader, []); - $dbConfig = new DbConfig($deploymentConfig->getSegment(DbConfig::CONFIG_KEY)); + if ($this->deploymentConfig->isAvailable()) { + $dbConfig = new DbConfig($this->deploymentConfig->getSegment(DbConfig::CONFIG_KEY)); $config = $dbConfig->getConnection(\Magento\Framework\App\Resource\Config::DEFAULT_SETUP_CONNECTION); if ($config) { try { @@ -801,13 +839,59 @@ private function deleteDeploymentConfig() } } + /** + * Get object manager for Magento application + * + * @return \Magento\Framework\ObjectManagerInterface + */ + private function getObjectManager() + { + if (null === $this->objectManager) { + $this->assertDeploymentConfigExists(); + $factory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $this->initParams); + $this->objectManager = $factory->create($this->initParams); + } + return $this->objectManager; + } + + /** + * Validates that deployment configuration exists + * + * @throws \Magento\Setup\Exception + */ + private function assertDeploymentConfigExists() + { + if (!$this->deploymentConfig->isAvailable()) { + throw new \Magento\Setup\Exception("Can't run this operation: deployment configuration is absent."); + } + } + + /** + * Validates that MySQL is accessible and MySQL version is supported + * + * @return void + */ + private function assertDbAccessible() + { + $dbConfig = new DbConfig($this->deploymentConfig->getSegment(DbConfig::CONFIG_KEY)); + $config = $dbConfig->getConnection(\Magento\Framework\App\Resource\Config::DEFAULT_SETUP_CONNECTION); + $this->checkDatabaseConnection( + $config[DbConfig::KEY_NAME], + $config[DbConfig::KEY_HOST], + $config[DbConfig::KEY_USER], + $config[DbConfig::KEY_PASS] + ); + } + /** * Run installation process for Sample Data * * @param array $request + * @return void */ private function installSampleData($request) { - $this->exec($this->sampleData->getRunCommand($request), [$this->execParams]); + $userName = isset($request[AdminAccount::KEY_USERNAME]) ? $request[AdminAccount::KEY_USERNAME] : ''; + $this->sampleData->install($this->getObjectManager(), $this->log, $userName); } } diff --git a/setup/module/Magento/Setup/src/Model/InstallerFactory.php b/setup/module/Magento/Setup/src/Model/InstallerFactory.php index ee1937de4fa2b..84b8b76bb0321 100644 --- a/setup/module/Magento/Setup/src/Model/InstallerFactory.php +++ b/setup/module/Magento/Setup/src/Model/InstallerFactory.php @@ -37,6 +37,7 @@ public function create(LoggerInterface $log) return new Installer( $this->serviceLocator->get('Magento\Setup\Model\FilePermissions'), $this->serviceLocator->get('Magento\Framework\App\DeploymentConfig\Writer'), + $this->serviceLocator->get('Magento\Framework\App\DeploymentConfig'), $this->serviceLocator->get('Magento\Setup\Module\SetupFactory'), $this->serviceLocator->get('Magento\Framework\Module\ModuleList'), $this->serviceLocator->get('Magento\Framework\Module\ModuleList\Loader'), diff --git a/setup/module/Magento/Setup/src/Model/Lists.php b/setup/module/Magento/Setup/src/Model/Lists.php index 214db7f94af04..6fed03c6b3af1 100644 --- a/setup/module/Magento/Setup/src/Model/Lists.php +++ b/setup/module/Magento/Setup/src/Model/Lists.php @@ -6,6 +6,7 @@ namespace Magento\Setup\Model; use Zend_Locale; +use Magento\Framework\Locale\ConfigInterface; class Lists { @@ -16,14 +17,23 @@ class Lists */ protected $zendLocale; + /** + * List of allowed locales + * + * @var array + */ + protected $allowedLocales; + /** * Constructor * * @param Zend_Locale $zendLocale + * @param ConfigInterface $localeConfig */ - public function __construct(Zend_Locale $zendLocale) + public function __construct(Zend_Locale $zendLocale, ConfigInterface $localeConfig) { $this->zendLocale = $zendLocale; + $this->allowedLocales = $localeConfig->getAllowedLocales(); } /** @@ -67,15 +77,24 @@ public function getLocaleList() { $languages = $this->zendLocale->getTranslationList('Language'); $countries = $this->zendLocale->getTranslationList('Territory'); - $locale = $this->zendLocale->getLocaleList(); + $locales = $this->zendLocale->getLocaleList(); + + $allowedAliases = []; + foreach ($this->allowedLocales as $code) { + $allowedAliases[$this->zendLocale->getAlias($code)] = $code; + } + $list = []; - foreach ($locale as $key => $value) { - if (strstr($key, '_')) { - $data = explode('_', $key); + foreach (array_keys($locales) as $code) { + if (array_key_exists($code, $allowedAliases)) { + $code = $allowedAliases[$code]; + } + if (strstr($code, '_')) { + $data = explode('_', $code); if (!isset($languages[$data[0]]) || !isset($countries[$data[1]])) { continue; } - $list[$key] = $languages[$data[0]] . ' (' . $countries[$data[1]] . ')'; + $list[$code] = $languages[$data[0]] . ' (' . $countries[$data[1]] . ')'; } } asort($list); diff --git a/setup/module/Magento/Setup/src/Model/LoggerInterface.php b/setup/module/Magento/Setup/src/Model/LoggerInterface.php index 7e01979bbe503..6d724d1d2c8b3 100644 --- a/setup/module/Magento/Setup/src/Model/LoggerInterface.php +++ b/setup/module/Magento/Setup/src/Model/LoggerInterface.php @@ -7,8 +7,6 @@ /** * Interface to Log Message in Setup - * - * @package Magento\Setup\Model */ interface LoggerInterface { @@ -36,6 +34,14 @@ public function logError(\Exception $e); */ public function log($message); + /** + * Logs a message in the current line + * + * @param string $message + * @return void + */ + public function logInline($message); + /** * Logs meta information * diff --git a/setup/module/Magento/Setup/src/Model/PhpExtensions.php b/setup/module/Magento/Setup/src/Model/PhpExtensions.php deleted file mode 100644 index 594c1d1e00a3a..0000000000000 --- a/setup/module/Magento/Setup/src/Model/PhpExtensions.php +++ /dev/null @@ -1,114 +0,0 @@ -fileReader = $fileReader; - } - - /** - * Retrieve list of required extensions - * - * Collect required extensions from Magento modules composer.json files - * - * @return array - */ - public function getRequired() - { - if (!$this->required) { - $extensions = []; - foreach ($this->fileReader->read() as $object) { - if (!property_exists($object, 'require')) { - continue; - } - $items = get_object_vars($object->require); - $items = array_filter(array_keys($items), [$this, 'filter']); - if ($items) { - $extensions = array_merge($extensions, $items); - } - } - - $extensions = array_unique($extensions); - array_walk($extensions, [$this, 'process']); - - $this->required = array_values($extensions); - unset($extensions); - } - return $this->required; - } - - /** - * Retrieve list of currently installed extensions - * - * @return array - */ - public function getCurrent() - { - if (!$this->current) { - foreach ($this->required as $extension) { - if (extension_loaded($extension)) { - $this->current[] = $extension; - } - } - } - return $this->current; - } - - /** - * Aplly filter to array of required items - * - * If item has prefix 'ext-' then return TRUE, otherwise return FALSE. - * - * @param string $value - * @return bool - */ - protected function filter($value) - { - return strpos($value, 'ext-') === 0; - } - - /** - * Process extension name - * - * Remove 'ext-' prefix from extension name. - * - * @param string $value - */ - protected function process(&$value) - { - $value = preg_replace('/^ext-/', '', $value); - } -} diff --git a/setup/module/Magento/Setup/src/Model/PhpInformation.php b/setup/module/Magento/Setup/src/Model/PhpInformation.php new file mode 100644 index 0000000000000..497734cc1e90f --- /dev/null +++ b/setup/module/Magento/Setup/src/Model/PhpInformation.php @@ -0,0 +1,129 @@ +rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT); + } + + /** + * Retrieves required php version + * + * @return string + * @throws \Exception If attributes are missing in composer.lock file. + */ + public function getRequiredPhpVersion() + { + $composerInfo = $this->getComposerInfo(); + if (!empty($composerInfo['platform']['php'])) { + return $composerInfo['platform']['php']; + } else { + throw new \Exception('Missing key \'platform=>php\' in \'composer.lock\' file'); + } + } + + /** + * Retrieve list of required extensions + * + * Collect required extensions from composer.lock file + * + * @return array + * @throws \Exception If attributes are missing in composer.lock file. + */ + public function getRequired() + { + if (null === $this->required) { + $composerInfo = $this->getComposerInfo(); + $declaredDependencies = []; + + if (!empty($composerInfo['platform-dev'])) { + $declaredDependencies = array_merge($declaredDependencies, array_keys($composerInfo['platform-dev'])); + } else { + throw new \Exception('Missing key \'platform-dev\' in \'composer.lock\' file'); + } + if (!empty($composerInfo['packages'])) { + foreach ($composerInfo['packages'] as $package) { + if (!empty($package['require'])) { + $declaredDependencies = array_merge($declaredDependencies, array_keys($package['require'])); + } + } + } else { + throw new \Exception('Missing key \'packages\' in \'composer.lock\' file'); + } + if ($declaredDependencies) { + $declaredDependencies = array_unique($declaredDependencies); + $phpDependencies = []; + foreach ($declaredDependencies as $dependency) { + if (stripos($dependency, 'ext-') === 0) { + $phpDependencies[] = substr($dependency, 4); + } + } + $this->required = array_unique($phpDependencies); + } + } + return $this->required; + } + + /** + * Checks existence of composer.lock and returns its contents + * + * @return array + * @throws \Exception + */ + private function getComposerInfo() + { + if (!$this->rootDir->isExist('composer.lock')) { + throw new \Exception('Cannot read \'composer.lock\' file'); + } + return json_decode($this->rootDir->readFile('composer.lock'), true); + } + + /** + * Retrieve list of currently installed extensions + * + * @return array + */ + public function getCurrent() + { + if (!$this->current) { + $this->current = array_map('strtolower', get_loaded_extensions()); + } + return $this->current; + } +} diff --git a/setup/module/Magento/Setup/src/Model/SampleData.php b/setup/module/Magento/Setup/src/Model/SampleData.php index ab58255566761..bd7904b0e7324 100644 --- a/setup/module/Magento/Setup/src/Model/SampleData.php +++ b/setup/module/Magento/Setup/src/Model/SampleData.php @@ -6,48 +6,71 @@ namespace Magento\Setup\Model; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\Filesystem; +use Magento\Framework\ObjectManagerInterface; /** - * Class SampleData + * Sample data installer + * + * Serves as an integration point between Magento Setup application and Luma sample data component */ class SampleData { - const INSTALLER_PATH = 'dev/tools/Magento/Tools/SampleData/install.php'; + /** + * Path to the sample data application + */ + const PATH = 'dev/tools/Magento/Tools/SampleData'; /** - * @var DirectoryList + * @var \Magento\Framework\Filesystem\Directory\ReadInterface */ - private $directoryList; + private $rootDir; /** - * @param DirectoryList $directoryList + * @param Filesystem $filesystem */ - public function __construct(DirectoryList $directoryList) + public function __construct(Filesystem $filesystem) { - $this->directoryList = $directoryList; + $this->rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT); } /** * Check if Sample Data was deployed * * @return bool - * @throws \Magento\Framework\Exception */ public function isDeployed() { - return is_file($this->directoryList->getRoot() . DIRECTORY_SEPARATOR . self::INSTALLER_PATH); + return $this->rootDir->isExist(self::PATH); } /** - * Returns command to be executed for Sample Data installation + * Installation routine for creating sample data * - * @param \ArrayObject|array $request - * @return string + * @param ObjectManagerInterface $objectManager + * @param LoggerInterface $logger + * @param $adminUserName + * @throws \Exception */ - public function getRunCommand($request) + public function install(ObjectManagerInterface $objectManager, LoggerInterface $logger, $adminUserName) { - $userName = isset($request[AdminAccount::KEY_USERNAME]) ? $request[AdminAccount::KEY_USERNAME] : ''; - return $command = ' -f ' . $this->directoryList->getRoot() . DIRECTORY_SEPARATOR . self::INSTALLER_PATH . - ' -- --admin_username=' . $userName . ' --bootstrap=%s'; + /** @var \Magento\Tools\SampleData\Logger $sampleDataLogger */ + $sampleDataLogger = $objectManager->get('Magento\Tools\SampleData\Logger'); + $sampleDataLogger->setSubject($logger); + + $areaCode = 'adminhtml'; + /** @var \Magento\Framework\App\State $appState */ + $appState = $objectManager->get('Magento\Framework\App\State'); + $appState->setAreaCode($areaCode); + /** @var \Magento\Framework\App\ObjectManager\ConfigLoader $configLoader */ + $configLoader = $objectManager->get('Magento\Framework\App\ObjectManager\ConfigLoader'); + $objectManager->configure($configLoader->load($areaCode)); + + /** @var \Magento\User\Model\UserFactory $userFactory */ + $userFactory = $objectManager->get('Magento\User\Model\UserFactory'); + $user = $userFactory->create()->loadByUsername($adminUserName); + + $installer = $objectManager->get('Magento\Tools\SampleData\Installer'); + $installer->run($user); } } diff --git a/setup/module/Magento/Setup/src/Model/UserConfigurationDataMapper.php b/setup/module/Magento/Setup/src/Model/UserConfigurationDataMapper.php index 92f6136bcb4dd..256ba5ff1f84f 100644 --- a/setup/module/Magento/Setup/src/Model/UserConfigurationDataMapper.php +++ b/setup/module/Magento/Setup/src/Model/UserConfigurationDataMapper.php @@ -40,6 +40,9 @@ class UserConfigurationDataMapper private static $pathDataMap = [ Store::XML_PATH_USE_REWRITES => self::KEY_USE_SEF_URL, Store::XML_PATH_UNSECURE_BASE_URL => self::KEY_BASE_URL, + Store::XML_PATH_SECURE_IN_FRONTEND => self::KEY_IS_SECURE, + Store::XML_PATH_SECURE_BASE_URL => self::KEY_BASE_URL_SECURE, + Store::XML_PATH_SECURE_IN_ADMINHTML => self::KEY_IS_SECURE_ADMIN, Data::XML_PATH_DEFAULT_LOCALE => self::KEY_LANGUAGE, Data::XML_PATH_DEFAULT_TIMEZONE => self::KEY_TIMEZONE, Currency::XML_PATH_CURRENCY_BASE => self::KEY_CURRENCY, @@ -57,8 +60,20 @@ class UserConfigurationDataMapper public function getConfigData($data) { $configData = []; + if (!((isset($data[self::KEY_IS_SECURE]) && $data[self::KEY_IS_SECURE]) + || (isset($data[self::KEY_IS_SECURE_ADMIN]) && $data[self::KEY_IS_SECURE_ADMIN])) + && isset($data[self::KEY_BASE_URL_SECURE])) { + unset($data[self::KEY_BASE_URL_SECURE]); + } foreach (self::$pathDataMap as $path => $key) { if (isset($data[$key])) { + if ((($key === self::KEY_IS_SECURE) || ($key === self::KEY_IS_SECURE_ADMIN)) + && (!isset($data[self::KEY_BASE_URL_SECURE]))) { + continue; + } + if (($key === self::KEY_BASE_URL) || ($key === self::KEY_BASE_URL_SECURE)) { + $data[$key] = rtrim($data[$key], '/') . '/'; + } $configData[$path] = $data[$key]; } } diff --git a/setup/module/Magento/Setup/src/Model/WebLogger.php b/setup/module/Magento/Setup/src/Model/WebLogger.php index 4098c8ae7edad..cce1285b33d42 100644 --- a/setup/module/Magento/Setup/src/Model/WebLogger.php +++ b/setup/module/Magento/Setup/src/Model/WebLogger.php @@ -33,6 +33,16 @@ class WebLogger implements LoggerInterface */ protected $hasError = false; + /** + * Indicator of whether inline output is started + * + * @var bool + */ + private $isInline = false; + + /** + * Constructor + */ public function __construct() { $this->logFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->logFile; @@ -64,7 +74,8 @@ private function close() */ public function logSuccess($message) { - $this->writeToFile('[SUCCESS] ' . $message . ''); + $this->terminateLine(); + $this->writeToFile('[SUCCESS] ' . $message . '
    '); } /** @@ -72,15 +83,26 @@ public function logSuccess($message) */ public function logError(\Exception $e) { - $this->writeToFile('[ERROR] ' . $e . ''); + $this->terminateLine(); + $this->writeToFile('[ERROR] ' . $e . '
    '); } /** * {@inheritdoc} */ - public function log($message, $addEol = true) + public function log($message) { - $this->writeToFile('' . $message . '', $addEol); + $this->terminateLine(); + $this->writeToFile('' . $message . '
    '); + } + + /** + * {@inheritdoc} + */ + public function logInline($message) + { + $this->isInline = true; + $this->writeToFile('' . $message . ''); } /** @@ -88,20 +110,20 @@ public function log($message, $addEol = true) */ public function logMeta($message) { - $this->writeToFile(''); + $this->terminateLine(); + $this->writeToFile('
    '); } /** * Write the message to file * * @param string $message - * @param bool $addEol * @return void */ - private function writeToFile($message, $addEol = true) + private function writeToFile($message) { $this->open('a+'); - fwrite($this->resource, $message . ($addEol ? PHP_EOL : '')); + fwrite($this->resource, $message); $this->close(); } @@ -144,4 +166,17 @@ public function clear() { unlink($this->logFile); } + + /** + * Terminates line if the inline logging is started + * + * @return void + */ + private function terminateLine() + { + if ($this->isInline) { + $this->isInline = false; + $this->writeToFile('
    '); + } + } } diff --git a/setup/module/Magento/Setup/src/Mvc/Console/RouteListener.php b/setup/module/Magento/Setup/src/Mvc/Console/RouteListener.php new file mode 100644 index 0000000000000..eca1a7d4cd119 --- /dev/null +++ b/setup/module/Magento/Setup/src/Mvc/Console/RouteListener.php @@ -0,0 +1,76 @@ +getRequest(); + // propagates to default RouteListener if not CLI + if (!$request instanceof \Zend\Console\Request) { + return null; + } + + $router = $e->getRouter(); + $match = $router->match($request); + + // CLI routing miss, checks for missing/extra parameters + if (!$match instanceof RouteMatch) { + $content = $request->getContent(); + $config = $e->getApplication()->getServiceManager()->get('Config')['console']['router']['routes']; + + $verboseValidator = new VerboseValidator(); + $validationMessages = $verboseValidator->validate($content, $config); + + if ('' !== $validationMessages) { + $this->displayMessages($e, $validationMessages); + // set error to stop propagation + $e->setError('default_error'); + } + } + return null; + } + + /** + * Display messages on console + * + * @param MvcEvent $e + * @param string $validationMessages + * @return void + */ + private function displayMessages(MvcEvent $e, $validationMessages) + { + /** @var \Zend\Console\Adapter\AdapterInterface $console */ + $console = $e->getApplication()->getServiceManager()->get('console'); + $validationMessages = $console->colorize($validationMessages, ColorInterface::RED); + $model = new ConsoleModel(); + $model->setErrorLevel(1); + $model->setResult($validationMessages); + $e->setResult($model); + } + + /** + * {@inheritdoc} + */ + public function attach(EventManagerInterface $events) + { + // set a higher priority than default route listener so it gets triggered first + $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onRoute'), 10); + } +} diff --git a/setup/module/Magento/Setup/src/Mvc/Console/RouteMatcher.php b/setup/module/Magento/Setup/src/Mvc/Console/RouteMatcher.php new file mode 100644 index 0000000000000..73ca0ba368959 --- /dev/null +++ b/setup/module/Magento/Setup/src/Mvc/Console/RouteMatcher.php @@ -0,0 +1,22 @@ +parts; + } +} diff --git a/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php b/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php new file mode 100644 index 0000000000000..8bbf4c4633635 --- /dev/null +++ b/setup/module/Magento/Setup/src/Mvc/Console/VerboseValidator.php @@ -0,0 +1,221 @@ +getParts(); + array_shift($parts); + $expectedParams = []; + foreach ($parts as $part) { + $expectedParams[$part['name']] = $part; + } + // parse user parameters + $userParams = $this->parseUserParams($data); + + $missingParams = $this->checkMissingParameter($expectedParams, $userParams); + $extraParams = $this->checkExtraParameter($expectedParams, $userParams); + $missingValues = $this->checkMissingValue($expectedParams, $userParams); + $extraValues = $this->checkExtraValue($expectedParams, $userParams); + + $validationMessages = PHP_EOL; + + if (!empty($missingParams)) { + $validationMessages .= 'Missing required parameters:' . PHP_EOL; + foreach ($missingParams as $missingParam) { + $validationMessages .= $missingParam . PHP_EOL; + } + $validationMessages .= PHP_EOL; + } + if (!empty($extraParams)) { + $validationMessages .= 'Unidentified parameters:' . PHP_EOL; + foreach ($extraParams as $extraParam) { + $validationMessages .= $extraParam . PHP_EOL; + } + $validationMessages .= PHP_EOL; + } + if (!empty($missingValues)) { + $validationMessages .= 'Parameters missing value:' . PHP_EOL; + foreach ($missingValues as $missingValue) { + $validationMessages .= $missingValue . PHP_EOL; + } + $validationMessages .= PHP_EOL; + } + if (!empty($extraValues)) { + $validationMessages .= 'Parameters that don\'t need value:' . PHP_EOL; + foreach ($extraValues as $extraValue) { + $validationMessages .= $extraValue . PHP_EOL; + } + $validationMessages .= PHP_EOL; + } + if (empty($missingParams) && empty($extraParams) && empty($missingValues) && empty($extraValue)) { + $validationMessages .= 'Please make sure parameters are in correct format and are not repeated.'; + $validationMessages .= PHP_EOL . PHP_EOL; + } + + // add usage message + $usages = ConsoleController::getCommandUsage(); + $validationMessages .= 'Usage:' . PHP_EOL . "{$userAction} "; + $validationMessages .= $usages[$userAction] . PHP_EOL . PHP_EOL; + + } else if (!is_null($userAction)) { + $validationMessages .= PHP_EOL . "Unknown action name '{$userAction}'." . PHP_EOL . PHP_EOL; + $validationMessages .= 'Available options: ' . PHP_EOL; + foreach (array_keys($config) as $action) { + $validationMessages .= $action . PHP_EOL; + } + $validationMessages .= PHP_EOL; + } + + return $validationMessages; + } + + /** + * Parse user input + * + * @param array $content + * @return array + */ + private function parseUserParams(array $content) + { + $parameters = []; + foreach ($content as $param) { + $parsed = explode('=', $param, 2); + $value = isset($parsed[1]) ? $parsed[1] : ''; + if (strpos($parsed[0], '--') !== false) { + $key = substr($parsed[0], 2, strlen($parsed[0]) - 2); + } else { + $key = $parsed[0]; + } + + $parameters[$key] = $value; + } + return $parameters; + } + /** + * Check for any missing parameters + * + * @param array $expectedParams + * @param array $actualParams + * @return array + */ + public function checkMissingParameter($expectedParams, $actualParams) + { + $missingParams = array_diff(array_keys($expectedParams), array_keys($actualParams)); + foreach ($missingParams as $key => $missingParam) { + /* disregard if optional parameter */ + if (!$expectedParams[$missingParam]['required']) { + unset($missingParams[$key]); + } + } + // some parameters have alternative names, verify user input with theses alternative names + foreach ($missingParams as $key => $missingParam) { + foreach (array_keys($actualParams) as $actualParam) { + if (isset($expectedParams[$missingParam]['alternatives'])) { + foreach ($expectedParams[$missingParam]['alternatives'] as $alternative) { + if ($actualParam === $alternative) { + unset($missingParams[$key]); + break 2; + } + } + } + } + } + return $missingParams; + } + + /** + * Check for any extra parameters + * + * @param array $expectedParams + * @param array $actualParams + * @return array + */ + public function checkExtraParameter($expectedParams, $actualParams) + { + $extraParams = array_diff(array_keys($actualParams), array_keys($expectedParams)); + // some parameters have alternative names, make sure $extraParams doesn't contain these alternatives names + foreach ($extraParams as $key => $extraParam) { + foreach ($expectedParams as $expectedParam) { + if (isset($expectedParam['alternatives'])) { + foreach ($expectedParam['alternatives'] as $alternative) { + if ($extraParam === $alternative) { + unset($extraParams[$key]); + break 2; + } + } + } + } + } + return $extraParams; + } + + /** + * Checks for parameters that are missing values + * + * @param array $expectedParams + * @param array $actualParams + * @return array + */ + public function checkMissingValue($expectedParams, $actualParams) + { + $missingValues = []; + foreach ($actualParams as $param => $value) { + if (isset($expectedParams[$param])) { + if ($value === '' && $expectedParams[$param]['hasValue']) { + $missingValues[] = $param; + } + } + } + return $missingValues; + } + + /** + * Checks for parameters that do not need values + * + * @param array $expectedParams + * @param array $actualParams + * @return array + */ + public function checkExtraValue($expectedParams, $actualParams) + { + $extraValues = []; + foreach ($actualParams as $param => $value) { + if (isset($expectedParams[$param])) { + if ($value !== '' && !$expectedParams[$param]['hasValue']) { + $extraValues[] = $param; + } + } + } + return $extraValues; + } +} diff --git a/setup/module/Magento/Setup/src/Mvc/Router/Http/Setup.php b/setup/module/Magento/Setup/src/Mvc/Router/Http/Setup.php deleted file mode 100644 index 14651fb21b109..0000000000000 --- a/setup/module/Magento/Setup/src/Mvc/Router/Http/Setup.php +++ /dev/null @@ -1,93 +0,0 @@ -') === false) { - throw new Exception\InvalidArgumentException('Missing "?" part in "regex"'); - } - - if (!isset($options['spec'])) { - throw new Exception\InvalidArgumentException('Missing "spec" in options array'); - } - - if (!isset($options['defaults'])) { - $options['defaults'] = []; - } - - return new static($options['regex'], $options['spec'], $options['defaults']); - } - - /** - * {@inheritdoc} - */ - public function match(Request $request, $pathOffset = 0) - { - if (!method_exists($request, 'getUri')) { - return null; - } - - /** @var $uri \Zend\Uri\Http */ - $uri = $request->getUri(); - $path = $uri->getPath(); - - $result = preg_match('(' . $this->regex . ')', $path, $matches, null, (int)$pathOffset); - if (!$result || !isset($matches['controller'])) { - return null; - } - - foreach ($matches as $key => $value) { - if (is_numeric($key) || is_int($key) || $value === '') { - unset($matches[$key]); - } - } - - $chunks = explode('/', substr(ltrim($path, '/'), $pathOffset)); - array_pop($chunks); // Extract 'controller' part - - array_unshift($chunks, $this->defaults['__NAMESPACE__']); - $namespace = str_replace(' ', '\\', ucwords(implode(' ', $chunks))); - - $controller = ucwords($matches['controller']); - if (false === strpos($controller, 'Controller')) { - $controller .= 'Controller'; - } - - $matches['controller'] = $controller; - $matches['__NAMESPACE__'] = str_replace(' ', '', ucwords(str_replace('-', ' ', $namespace))); - - $matchedLength = strlen($uri->getPath()) - $pathOffset; - return new RouteMatch(array_merge($this->defaults, $matches), $matchedLength); - } -} diff --git a/setup/module/Magento/Setup/view/layout/layout.phtml b/setup/module/Magento/Setup/view/layout/layout.phtml index e6970199a5d7c..a34e4d92f340c 100644 --- a/setup/module/Magento/Setup/view/layout/layout.phtml +++ b/setup/module/Magento/Setup/view/layout/layout.phtml @@ -10,25 +10,25 @@ Magento Setup Tool headLink() - ->appendStylesheet($this->basePath() . '/pub/bootstrap/css/bootstrap.min.css') - ->appendStylesheet($this->basePath() . '/pub/bootstrap/css/bootstrap-theme.min.css') - ->appendStylesheet($this->basePath() . '/pub/magento/setup/css/app.css'); + ->appendStylesheet('pub/bootstrap/css/bootstrap.min.css') + ->appendStylesheet('pub/bootstrap/css/bootstrap-theme.min.css') + ->appendStylesheet('pub/magento/setup/css/app.css'); ?> headScript() - ->appendFile($this->basePath() . '/pub/angular/angular.min.js') - ->appendFile($this->basePath() . '/pub/angular-ng-storage/angular-ng-storage.min.js') - ->appendFile($this->basePath() . '/pub/angular-ui-router/angular-ui-router.min.js') - ->appendFile($this->basePath() . '/pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js') - ->appendFile($this->basePath() . '/pub/magento/setup/app.js') - ->appendFile($this->basePath() . '/pub/magento/setup/main.js') - ->appendFile($this->basePath() . '/pub/magento/setup/landing.js') - ->appendFile($this->basePath() . '/pub/magento/setup/readiness-check.js') - ->appendFile($this->basePath() . '/pub/magento/setup/add-database.js') - ->appendFile($this->basePath() . '/pub/magento/setup/web-configuration.js') - ->appendFile($this->basePath() . '/pub/magento/setup/customize-your-store.js') - ->appendFile($this->basePath() . '/pub/magento/setup/create-admin-account.js') - ->appendFile($this->basePath() . '/pub/magento/setup/install.js') - ->appendFile($this->basePath() . '/pub/magento/setup/success.js'); + ->appendFile('pub/angular/angular.min.js') + ->appendFile('pub/angular-ng-storage/angular-ng-storage.min.js') + ->appendFile('pub/angular-ui-router/angular-ui-router.min.js') + ->appendFile('pub/angular-ui-bootstrap/angular-ui-bootstrap.min.js') + ->appendFile('pub/magento/setup/app.js') + ->appendFile('pub/magento/setup/main.js') + ->appendFile('pub/magento/setup/landing.js') + ->appendFile('pub/magento/setup/readiness-check.js') + ->appendFile('pub/magento/setup/add-database.js') + ->appendFile('pub/magento/setup/web-configuration.js') + ->appendFile('pub/magento/setup/customize-your-store.js') + ->appendFile('pub/magento/setup/create-admin-account.js') + ->appendFile('pub/magento/setup/install.js') + ->appendFile('pub/magento/setup/success.js'); ?> inlineScript() ?> diff --git a/setup/module/Magento/Setup/view/magento/setup/add-database.phtml b/setup/module/Magento/Setup/view/magento/setup/add-database.phtml index 340ff0684a057..ffd5501057418 100644 --- a/setup/module/Magento/Setup/view/magento/setup/add-database.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/add-database.phtml @@ -5,14 +5,14 @@ ?> -
    +

    Did you want to use an existing or create a new database?

    @@ -126,22 +126,6 @@
    -
    -
    - -
    -
    -
    -  Test connection successful. -
    -
    -  {{testConnection.result.error}} -
    -
    -
    -
    @@ -172,6 +156,17 @@
    +
    +
    +
    +  {{testConnection.result.error}} +
    +
    +  Unknown Database Server Host. +
    +
    +
    +
    @@ -247,5 +242,5 @@ + Next +
    \ No newline at end of file diff --git a/setup/module/Magento/Setup/view/magento/setup/create-admin-account.phtml b/setup/module/Magento/Setup/view/magento/setup/create-admin-account.phtml index 45968763451b6..a7e8eca5c16ed 100644 --- a/setup/module/Magento/Setup/view/magento/setup/create-admin-account.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/create-admin-account.phtml @@ -82,10 +82,12 @@ $passwordWizard = sprintf( type="password" name="adminPassword" ng-model="admin.password" - required /> + required + check-Password />
    + Please enter at least 7 alpha-numeric characters. Please enter your new password.
    diff --git a/setup/module/Magento/Setup/view/magento/setup/index.phtml b/setup/module/Magento/Setup/view/magento/setup/index.phtml index be408ffadbb25..df3c105d16d5f 100644 --- a/setup/module/Magento/Setup/view/magento/setup/index.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/index.phtml @@ -4,7 +4,7 @@ */ ?>
    -
    +
    diff --git a/setup/module/Magento/Setup/view/magento/setup/install.phtml b/setup/module/Magento/Setup/view/magento/setup/install.phtml index a7555e896cce7..4d88f935f4590 100644 --- a/setup/module/Magento/Setup/view/magento/setup/install.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/install.phtml @@ -18,7 +18,7 @@
    -
    {{progressText}}
    +
    {{progressText}}
    Installation is incomplete. Check the console log for errors before trying again. diff --git a/setup/module/Magento/Setup/view/magento/setup/controls/menu.phtml b/setup/module/Magento/Setup/view/magento/setup/navigation/menu.phtml similarity index 100% rename from setup/module/Magento/Setup/view/magento/setup/controls/menu.phtml rename to setup/module/Magento/Setup/view/magento/setup/navigation/menu.phtml diff --git a/setup/module/Magento/Setup/view/magento/setup/readiness-check/progress.phtml b/setup/module/Magento/Setup/view/magento/setup/readiness-check/progress.phtml index 851b26e31de87..7bc7122982dc6 100644 --- a/setup/module/Magento/Setup/view/magento/setup/readiness-check/progress.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/readiness-check/progress.phtml @@ -28,6 +28,12 @@
    +
    +
    +  {{version.data.message}}

    +
    + +

    Need Help?

    PHP Documentation

    @@ -43,10 +49,12 @@

    -

    Donwload and install PHP version {{version.data.required}} from www.php.net using this PHP Documentation.

    +

    Download and install PHP version {{version.data.required}} from www.php.net using this PHP Documentation.

    If you need more help please call your hosting provider.

    +
    +
    @@ -61,7 +69,7 @@ PHP Extensions Check

    - You meet {{extensions.data.current.length}} out of {{extensions.data.required.length}} PHP extensions requirements. + You meet {{extensions.data.required.length}} out of {{extensions.data.required.length}} PHP extensions requirements. More detail Less detail @@ -78,6 +86,12 @@

    +
    +
    +  {{extensions.data.message}}
    +
    +
    +

    Need Help?

    PHP Extension Help

    @@ -86,27 +100,29 @@ PHP Extensions Check

    - {{extensions.data.required.length - extensions.data.current.length}} missing PHP extensions. + {{extensions.data.missing.length}} missing PHP extensions. More detail Less detail

    -

    The best way to resolve this is to install the correct missing extensions. The exact fix depends on our server, your host, and other system variables.
    Our PHP Extension Help can get you started.

    +

    The best way to resolve this is to install the correct missing extensions. The exact fix depends on your server, your host, and other system variables.
    Our PHP Extension Help can get you started.

    If you need more help, please call your hosting provider.

      -
    • - - +
    • + + PHP Extension {{name}}.
    +
    +
    diff --git a/setup/module/Magento/Setup/view/magento/setup/success.phtml b/setup/module/Magento/Setup/view/magento/setup/success.phtml index be8a15e7f9bba..91cb1d5416ede 100644 --- a/setup/module/Magento/Setup/view/magento/setup/success.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/success.phtml @@ -19,13 +19,13 @@
    Password:
    ******
    -
    + -
    -
    {{message}}

    - Launch Magento Admin +
    {{message}}
    +
    diff --git a/setup/module/Magento/Setup/view/magento/setup/web-configuration.phtml b/setup/module/Magento/Setup/view/magento/setup/web-configuration.phtml index 35ac1851da647..40774e9ed7609 100644 --- a/setup/module/Magento/Setup/view/magento/setup/web-configuration.phtml +++ b/setup/module/Magento/Setup/view/magento/setup/web-configuration.phtml @@ -5,15 +5,14 @@ ?> sprintf( - '

    %s

    %s

    %s

    ', + 'base_url' => sprintf( + '

    %s

    %s

    ', 'Enter the base URL that brings shoppers to your store (Ex. http://example.com/).', - 'We recommend not using your actual IP address when your store goes live, otherwise all your shoppers will see it.', - 'Detect IP Address' + 'Leave empty for automatic detection (not recommended for production environment).' ), 'encrypt_key' => sprintf( '

    %s

    ', - 'Key to encrypt sensitive data such as passwords and personally identifiable customer informaton in the Magento database. The encryption key is stored in [your Magento install dir]/app/etc/config.php/' + 'Key to encrypt sensitive data such as passwords and personally identifiable customer informaton in the Magento database. The encryption key is stored in [your Magento install dir]/app/etc/config.php' ), ]; ?> @@ -28,23 +27,25 @@ $hints = [
    -
    - +
    +
    - + />
    -
    +
    - Please enter a valid base URL Admin URL path. (ex: http://www.example.com/) + Please enter a valid Base URL (ex: http://www.example.com/)
    @@ -52,7 +53,7 @@ $hints = [
    - {{config.address.web}} + {{config.address.actual_base_url}}
    - Please enter a valid admin URL path. + Please enter a valid Admin URL Path.
    @@ -77,17 +78,35 @@ $hints = [
    +
    + +
    + +
    +
    +
    + Please enter a valid HTTPS base URL path. (ex: https://www.example.com/) +
    +
    +
    +
    diff --git a/setup/pub/magento/setup/add-database.js b/setup/pub/magento/setup/add-database.js index 75117bb351a87..169fc74caffc8 100644 --- a/setup/pub/magento/setup/add-database.js +++ b/setup/pub/magento/setup/add-database.js @@ -4,28 +4,28 @@ 'use strict'; angular.module('add-database', ['ngStorage']) - .controller('addDatabaseController', ['$scope', '$state', '$localStorage', '$http', '$timeout', function ($scope, $state, $localStorage, $http, $timeout) { + .controller('addDatabaseController', ['$scope', '$state', '$localStorage', '$http', function ($scope, $state, $localStorage, $http) { $scope.db = { useExistingDb: 1, - useAccess: 1 + useAccess: 1, + host: 'localhost', + user: 'root', + name: 'magento' }; if ($localStorage.db) { $scope.db = $localStorage.db; } - $scope.testConnection = function () { - $http.post('data/database', $scope.db) - .success(function (data) { - $scope.testConnection.result = data; - }) - .then(function () { - $scope.testConnection.pressed = true; - $timeout(function () { - $scope.testConnection.pressed = false; - }, 2500); - }); - }; + $scope.testConnection = function () { + $http.post('index.php/database-check', $scope.db) + .success(function (data) { + $scope.testConnection.result = data; + if (!(($scope.testConnection.result !== undefined) && (!$scope.testConnection.result.success))) { + $scope.nextState(); + } + }); + }; $scope.$on('nextState', function () { $localStorage.db = $scope.db; diff --git a/setup/pub/magento/setup/create-admin-account.js b/setup/pub/magento/setup/create-admin-account.js index e793e8fd821ce..4617a6892f141 100644 --- a/setup/pub/magento/setup/create-admin-account.js +++ b/setup/pub/magento/setup/create-admin-account.js @@ -65,6 +65,20 @@ angular.module('create-admin-account', ['ngStorage']) } }); }]) + .directive('checkPassword', function() { + return{ + require: "ngModel", + link: function(scope, elm, attrs, ctrl){ + var validator = function(value){ + var isValid = (value.length > 6) && (value.match(/[\d]+/) && value.match(/[a-zA-Z]+/)); + ctrl.$setValidity('checkPassword', isValid); + return value; + }; + ctrl.$parsers.unshift(validator); + ctrl.$formatters.unshift(validator); + } + }; + }) .directive('confirmPassword', function() { return { require: 'ngModel', diff --git a/setup/pub/magento/setup/install.js b/setup/pub/magento/setup/install.js index d47aed2fd343b..50cbf570d962b 100644 --- a/setup/pub/magento/setup/install.js +++ b/setup/pub/magento/setup/install.js @@ -13,6 +13,10 @@ angular.module('install', ['ngStorage']) $scope.isConsole = $scope.isConsole === false; }; + $scope.barStyle = function (value) { + return { width: value + '%' }; + }; + $scope.checkProgress = function () { if ($scope.isInProgress) { $scope.displayProgress(); @@ -75,10 +79,10 @@ angular.module('install', ['ngStorage']) .service('progress', ['$http', function ($http) { return { get: function (callback) { - $http.get('install/progress').then(callback); + $http.post('index.php/install/progress').then(callback); }, post: function (data, callback) { - $http.post('install/start', data).success(callback); + $http.post('index.php/install/start', data).success(callback); } }; }]); diff --git a/setup/pub/magento/setup/landing.js b/setup/pub/magento/setup/landing.js index 7ccf3110404ef..60d9a3b8076cc 100644 --- a/setup/pub/magento/setup/landing.js +++ b/setup/pub/magento/setup/landing.js @@ -11,7 +11,7 @@ angular.module('landing', ['ngStorage']) function ($scope, $location, $localStorage) { $scope.selectLanguage = function () { $localStorage.lang = $scope.modelLanguage; - window.location = '/setup/' + $scope.modelLanguage + '/index'; + window.location = 'index.php/' + $scope.modelLanguage + '/index'; }; } ]); diff --git a/setup/pub/magento/setup/main.js b/setup/pub/magento/setup/main.js index 20dfdd1686700..1e6979b38f682 100644 --- a/setup/pub/magento/setup/main.js +++ b/setup/pub/magento/setup/main.js @@ -3,8 +3,9 @@ */ 'use strict'; -var main = angular.module('main', []); -main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navigationService', function ($scope, $state, $rootScope, navigationService) { +var main = angular.module('main', ['ngStorage']); +main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navigationService', '$localStorage', function ($scope, $state, $rootScope, navigationService, $localStorage) { + $localStorage.$reset(); navigationService.load(); $rootScope.isMenuEnabled = true; $scope.itemStatus = function (order) { @@ -15,6 +16,7 @@ main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navi '$scope', '$state', 'navigationService', function ($scope, $state, navigationService) { $scope.$on('$stateChangeSuccess', function (event, state) { + $scope.valid = true; $scope.class = 'col-lg-9'; if (state.main) { $scope.class = 'col-lg-offset-3 col-lg-6'; @@ -29,7 +31,8 @@ main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navi }; $scope.previousState = function () { - $state.go(navigationService.getPreviousState().id); + $scope.valid = true; + $state.go(navigationService.getPreviousState().id); }; // Flag indicating the validity of the form @@ -56,7 +59,7 @@ main.controller('navigationController', ['$scope', '$state', '$rootScope', 'navi states: [], load: function () { var self = this; - $http.get('data/states').success(function (data) { + $http.get('index.php/navigation').success(function (data) { var currentState = $location.path().replace('/', ''); var isCurrentStateFound = false; self.states = data.nav; diff --git a/setup/pub/magento/setup/readiness-check.js b/setup/pub/magento/setup/readiness-check.js index d9f1202f0c9fe..b816cb1e8e7c6 100644 --- a/setup/pub/magento/setup/readiness-check.js +++ b/setup/pub/magento/setup/readiness-check.js @@ -44,7 +44,7 @@ angular.module('readiness-check', []) $scope.items = { 'php-version': { - url:'data/php-version', + url:'index.php/environment/php-version', show: function() { $scope.startProgress(); $scope.version.visible = true; @@ -57,7 +57,7 @@ angular.module('readiness-check', []) } }, 'php-extensions': { - url:'data/php-extensions', + url:'index.php/environment/php-extensions', show: function() { $scope.startProgress(); $scope.extensions.visible = true; @@ -70,7 +70,7 @@ angular.module('readiness-check', []) } }, 'file-permissions': { - url:'data/file-permissions', + url:'index.php/environment/file-permissions', show: function() { $scope.startProgress(); $scope.permissions.visible = true; diff --git a/setup/pub/magento/setup/success.js b/setup/pub/magento/setup/success.js index 84566effa89e1..d46cf3e0199f0 100644 --- a/setup/pub/magento/setup/success.js +++ b/setup/pub/magento/setup/success.js @@ -9,4 +9,5 @@ angular.module('success', ['ngStorage']) $scope.admin = $localStorage.admin; $scope.config = $localStorage.config; $scope.messages = $localStorage.messages; - }]); \ No newline at end of file + $localStorage.$reset(); + }]); diff --git a/setup/pub/magento/setup/web-configuration.js b/setup/pub/magento/setup/web-configuration.js index 7ee587fe9230b..b7d45d65a0e2d 100644 --- a/setup/pub/magento/setup/web-configuration.js +++ b/setup/pub/magento/setup/web-configuration.js @@ -7,12 +7,15 @@ angular.module('web-configuration', ['ngStorage']) .controller('webConfigurationController', ['$scope', '$state', '$localStorage', function ($scope, $state, $localStorage) { $scope.config = { address: { - web: 'http://www.example.com/', + base_url: '', + auto_base_url: '', + actual_base_url: '', admin: 'admin' }, https: { - front: true, - admin: true + front: false, + admin: false, + text: '' }, rewrites: { allowed: true @@ -38,6 +41,14 @@ angular.module('web-configuration', ['ngStorage']) obj.expanded = !obj.expanded; } + $scope.$watch('config.address.base_url', function() { + if (angular.equals($scope.config.address.base_url, '')) { + $scope.config.address.actual_base_url = $scope.config.address.auto_base_url; + } else { + $scope.config.address.actual_base_url = $scope.config.address.base_url; + } + }); + $scope.$watch('config.encrypt.type', function() { if(angular.equals($scope.config.encrypt.type, 'magento')){ $scope.config.encrypt.key = null; @@ -48,6 +59,29 @@ angular.module('web-configuration', ['ngStorage']) return angular.equals($scope.config.encrypt.type, 'user'); } + $scope.showHttpsField = function() { + return ($scope.config.https.front || $scope.config.https.admin); + } + + $scope.addSlash = function() { + if (angular.isUndefined($scope.config.address.base_url)) { + return; + } + + var p = $scope.config.address.base_url; + if (p.length > 1) { + var lastChar = p.substr(-1); + if (lastChar != '/') { + $scope.config.address.base_url = p + '/'; + } + } + }; + + $scope.populateHttps = function() { + $scope.config.https.text = $scope.config.address.base_url.replace('http', 'https'); + }; + + // Listens on form validate event, dispatched by parent controller $scope.$on('validate-' + $state.current.id, function() { $scope.validate(); @@ -69,4 +103,4 @@ angular.module('web-configuration', ['ngStorage']) $scope.webconfig.submitted = false; } }); - }]); \ No newline at end of file + }]);