Skip to content

Commit 0495ce8

Browse files
Alexandr SkrashukAlexandr Skrashuk
authored andcommitted
MAGNSWTCH-132: Revert unit test changes
1 parent d8e7cac commit 0495ce8

File tree

1 file changed

+2
-37
lines changed

1 file changed

+2
-37
lines changed

app/code/Magento/ConfigurableProduct/Test/Unit/Model/SuggestedAttributeListTest.php

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ class SuggestedAttributeListTest extends \PHPUnit_Framework_TestCase
2020
*/
2121
protected $attributeFactoryMock;
2222

23-
/**
24-
* @var \PHPUnit_Framework_MockObject_MockObject
25-
*/
26-
protected $eventManagerMock;
27-
28-
/**
29-
* @var \PHPUnit_Framework_MockObject_MockObject
30-
*/
31-
protected $objectFactoryMock;
32-
3323
/**
3424
* @var \PHPUnit_Framework_MockObject_MockObject
3525
*/
@@ -63,20 +53,6 @@ protected function setUp()
6353
'',
6454
false
6555
);
66-
$this->eventManagerMock = $this->getMock(
67-
'\Magento\Framework\Event\ManagerInterface',
68-
[],
69-
[],
70-
'',
71-
false
72-
);
73-
$this->objectFactoryMock = $this->getMock(
74-
'\Magento\Framework\ObjectFactory',
75-
['create'],
76-
[],
77-
'',
78-
false
79-
);
8056
$this->collectionMock = $this->getMock(
8157
'Magento\Catalog\Model\Resource\Product\Attribute\Collection',
8258
[],
@@ -102,7 +78,7 @@ protected function setUp()
10278
$this->returnValue($this->collectionMock)
10379
);
10480
$valueMap = [
105-
['main_table.frontend_input', ['in' => 123 ], $this->collectionMock],
81+
['frontend_input', 'select', $this->collectionMock],
10682
['frontend_label', ['like' => $this->labelPart], $this->collectionMock],
10783
['is_user_defined', 1, $this->collectionMock],
10884
['is_global', \Magento\Catalog\Model\Resource\Eav\Attribute::SCOPE_GLOBAL, $this->collectionMock],
@@ -131,19 +107,12 @@ protected function setUp()
131107
);
132108
$this->suggestedListModel = new \Magento\ConfigurableProduct\Model\SuggestedAttributeList(
133109
$this->attributeFactoryMock,
134-
$this->resourceHelperMock,
135-
$this->eventManagerMock,
136-
$this->objectFactoryMock
110+
$this->resourceHelperMock
137111
);
138112
}
139113

140114
public function testGetSuggestedAttributesIfTheyApplicable()
141115
{
142-
$object = $this->getMock('\Magento\Framework\Object', [], [], '', false);
143-
$object->expects($this->once())->method('setData');
144-
$object->expects($this->once())->method('getData')->willReturn(123);
145-
$this->objectFactoryMock->expects($this->once())->method('create')->willReturn($object);
146-
147116
$source = $this->getMock(
148117
'Magento\Eav\Model\Entity\Attribute\Source\AbstractSource',
149118
[],
@@ -163,10 +132,6 @@ public function testGetSuggestedAttributesIfTheyApplicable()
163132

164133
public function testGetSuggestedAttributesIfTheyNotApplicable()
165134
{
166-
$object = $this->getMock('\Magento\Framework\Object', [], [], '', false);
167-
$object->expects($this->once())->method('setData');
168-
$object->expects($this->once())->method('getData')->willReturn(123);
169-
$this->objectFactoryMock->expects($this->once())->method('create')->willReturn($object);
170135
$this->attributeMock->expects($this->any())->method('getApplyTo')->will($this->returnValue(['simple']));
171136
$this->attributeMock->expects($this->never())->method('getId');
172137
$this->attributeMock->expects($this->never())->method('getFrontendLabel');

0 commit comments

Comments
 (0)