8
8
use Magento \Catalog \Api \ProductRepositoryInterface ;
9
9
use Magento \Catalog \Model \Indexer \Product \Price \Processor ;
10
10
use Magento \Framework \App \ResourceConnection ;
11
- use Magento \Store \Api \WebsiteRepositoryInterface ;
12
11
use Magento \Store \Model \StoreManagerInterface ;
13
12
use Magento \TestFramework \Fixture \AppIsolation ;
14
13
use Magento \TestFramework \Fixture \DataFixture ;
@@ -66,11 +65,6 @@ class IndexerBuilderTest extends \PHPUnit\Framework\TestCase
66
65
*/
67
66
private $ indexProductProcessor ;
68
67
69
- /**
70
- * @var WebsiteRepositoryInterface
71
- */
72
- private $ websiteRepository ;
73
-
74
68
protected function setUp (): void
75
69
{
76
70
$ this ->indexerBuilder = Bootstrap::getObjectManager ()->get (
@@ -82,7 +76,6 @@ protected function setUp(): void
82
76
$ this ->productRepository = Bootstrap::getObjectManager ()->get (ProductRepositoryInterface::class);
83
77
$ this ->connection = Bootstrap::getObjectManager ()->get (ResourceConnection::class);
84
78
$ this ->indexProductProcessor = Bootstrap::getObjectManager ()->get (Processor::class);
85
- $ this ->websiteRepository = Bootstrap::getObjectManager ()->get (WebsiteRepositoryInterface::class);
86
79
}
87
80
88
81
protected function tearDown (): void
@@ -216,7 +209,7 @@ public function testRestoringTriggersAfterFullReindex()
216
209
]
217
210
public function testReindexByIdForSecondStore (): void
218
211
{
219
- $ websiteId = $ this ->websiteRepository -> get ('test ' )->getId ();
212
+ $ websiteId = $ this ->storeManager -> getWebsite ('test ' )->getId ();
220
213
$ simpleProduct = $ this ->productRepository ->get ('simple ' );
221
214
$ this ->indexerBuilder ->reindexById ($ simpleProduct ->getId ());
222
215
$ rulePrice = $ this ->resourceRule ->getRulePrice (new \DateTime (), $ websiteId , 1 , $ simpleProduct ->getId ());
@@ -228,7 +221,7 @@ public function testReindexByIdForSecondStore(): void
228
221
]
229
222
public function testReindexByIdsForSecondStore (): void
230
223
{
231
- $ websiteId = $ this ->websiteRepository -> get ('test ' )->getId ();
224
+ $ websiteId = $ this ->storeManager -> getWebsite ('test ' )->getId ();
232
225
$ simpleProduct = $ this ->productRepository ->get ('simple ' );
233
226
$ this ->indexerBuilder ->reindexByIds ([$ simpleProduct ->getId ()]);
234
227
$ rulePrice = $ this ->resourceRule ->getRulePrice (new \DateTime (), $ websiteId , 1 , $ simpleProduct ->getId ());
@@ -240,7 +233,7 @@ public function testReindexByIdsForSecondStore(): void
240
233
]
241
234
public function testReindexFullForSecondStore (): void
242
235
{
243
- $ websiteId = $ this ->websiteRepository -> get ('test ' )->getId ();
236
+ $ websiteId = $ this ->storeManager -> getWebsite ('test ' )->getId ();
244
237
$ simpleProduct = $ this ->productRepository ->get ('simple ' );
245
238
$ this ->indexerBuilder ->reindexFull ();
246
239
$ rulePrice = $ this ->resourceRule ->getRulePrice (new \DateTime (), $ websiteId , 1 , $ simpleProduct ->getId ());
0 commit comments