@@ -20,16 +20,6 @@ class SuggestedAttributeListTest extends \PHPUnit_Framework_TestCase
20
20
*/
21
21
protected $ attributeFactoryMock ;
22
22
23
- /**
24
- * @var \PHPUnit_Framework_MockObject_MockObject
25
- */
26
- protected $ eventManagerMock ;
27
-
28
- /**
29
- * @var \PHPUnit_Framework_MockObject_MockObject
30
- */
31
- protected $ objectFactoryMock ;
32
-
33
23
/**
34
24
* @var \PHPUnit_Framework_MockObject_MockObject
35
25
*/
@@ -63,20 +53,6 @@ protected function setUp()
63
53
'' ,
64
54
false
65
55
);
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
- );
80
56
$ this ->collectionMock = $ this ->getMock (
81
57
'Magento\Catalog\Model\Resource\Product\Attribute\Collection ' ,
82
58
[],
@@ -102,7 +78,7 @@ protected function setUp()
102
78
$ this ->returnValue ($ this ->collectionMock )
103
79
);
104
80
$ valueMap = [
105
- ['main_table. frontend_input ' , [ ' in ' => 123 ] , $ this ->collectionMock ],
81
+ ['frontend_input ' , ' select ' , $ this ->collectionMock ],
106
82
['frontend_label ' , ['like ' => $ this ->labelPart ], $ this ->collectionMock ],
107
83
['is_user_defined ' , 1 , $ this ->collectionMock ],
108
84
['is_global ' , \Magento \Catalog \Model \Resource \Eav \Attribute::SCOPE_GLOBAL , $ this ->collectionMock ],
@@ -131,19 +107,12 @@ protected function setUp()
131
107
);
132
108
$ this ->suggestedListModel = new \Magento \ConfigurableProduct \Model \SuggestedAttributeList (
133
109
$ this ->attributeFactoryMock ,
134
- $ this ->resourceHelperMock ,
135
- $ this ->eventManagerMock ,
136
- $ this ->objectFactoryMock
110
+ $ this ->resourceHelperMock
137
111
);
138
112
}
139
113
140
114
public function testGetSuggestedAttributesIfTheyApplicable ()
141
115
{
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
-
147
116
$ source = $ this ->getMock (
148
117
'Magento\Eav\Model\Entity\Attribute\Source\AbstractSource ' ,
149
118
[],
@@ -163,10 +132,6 @@ public function testGetSuggestedAttributesIfTheyApplicable()
163
132
164
133
public function testGetSuggestedAttributesIfTheyNotApplicable ()
165
134
{
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 );
170
135
$ this ->attributeMock ->expects ($ this ->any ())->method ('getApplyTo ' )->will ($ this ->returnValue (['simple ' ]));
171
136
$ this ->attributeMock ->expects ($ this ->never ())->method ('getId ' );
172
137
$ this ->attributeMock ->expects ($ this ->never ())->method ('getFrontendLabel ' );
0 commit comments