88use Magento \Catalog \Api \ProductRepositoryInterface ;
99use Magento \Catalog \Model \Indexer \Product \Price \Processor ;
1010use Magento \Framework \App \ResourceConnection ;
11- use Magento \Store \Api \WebsiteRepositoryInterface ;
1211use Magento \Store \Model \StoreManagerInterface ;
1312use Magento \TestFramework \Fixture \AppIsolation ;
1413use Magento \TestFramework \Fixture \DataFixture ;
@@ -66,11 +65,6 @@ class IndexerBuilderTest extends \PHPUnit\Framework\TestCase
6665 */
6766 private $ indexProductProcessor ;
6867
69- /**
70- * @var WebsiteRepositoryInterface
71- */
72- private $ websiteRepository ;
73-
7468 protected function setUp (): void
7569 {
7670 $ this ->indexerBuilder = Bootstrap::getObjectManager ()->get (
@@ -82,7 +76,6 @@ protected function setUp(): void
8276 $ this ->productRepository = Bootstrap::getObjectManager ()->get (ProductRepositoryInterface::class);
8377 $ this ->connection = Bootstrap::getObjectManager ()->get (ResourceConnection::class);
8478 $ this ->indexProductProcessor = Bootstrap::getObjectManager ()->get (Processor::class);
85- $ this ->websiteRepository = Bootstrap::getObjectManager ()->get (WebsiteRepositoryInterface::class);
8679 }
8780
8881 protected function tearDown (): void
@@ -216,7 +209,7 @@ public function testRestoringTriggersAfterFullReindex()
216209 ]
217210 public function testReindexByIdForSecondStore (): void
218211 {
219- $ websiteId = $ this ->websiteRepository -> get ('test ' )->getId ();
212+ $ websiteId = $ this ->storeManager -> getWebsite ('test ' )->getId ();
220213 $ simpleProduct = $ this ->productRepository ->get ('simple ' );
221214 $ this ->indexerBuilder ->reindexById ($ simpleProduct ->getId ());
222215 $ rulePrice = $ this ->resourceRule ->getRulePrice (new \DateTime (), $ websiteId , 1 , $ simpleProduct ->getId ());
@@ -228,7 +221,7 @@ public function testReindexByIdForSecondStore(): void
228221 ]
229222 public function testReindexByIdsForSecondStore (): void
230223 {
231- $ websiteId = $ this ->websiteRepository -> get ('test ' )->getId ();
224+ $ websiteId = $ this ->storeManager -> getWebsite ('test ' )->getId ();
232225 $ simpleProduct = $ this ->productRepository ->get ('simple ' );
233226 $ this ->indexerBuilder ->reindexByIds ([$ simpleProduct ->getId ()]);
234227 $ rulePrice = $ this ->resourceRule ->getRulePrice (new \DateTime (), $ websiteId , 1 , $ simpleProduct ->getId ());
@@ -240,7 +233,7 @@ public function testReindexByIdsForSecondStore(): void
240233 ]
241234 public function testReindexFullForSecondStore (): void
242235 {
243- $ websiteId = $ this ->websiteRepository -> get ('test ' )->getId ();
236+ $ websiteId = $ this ->storeManager -> getWebsite ('test ' )->getId ();
244237 $ simpleProduct = $ this ->productRepository ->get ('simple ' );
245238 $ this ->indexerBuilder ->reindexFull ();
246239 $ rulePrice = $ this ->resourceRule ->getRulePrice (new \DateTime (), $ websiteId , 1 , $ simpleProduct ->getId ());
0 commit comments