File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ use Magento \Catalog \Api \ProductRepositoryInterface ;
8
+ use Magento \Store \Api \WebsiteRepositoryInterface ;
9
+ use Magento \TestFramework \Helper \Bootstrap ;
10
+ use Magento \TestFramework \Workaround \Override \Fixture \Resolver ;
11
+
12
+ Bootstrap::getInstance ()->reinitialize ();
13
+
14
+ Resolver::getInstance ()->requireDataFixture (
15
+ 'Magento/ConfigurableProduct/_files/product_configurable_in_multiple_websites.php '
16
+ );
17
+
18
+ /** @var WebsiteRepositoryInterface $repository */
19
+ $ repository = Bootstrap::getObjectManager ()->get (WebsiteRepositoryInterface::class);
20
+ $ websiteId = $ repository ->get ('test ' )->getId ();
21
+
22
+ /** @var ProductRepositoryInterface $productRepository */
23
+ $ productRepository = Bootstrap::getObjectManager ()
24
+ ->create (ProductRepositoryInterface::class);
25
+
26
+ $ product = $ productRepository ->get ('simple_20 ' , true );
27
+ $ product ->setWebsiteIds ([$ websiteId ]);
28
+ $ product ->setSpecialPrice ('4 ' );
29
+ $ productRepository ->save ($ product );
30
+
31
+ $ product = $ productRepository ->get ('simple_10 ' , true );
32
+ $ product ->setWebsiteIds ([1 ]);
33
+ $ productRepository ->save ($ product );
You can’t perform that action at this time.
0 commit comments