|
7 | 7 |
|
8 | 8 | namespace Magento\GraphQl\Bundle;
|
9 | 9 |
|
| 10 | +use Magento\Bundle\Test\Fixture\Link as BundleSelectionFixture; |
| 11 | +use Magento\Bundle\Test\Fixture\Option as BundleOptionFixture; |
| 12 | +use Magento\Bundle\Test\Fixture\Product as BundleProductFixture; |
10 | 13 | use Magento\Catalog\Api\ProductRepositoryInterface;
|
| 14 | +use Magento\Catalog\Test\Fixture\Product as ProductFixture; |
11 | 15 | use Magento\TestFramework\TestCase\GraphQlAbstract;
|
12 | 16 | use Magento\TestFramework\Helper\Bootstrap;
|
13 | 17 | use Magento\Quote\Model\Quote;
|
14 | 18 | use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
|
15 | 19 | use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
|
| 20 | +use Magento\TestFramework\Fixture\DataFixture; |
16 | 21 |
|
17 | 22 | /**
|
18 | 23 | * Test adding bundled products to cart
|
@@ -378,9 +383,25 @@ public function testAddBundleToCartWithRadioAndSelectErr()
|
378 | 383 | }
|
379 | 384 |
|
380 | 385 | /**
|
381 |
| - * @magentoApiDataFixture Magento/Bundle/_files/product_with_multiple_options_multiselect_checkbox.php |
382 | 386 | * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
|
383 | 387 | */
|
| 388 | + #[ |
| 389 | + DataFixture(ProductFixture::class, ['sku' => 'simple-1', 'price' => 10], 'p1'), |
| 390 | + DataFixture(ProductFixture::class, ['sku' => 'simple2', 'price' => 20], 'p2'), |
| 391 | + DataFixture(BundleSelectionFixture::class, ['sku' => '$p1.sku$', 'price' => 10, 'price_type' => 0, |
| 392 | + 'title' => 'Checkbox Options','default_title' => 'Checkbox Options', 'type' => 'checkbox', |
| 393 | + 'required' => 1, 'delete' => ''], 'link1'), |
| 394 | + DataFixture(BundleSelectionFixture::class, ['sku' => '$p2.sku$', 'price' => 25, 'price_type' => 1, |
| 395 | + 'title' => 'Multiselect Options','default_title' => 'Multiselect Options', 'type' => 'multi', |
| 396 | + 'required' => 1, 'delete' => ''], 'link2'), |
| 397 | + DataFixture(BundleOptionFixture::class, ['product_links' => ['$link1$', '$link2$']], 'opt1'), |
| 398 | + DataFixture( |
| 399 | + BundleProductFixture::class, |
| 400 | + ['sku' => 'bundle-product-multiselect-checkbox-options','price' => 50,'price_type' => 1, |
| 401 | + '_options' => ['$opt1$']], |
| 402 | + 'bundle-product-multiselect-checkbox-options' |
| 403 | + ), |
| 404 | + ] |
384 | 405 | public function testAddBundleToCartWithEmptyMultiselectOptionValue()
|
385 | 406 | {
|
386 | 407 | $this->expectException(\Exception::class);
|
|
0 commit comments