Skip to content

Commit bd12651

Browse files
committed
#12695: Unable to change attribute type from swatch to dropdown
- fixes regarding comments @sidolov
1 parent 54ad76c commit bd12651

File tree

3 files changed

+0
-21
lines changed

3 files changed

+0
-21
lines changed

app/code/Magento/Swatches/Model/SwatchAttributesProvider.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
*/
1919
class SwatchAttributesProvider
2020
{
21-
/**
22-
* @var \Magento\Swatches\Helper\Data
23-
*/
24-
protected $swatchesHelper;
2521
/**
2622
* @var Configurable
2723
*/
@@ -48,18 +44,15 @@ class SwatchAttributesProvider
4844
*
4945
* @param Configurable $typeConfigurable
5046
* @param SwatchAttributeCodes $swatchAttributeCodes
51-
* @param SwatchesHelper|null $swatchHelper
5247
* @param SwatchAttributeType|null $swatchTypeChecker
5348
*/
5449
public function __construct(
5550
Configurable $typeConfigurable,
5651
SwatchAttributeCodes $swatchAttributeCodes,
57-
SwatchesHelper $swatchHelper = null,
5852
SwatchAttributeType $swatchTypeChecker = null
5953
) {
6054
$this->typeConfigurable = $typeConfigurable;
6155
$this->swatchAttributeCodes = $swatchAttributeCodes;
62-
$this->swatchesHelper = $swatchHelper ?: ObjectManager::getInstance()->create(SwatchesHelper::class);
6356
$this->swatchTypeChecker = $swatchTypeChecker
6457
?: ObjectManager::getInstance()->create(SwatchAttributeType::class);
6558
}

app/code/Magento/Swatches/Test/Unit/Model/SwatchAttributesProviderTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ class SwatchAttributesProviderTest extends \PHPUnit\Framework\TestCase
3030
*/
3131
private $swatchAttributeCodes;
3232

33-
/**
34-
* @var \Magento\Swatches\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
35-
*/
36-
private $swatchHelper;
37-
3833
/**
3934
* @var \Magento\Catalog\Model\Product|\PHPUnit_Framework_MockObject_MockObject
4035
*/
@@ -56,10 +51,6 @@ protected function setUp()
5651

5752
$this->productMock = $this->createPartialMock(\Magento\Catalog\Model\Product::class, ['getId', 'getTypeId']);
5853
$this->swatchTypeChecker = $this->createMock(SwatchAttributeType::class);
59-
$this->swatchHelper = $this->createPartialMock(
60-
\Magento\Swatches\Helper\Data::class,
61-
['isSwatchAttribute']
62-
);
6354

6455
$this->swatchAttributeProvider = (new ObjectManager($this))->getObject(SwatchAttributesProvider::class, [
6556
'typeConfigurable' => $this->typeConfigurable,

app/code/Magento/Swatches/etc/di.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,4 @@
8181
</argument>
8282
</arguments>
8383
</type>
84-
<type name="\Magento\Swatches\Model\SwatchAttributesProvider">
85-
<arguments>
86-
<argument name="swatchHelper" xsi:type="object">\Magento\Swatches\Helper\Data\Proxy</argument>
87-
</arguments>
88-
</type>
8984
</config>

0 commit comments

Comments
 (0)