|
8 | 8 | namespace Magento\Bundle\Block\Catalog\Product\View\Type;
|
9 | 9 |
|
10 | 10 | use Magento\Bundle\Model\Product\Price;
|
11 |
| -use Magento\Bundle\Model\Product\Type; |
12 | 11 | use Magento\Catalog\Api\Data\ProductInterface;
|
13 | 12 | use Magento\Catalog\Api\ProductRepositoryInterface;
|
14 |
| -use Magento\Catalog\Helper\Product as ProductHelper; |
15 | 13 | use Magento\Framework\ObjectManagerInterface;
|
16 | 14 | use Magento\Framework\Registry;
|
17 | 15 | use Magento\Framework\Serialize\SerializerInterface;
|
18 | 16 | use Magento\Framework\View\LayoutInterface;
|
19 | 17 | use Magento\TestFramework\Helper\Bootstrap;
|
20 | 18 | use PHPUnit\Framework\TestCase;
|
21 |
| -use Magento\Framework\DataObject\Factory as DataObjectFactory; |
22 | 19 |
|
23 | 20 | /**
|
24 | 21 | * Class checks bundle product view behaviour
|
@@ -90,41 +87,6 @@ public function testGetJsonConfig(): void
|
90 | 87 | $this->assertEquals(5, $selection['prices']['finalPrice']['amount']);
|
91 | 88 | }
|
92 | 89 |
|
93 |
| - /** |
94 |
| - * Check that selection qty is calculated correctly for Bundle config. |
95 |
| - * |
96 |
| - * @return void |
97 |
| - */ |
98 |
| - public function testGetJsonConfigWithPreconfiguredValues(): void |
99 |
| - { |
100 |
| - $optionQty = 3; |
101 |
| - $bundleProduct = $this->productRepository->get('bundle-product'); |
102 |
| - $bundleSelection = $this->productRepository->get('simple'); |
103 |
| - |
104 |
| - /** @var Type $typeInstance */ |
105 |
| - $typeInstance = $bundleProduct->getTypeInstance(); |
106 |
| - $typeInstance->setStoreFilter($bundleProduct->getStoreId(), $bundleProduct); |
107 |
| - $optionCollection = $typeInstance->getOptionsCollection($bundleProduct); |
108 |
| - $optionId = $optionCollection->getFirstItem()->getId(); |
109 |
| - $preconfiguredValues = $this->objectManager->get(DataObjectFactory::class)->create([ |
110 |
| - 'bundle_option' => [ |
111 |
| - $optionId => [$bundleSelection->getId()] |
112 |
| - ], |
113 |
| - 'bundle_option_qty' => [ |
114 |
| - $optionId => $optionQty |
115 |
| - ], |
116 |
| - ]); |
117 |
| - |
118 |
| - /** @var ProductHelper $productHelper */ |
119 |
| - $productHelper = $this->objectManager->get(ProductHelper::class); |
120 |
| - $productHelper->prepareProductOptions($bundleProduct, $preconfiguredValues); |
121 |
| - $this->registerProduct($bundleProduct); |
122 |
| - |
123 |
| - $resultConfig = $this->json->unserialize($this->block->getJsonConfig()); |
124 |
| - $this->assertTrue(isset($resultConfig['options'][$optionId]['selections'][$optionId]['qty'])); |
125 |
| - $this->assertEquals($optionQty, $resultConfig['options'][$optionId]['selections'][$optionId]['qty']); |
126 |
| - } |
127 |
| - |
128 | 90 | /**
|
129 | 91 | * @dataProvider isSalableForStockStatusProvider
|
130 | 92 | *
|
|
0 commit comments