10
10
use Magento \Catalog \Model \Indexer \Product \Price \Processor ;
11
11
use Magento \Customer \Api \Data \GroupExtensionInterface ;
12
12
use Magento \Customer \Api \Data \GroupInterface ;
13
- use Magento \Customer \Api \GroupRepositoryInterface ;
14
13
use Magento \Customer \Api \GroupExcludedWebsiteRepositoryInterface ;
14
+ use Magento \Customer \Api \GroupRepositoryInterface ;
15
15
use Magento \Customer \Model \Data \GroupExcludedWebsite ;
16
16
use Magento \Customer \Model \Data \GroupExcludedWebsiteFactory ;
17
17
use Magento \Customer \Model \Plugin \SaveCustomerGroupExcludedWebsite ;
@@ -80,12 +80,15 @@ class SaveCustomerGroupExcludedWebsiteTest extends TestCase
80
80
*/
81
81
private $ plugin ;
82
82
83
+ /**
84
+ * @inheritdoc
85
+ */
83
86
protected function setUp (): void
84
87
{
85
88
$ objectManagerHelper = new ObjectManager ($ this );
86
89
87
90
$ this ->groupExcludedWebsiteFactory = $ this ->getMockBuilder (GroupExcludedWebsiteFactory::class)
88
- ->setMethods (['create ' ])
91
+ ->onlyMethods (['create ' ])
89
92
->disableOriginalConstructor ()
90
93
->getMock ();
91
94
$ this ->groupExcludedWebsiteRepository = $ this ->getMockForAbstractClass (
@@ -130,6 +133,9 @@ protected function setUp(): void
130
133
);
131
134
}
132
135
136
+ /**
137
+ * @return void
138
+ */
133
139
public function testAfterSaveWithoutExtensionAttributes (): void
134
140
{
135
141
$ this ->groupExtensionInterface ->method ('getExcludeWebsiteIds ' )->willReturn (null );
@@ -139,11 +145,13 @@ public function testAfterSaveWithoutExtensionAttributes(): void
139
145
}
140
146
141
147
/**
142
- * @dataProvider dataProviderNoExcludedWebsitesChanged
143
148
* @param array $excludedWebsites
144
149
* @param array $websitesToExclude
150
+ *
151
+ * @return void
145
152
* @throws \Magento\Framework\Exception\CouldNotSaveException
146
153
* @throws \Magento\Framework\Exception\LocalizedException
154
+ * @dataProvider dataProviderNoExcludedWebsitesChanged
147
155
*/
148
156
public function testAfterSaveWithNoExcludedWebsitesChanged (array $ excludedWebsites , array $ websitesToExclude ): void
149
157
{
@@ -159,12 +167,14 @@ public function testAfterSaveWithNoExcludedWebsitesChanged(array $excludedWebsit
159
167
}
160
168
161
169
/**
162
- * @dataProvider dataProviderExcludedWebsitesChanged
163
170
* @param array $excludedWebsites
164
171
* @param array $websitesToExclude
165
172
* @param int $times
173
+ *
174
+ * @return void
166
175
* @throws \Magento\Framework\Exception\CouldNotSaveException
167
176
* @throws \Magento\Framework\Exception\LocalizedException
177
+ * @dataProvider dataProviderExcludedWebsitesChanged
168
178
*/
169
179
public function testAfterSaveWithExcludedWebsitesChanged (
170
180
array $ excludedWebsites ,
@@ -187,7 +197,7 @@ public function testAfterSaveWithExcludedWebsitesChanged(
187
197
->method ('setExcludedWebsiteId ' )->willReturnSelf ();
188
198
$ this ->groupExcludedWebsiteRepository ->expects (self ::exactly ($ times ))
189
199
->method ('save ' )
190
- ->willReturn ($ this ->groupExcludedWebsiteResourceModel );
200
+ ->willReturn ($ this ->groupExcludedWebsite );
191
201
192
202
$ this ->priceIndexProcessor ->expects (self ::once ())->method ('getIndexer ' )
193
203
->willReturn ($ this ->priceIndexer );
@@ -197,14 +207,17 @@ public function testAfterSaveWithExcludedWebsitesChanged(
197
207
$ this ->plugin ->afterSave ($ this ->groupRepositoryInterface , $ this ->groupInterface , $ this ->groupInterface );
198
208
}
199
209
210
+ /**
211
+ * @return void
212
+ */
200
213
private function getAllWebsites (): void
201
214
{
202
215
$ websiteMock1 = $ this ->getMockBuilder (Website::class)
203
- ->setMethods (['getWebsiteId ' ])
216
+ ->addMethods (['getWebsiteId ' ])
204
217
->disableOriginalConstructor ()
205
218
->getMock ();
206
219
$ websiteMock2 = $ this ->getMockBuilder (Website::class)
207
- ->setMethods (['getWebsiteId ' ])
220
+ ->addMethods (['getWebsiteId ' ])
208
221
->disableOriginalConstructor ()
209
222
->getMock ();
210
223
$ this ->store ->expects (self ::once ())->method ('getWebsiteCollection ' )
0 commit comments