14
14
use Magento \Customer \Model \ResourceModel \Group as CustomerGroupResourceModel ;
15
15
use Magento \Framework \Indexer \IndexerInterface ;
16
16
use Magento \Framework \Indexer \IndexerRegistry ;
17
- use Magento \Framework \Search \EngineResolverInterface ;
18
17
use PHPUnit \Framework \TestCase ;
18
+ use PHPUnit \Framework \MockObject \MockObject ;
19
19
20
20
/**
21
21
* @covers \Magento\AdvancedSearch\Model\Indexer\Fulltext\Plugin\CustomerGroup
@@ -35,7 +35,7 @@ class CustomerGroupTest extends TestCase
35
35
private $ indexerMock ;
36
36
37
37
/**
38
- * @var Group |MockObject
38
+ * @var CustomerGroupResourceModel |MockObject
39
39
*/
40
40
private $ subjectMock ;
41
41
@@ -49,11 +49,6 @@ class CustomerGroupTest extends TestCase
49
49
*/
50
50
private $ indexerRegistryMock ;
51
51
52
- /**
53
- * @var EngineResolverInterface|MockObject
54
- */
55
- private $ engineResolverMock ;
56
-
57
52
protected function setUp (): void
58
53
{
59
54
$ this ->subjectMock = $ this ->createMock (CustomerGroupResourceModel::class);
@@ -73,35 +68,24 @@ protected function setUp(): void
73
68
IndexerRegistry::class,
74
69
['get ' ]
75
70
);
76
- $ this ->engineResolverMock = $ this ->createPartialMock (
77
- EngineResolverInterface::class,
78
- ['getCurrentSearchEngine ' ]
79
- );
80
71
$ this ->model = new CustomerGroupPlugin (
81
72
$ this ->indexerRegistryMock ,
82
- $ this ->customerOptionsMock ,
83
- $ this ->engineResolverMock
73
+ $ this ->customerOptionsMock
84
74
);
85
75
}
86
76
87
77
/**
88
- * @param string $searchEngine
89
78
* @param bool $isObjectNew
90
79
* @param bool $isTaxClassIdChanged
91
80
* @param int $invalidateCounter
92
81
* @return void
93
82
* @dataProvider aroundSaveDataProvider
94
83
*/
95
84
public function testAroundSave (
96
- string $ searchEngine ,
97
85
bool $ isObjectNew ,
98
86
bool $ isTaxClassIdChanged ,
99
87
int $ invalidateCounter
100
88
): void {
101
- $ this ->engineResolverMock ->expects ($ this ->once ())
102
- ->method ('getCurrentSearchEngine ' )
103
- ->willReturn ($ searchEngine );
104
-
105
89
$ groupMock = $ this ->createPartialMock (
106
90
CustomerGroupModel::class,
107
91
['dataHasChangedFor ' , 'isObjectNew ' , '__wakeup ' ]
@@ -137,14 +121,10 @@ public function testAroundSave(
137
121
public function aroundSaveDataProvider (): array
138
122
{
139
123
return [
140
- ['mysql ' , false , false , 0 ],
141
- ['mysql ' , false , true , 0 ],
142
- ['mysql ' , true , false , 0 ],
143
- ['mysql ' , true , true , 0 ],
144
- ['custom ' , false , false , 0 ],
145
- ['custom ' , false , true , 1 ],
146
- ['custom ' , true , false , 1 ],
147
- ['custom ' , true , true , 1 ],
124
+ [false , false , 0 ],
125
+ [false , true , 1 ],
126
+ [true , false , 1 ],
127
+ [true , true , 1 ],
148
128
];
149
129
}
150
130
}
0 commit comments