diff --git a/app/code/Magento/Backend/Block/Widget.php b/app/code/Magento/Backend/Block/Widget.php index d02951754950b66e91ddfb9dbc49d2adb62b2c20..4338074e29bcc23f9bb80e63280c4acd4a2eb280 100644 --- a/app/code/Magento/Backend/Block/Widget.php +++ b/app/code/Magento/Backend/Block/Widget.php @@ -89,18 +89,4 @@ class Widget extends \Magento\Backend\Block\Template $dataAttr )->toHtml(); } - - /** - * @return string - */ - public function getGlobalIcon() - { - return '<img src="' . $this->getViewFileUrl( - 'images/fam_link.gif' - ) . '" alt="' . __( - 'Global Attribute' - ) . '" title="' . __( - 'This attribute shares the same value in all stores.' - ) . '" class="attribute-global"/>'; - } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php index 8e52036ae573530e891fbb3b533acad708199fb5..1f146dcbe254a06306735c9de32295df12d945d6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php @@ -23,21 +23,29 @@ class Front extends Generic */ protected $_yesNo; + /** + * @var array + */ + private $disableSearchable; + /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Framework\Registry $registry * @param \Magento\Framework\Data\FormFactory $formFactory * @param Yesno $yesNo * @param array $data + * @param array $disableSearchable */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Data\FormFactory $formFactory, Yesno $yesNo, - array $data = [] + array $data = [], + array $disableSearchable = [] ) { $this->_yesNo = $yesNo; + $this->disableSearchable = $disableSearchable; parent::__construct($context, $registry, $formFactory, $data); } @@ -63,6 +71,7 @@ class Front extends Generic ['legend' => __('Frontend Properties'), 'collapsable' => $this->getRequest()->has('popup')] ); + $attrCode = $attributeObject->getAttributeCode(); $fieldset->addField( 'is_searchable', 'select', @@ -71,6 +80,7 @@ class Front extends Generic 'label' => __('Use in Search'), 'title' => __('Use in Search'), 'values' => $yesnoSource, + 'disabled' => isset($this->disableSearchable[$attrCode]) && $this->disableSearchable[$attrCode] ? 1 : 0 ] ); diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index daa9579d99d618e8eb4d1f69dfbdde4a79fa4f77..8a68e868cdf78131d4dcc12b7f1047716487611a 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -350,6 +350,18 @@ class View extends AbstractProduct implements \Magento\Framework\View\Block\Iden return !$this->productTypeConfig->isProductSet($this->getProduct()->getTypeId()); } + /** + * Get Validation Rules for Quantity field + * + * @return array + */ + public function getQuantityValidators() + { + $validators = []; + $validators['required-number'] = true; + return $validators; + } + /** * Return identifiers for produced content * diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index 29aadc03ae11e350fe12622960762db3ecbf2019..31e2f1092287e05712d359f7722510db0950a949 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -66,4 +66,18 @@ <type name="Magento\Catalog\Model\Resource\Attribute"> <plugin name="invalidate_pagecache_after_attribute_save" type="Magento\Catalog\Plugin\Model\Resource\Attribute\Save" /> </type> + <type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front"> + <arguments> + <argument name="disableSearchable" xsi:type="array"> + <item name="visibility" xsi:type="boolean">true</item> + <item name="url_key" xsi:type="boolean">true</item> + <item name="status" xsi:type="boolean">true</item> + <item name="group_price" xsi:type="boolean">true</item> + <item name="price_type" xsi:type="boolean">true</item> + <item name="category_ids" xsi:type="boolean">true</item> + <item name="media_gallery" xsi:type="boolean">true</item> + <item name="country_of_manufacture" xsi:type="boolean">true</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml index de5d0cdd21bef8172438b4a4a8f2d66eaf5fe8a9..90c65334610425ca695bc958dfe71ed15e0766e5 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml @@ -23,11 +23,8 @@ maxlength="12" value="<?php echo $block->getProductDefaultQty() * 1 ?>" title="<?php echo __('Qty') ?>" class="input-text qty" - <?php if ($_product->getStockItem() && $_product->getStockItem()->getIsQtyDecimal()) : ?> - data-validate="{'required-number':true, 'validate-greater-than-zero':true}" - <?php else: ?> - data-validate="{'required-number':true, digits:true}" - <?php endif; ?> /> + data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>" + /> </div> </div> <?php endif; ?> diff --git a/app/code/Magento/CatalogInventory/Block/Plugin/ProductView.php b/app/code/Magento/CatalogInventory/Block/Plugin/ProductView.php new file mode 100644 index 0000000000000000000000000000000000000000..d3380668b253d9370edb295516e8cdd70170e29a --- /dev/null +++ b/app/code/Magento/CatalogInventory/Block/Plugin/ProductView.php @@ -0,0 +1,52 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\CatalogInventory\Block\Plugin; + +use Magento\CatalogInventory\Api\StockRegistryInterface; + +class ProductView +{ + /** + * @var StockRegistryInterface + */ + private $stockRegistry; + + /** + * @param StockRegistryInterface $stockRegistry + */ + public function __construct( + StockRegistryInterface $stockRegistry + ) { + $this->stockRegistry = $stockRegistry; + } + + /** + * @param \Magento\Catalog\Block\Product\View $block + * @param array $validators + * @return array + */ + public function afterGetQuantityValidators( + \Magento\Catalog\Block\Product\View $block, + array $validators + ) { + $stockItem = $this->stockRegistry->getStockItem( + $block->getProduct()->getId(), + $block->getProduct()->getStore()->getWebsiteId() + ); + + $params = []; + $params['minAllowed'] = max((float)$stockItem->getQtyMinAllowed(), 1); + if ($stockItem->getQtyMaxAllowed()) { + $params['maxAllowed'] = $stockItem->getQtyMaxAllowed(); + } + if ($stockItem->getQtyIncrements() > 0) { + $params['qtyIncrements'] = (float)$stockItem->getQtyIncrements(); + } + $validators['validate-item-quantity'] = $params; + + return $validators; + } +} diff --git a/app/code/Magento/CatalogInventory/etc/di.xml b/app/code/Magento/CatalogInventory/etc/di.xml index 2535e60098d0a624d5af056f74e16468a0bfc6fc..11c98534f732718a84bb3cde28379c3f76137b61 100644 --- a/app/code/Magento/CatalogInventory/etc/di.xml +++ b/app/code/Magento/CatalogInventory/etc/di.xml @@ -49,4 +49,7 @@ <type name="Magento\Store\Model\Resource\Group"> <plugin name="storeGroupResourceAroundBeforeSave" type="\Magento\CatalogInventory\Model\Indexer\Stock\Plugin\StoreGroup"/> </type> + <type name="Magento\Catalog\Block\Product\View"> + <plugin name="quantityValidators" type="Magento\CatalogInventory\Block\Plugin\ProductView" /> + </type> </config> diff --git a/app/code/Magento/CatalogSearch/Block/Plugin/FrontTabPlugin.php b/app/code/Magento/CatalogSearch/Block/Plugin/FrontTabPlugin.php new file mode 100644 index 0000000000000000000000000000000000000000..6eac91c50564034ac16072ab26dc82ac211f065e --- /dev/null +++ b/app/code/Magento/CatalogSearch/Block/Plugin/FrontTabPlugin.php @@ -0,0 +1,63 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\CatalogSearch\Block\Plugin; + +use Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front; +use Magento\CatalogSearch\Model\Source\Weight; +use Magento\Framework\Data\Form; +use Magento\Framework\Data\Form\Element\Fieldset; + +class FrontTabPlugin +{ + /** + * @var Weight + */ + private $weightSource; + + /** + * @param Weight $weightSource + */ + public function __construct(Weight $weightSource) + { + $this->weightSource = $weightSource; + } + + /** + * @param Front $subject + * @param callable $proceed + * @param Form $form + * @return Front + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundSetForm(Front $subject, \Closure $proceed, Form $form) + { + $block = $proceed($form); + /** @var Fieldset $fieldset */ + $fieldset = $form->getElement('front_fieldset'); + $fieldset->addField( + 'search_weight', + 'select', + [ + 'name' => 'search_weight', + 'label' => __('Search Weight'), + 'values' => $this->weightSource->getOptions() + ], + 'is_searchable' + ); + + $subject->getChildBlock('form_after') + ->addFieldMap( + 'search_weight', + 'search_weight' + ) + ->addFieldDependence( + 'search_weight', + 'searchable', + '1' + ); + return $block; + } +} diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php index baab677a9c32238766bc1ecf5135c0d5b537584c..618e9222ef1950432eb749b4a36589076798aded 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Engine.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Engine.php @@ -224,16 +224,6 @@ class Engine extends AbstractDb implements EngineInterface return $this->_catalogSearchData->prepareIndexdata($index, $separator); } - /** - * Define if Layered Navigation is allowed - * - * @return bool - */ - public function isLayeredNavigationAllowed() - { - return true; - } - /** * Define if engine is available * diff --git a/app/code/Magento/CatalogSearch/Model/Resource/EngineInterface.php b/app/code/Magento/CatalogSearch/Model/Resource/EngineInterface.php index 2948448cdb7b7a4675a9ea530d4c5f92f70007d6..931eb12252d60b6d6a0e51315888019d6a117f37 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/EngineInterface.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/EngineInterface.php @@ -74,13 +74,6 @@ interface EngineInterface */ public function prepareEntityIndex($index, $separator = ' '); - /** - * Define if Layered Navigation is allowed - * - * @return bool - */ - public function isLayeredNavigationAllowed(); - /** * Define if engine is available * diff --git a/app/code/Magento/CatalogSearch/Model/Source/Weight.php b/app/code/Magento/CatalogSearch/Model/Source/Weight.php new file mode 100644 index 0000000000000000000000000000000000000000..0525c11be74ccd9f3894cd1e5f085dde2fa92f70 --- /dev/null +++ b/app/code/Magento/CatalogSearch/Model/Source/Weight.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\CatalogSearch\Model\Source; + +/** + * Attribute weight options + */ +class Weight +{ + /** + * Quick search weights + * + * @var int[] + */ + protected $_weights = [1, 2, 3, 4, 5]; + + /** + * Retrieve search weights as options array + * + * @return array + */ + public function getOptions() + { + $res = []; + foreach ($this->getValues() as $value) { + $res[] = ['value' => $value, 'label' => $value]; + } + return $res; + } + + /** + * Retrieve search weights array + * + * @return int[] + */ + public function getValues() + { + return $this->_weights; + } +} diff --git a/app/code/Magento/CatalogSearch/Setup/InstallSchema.php b/app/code/Magento/CatalogSearch/Setup/InstallSchema.php index 63ccb802431cd6d505be349c4c44c3ac20fa4a8e..0b43797a27096c26c9fa92824a6ac30fce9a26a5 100644 --- a/app/code/Magento/CatalogSearch/Setup/InstallSchema.php +++ b/app/code/Magento/CatalogSearch/Setup/InstallSchema.php @@ -83,6 +83,18 @@ class InstallSchema implements InstallSchemaInterface $installer->getConnection()->createTable($table); + $installer->getConnection()->addColumn( + $installer->getTable('catalog_eav_attribute'), + 'search_weight', + [ + 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_FLOAT, + 'unsigned' => true, + 'nullable' => false, + 'default' => '3', + 'comment' => 'Search Weight' + ] + ); + $installer->endSetup(); } diff --git a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml index 87803d3016d1358e8c8fdd429573aa3047767b01..18cde6cdc8aa7e4ea9eb8e918e7bf11f50cf7e1b 100644 --- a/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml +++ b/app/code/Magento/CatalogSearch/etc/adminhtml/di.xml @@ -16,4 +16,7 @@ <argument name="storage" xsi:type="object">Magento\CatalogSearch\Model\Session\Storage</argument> </arguments> </virtualType> + <type name="\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front"> + <plugin name="search_weigh" type="\Magento\CatalogSearch\Block\Plugin\FrontTabPlugin" /> + </type> </config> diff --git a/app/code/Magento/CatalogSearch/etc/search_request.xml b/app/code/Magento/CatalogSearch/etc/search_request.xml index 5c224284a050fb9960992fb1a47689fe1fc6154b..ec3bcda4df72f54fce489558147198ac718a4c89 100644 --- a/app/code/Magento/CatalogSearch/etc/search_request.xml +++ b/app/code/Magento/CatalogSearch/etc/search_request.xml @@ -20,6 +20,7 @@ </query> <query xsi:type="matchQuery" value="$search_term$" name="search"> <match field="sku" boost="1"/> + <match field="*" boost="1"/> </query> <query xsi:type="filteredQuery" name="category"> <filterReference clause="must" ref="category_filter"/> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml index 85473712aafa7459a69b21e0af57da835596e6e0..804195c9776f90aa69a130f4afe49ca74b4f9304 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/catalog/product/edit/super/config.phtml @@ -68,14 +68,12 @@ require([ isLocked = function (element) { return element.is('[data-locked]'); }, - disableElement = function (element) { + setElementDisabled = function (element, state, triggerEvent) { if (!isLocked(element)) { - element.prop('disabled', true).trigger('change'); - } - }, - enableElement = function (element) { - if (!isLocked(element)) { - element.removeProp('disabled').trigger('change'); + element.prop('disabled', state); + if (triggerEvent) { + element.trigger('change') + } } }; @@ -89,8 +87,8 @@ require([ inventoryQty.prop('disabled', true); inventoryAvailabilityField.removeProp('disabled'); - disableElement(qtyField); - enableElement(stockAvailabilityField); + setElementDisabled(qtyField, true, true); + setElementDisabled(stockAvailabilityField, false, false); $.each($.mage.variationsAttributes($('#configurable-attributes-container')).getAttributes(), function() { $('#attribute-' + this.code + '-container select').prop('disabled', true); }) @@ -104,8 +102,8 @@ require([ .removeProp('disabled'); inventoryQty.removeProp('disabled'); inventoryAvailabilityField.prop('disabled', true); - disableElement(stockAvailabilityField); - enableElement(qtyField); + setElementDisabled(stockAvailabilityField, true, false); + setElementDisabled(qtyField, false, true); }) .collapse(hasVariations ? 'show' : 'hide'); diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/stock/disabler.phtml b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/stock/disabler.phtml index 4e46788c56a28d6d5c5489bd9d601c1a3ea9a2cd..266b3b34cdf35c71f64340cac96f834ad69d38b0 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/stock/disabler.phtml +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/templates/product/configurable/stock/disabler.phtml @@ -8,7 +8,7 @@ require(['jquery'], function($){ $('[data-tab-panel=product-details]').on('stockbeforedisable', function(e) { var variations = $('[data-panel=product-variations]'); - if (variations.is(':visible') && variations.is('.opened')) { + if (e.productType === 'configurable' || (variations.is(':visible') && variations.is('.opened'))) { e.stopPropagation(); return false; } diff --git a/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php b/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php index bcc7135a494de4ea97dbeb2374f2a71b50ce539a..c9802f4c11fd0e0e79b4fddeea61c20339b8b7da 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/DocBlock.php @@ -53,6 +53,7 @@ class DocBlock new \Magento\TestFramework\Isolation\WorkingDirectory(), new \Magento\TestFramework\Isolation\DeploymentConfig(), new \Magento\TestFramework\Annotation\AppIsolation($application), + new \Magento\TestFramework\Annotation\ConfigFixture(), new \Magento\TestFramework\Event\Transaction( new \Magento\TestFramework\EventManager( [ @@ -63,7 +64,6 @@ class DocBlock ), 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/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/FrontTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/FrontTest.php new file mode 100644 index 0000000000000000000000000000000000000000..631738f29155bebe42fc468d0878f1ff5f02ee61 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/FrontTest.php @@ -0,0 +1,66 @@ +<?php +/** + * Copyright © 2015 Magento. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab; + +/** + * @magentoAppArea adminhtml + */ +class FrontTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front + */ + private $block; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + protected function setUp() + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var $layout \Magento\Framework\View\Layout */ + $layout = $this->objectManager->create('Magento\Framework\View\LayoutInterface'); + $this->block = $layout->createBlock('Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front'); + } + + /** + * @param $attributeCode + * @dataProvider toHtmlDataProvider + */ + public function testToHtml($attributeCode) + { + /** @var \Magento\Catalog\Model\Resource\Eav\Attribute $model */ + $model = $this->objectManager->create('Magento\Catalog\Model\Resource\Eav\Attribute'); + $model->load($attributeCode, 'attribute_code'); + + /** @var \Magento\Framework\Registry $coreRegistry */ + $coreRegistry = $this->objectManager->get('\Magento\Framework\Registry'); + $coreRegistry->unregister('entity_attribute'); + $coreRegistry->register('entity_attribute', $model); + + $this->assertRegExp('/<select\sid="is_searchable".*disabled="disabled"/', $this->block->toHtml()); + } + + /** + * @return array + */ + public function toHtmlDataProvider() + { + return [ + ['visibility'], + ['url_key'], + ['status'], + ['group_price'], + ['price_type'], + ['category_ids'], + ['media_gallery'], + ['country_of_manufacture'], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php index db2dfa1db105371cbee5b6aee34f74dd92137e7d..b02773ae51c9e7eeb348ce8e71ee2c137729d065 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php @@ -5,11 +5,12 @@ */ namespace Magento\Newsletter\Model; +use Magento\Store\Model\ScopeInterface; + class QueueTest extends \PHPUnit_Framework_TestCase { /** * @magentoDataFixture Magento/Newsletter/_files/queue.php - * @magentoConfigFixture fixturestore_store general/locale/code de_DE * @magentoAppIsolation enabled */ public function testSendPerSubscriber() @@ -17,6 +18,10 @@ class QueueTest extends \PHPUnit_Framework_TestCase /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig */ + $mutableConfig = $objectManager->get('Magento\Framework\App\Config\MutableScopeConfigInterface'); + $mutableConfig->setValue('general/locale/code', 'de_DE', ScopeInterface::SCOPE_STORE, 'fixturestore'); + $objectManager->get('Magento\Framework\App\State')->setAreaCode(\Magento\Framework\App\Area::AREA_FRONTEND); $area = $objectManager->get('Magento\Framework\App\AreaList') ->getArea(\Magento\Framework\App\Area::AREA_FRONTEND); diff --git a/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php index 4eec44f4a23449fd83b217e2dcd5f3b8470895de..bc9a6bb4109b606dd693a35236e0ef635fcd0322 100644 --- a/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/View/DesignTest.php @@ -7,6 +7,7 @@ namespace Magento\Theme\Model\View; use Magento\Framework\App\Bootstrap; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Store\Model\ScopeInterface; /** * @magentoDataFixture Magento/Theme/Model/_files/design/themes.php @@ -125,14 +126,19 @@ class DesignTest extends \PHPUnit_Framework_TestCase /** * @magentoConfigFixture current_store design/theme/theme_id one - * @magentoConfigFixture fixturestore_store design/theme/theme_id two * @magentoDataFixture Magento/Store/_files/core_fixturestore.php */ public function testGetConfigurationDesignThemeStore() { - $storeId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Store\Model\StoreManagerInterface' - )->getStore()->getId(); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableConfig */ + $mutableConfig = $objectManager->get('Magento\Framework\App\Config\MutableScopeConfigInterface'); + $mutableConfig->setValue('design/theme/theme_id', 'two', ScopeInterface::SCOPE_STORE, 'fixturestore'); + + $storeId = $objectManager->get('Magento\Store\Model\StoreManagerInterface') + ->getStore() + ->getId(); $this->assertEquals('one', $this->_model->getConfigurationDesignTheme()); $this->assertEquals('one', $this->_model->getConfigurationDesignTheme(null, ['store' => $storeId])); $this->assertEquals('one', $this->_model->getConfigurationDesignTheme('frontend', ['store' => $storeId])); 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 e87c6a8441447b1c605e33196aae16c8a1d26b29..6b515c3cd676dc9f1510d947e0e5c96143d0ba9e 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 @@ -2105,6 +2105,7 @@ return [ 'Magento\Integration\Helper\Validator', 'Magento\Integration\Model\CredentialsValidator::validate' ], + ['getGlobalIcon', '\Magento\Backend\Block\Widget'], ['getSuccessRedirect', 'Magento\Customer\Controller\Account\CreatePost'], [ 'loginPostRedirect',