|
7 | 7 |
|
8 | 8 | namespace Magento\GraphQl\Sales;
|
9 | 9 |
|
| 10 | +use Magento\Catalog\Test\Fixture\Product as ProductFixture; |
| 11 | +use Magento\Checkout\Test\Fixture\PlaceOrder as PlaceOrderFixture; |
| 12 | +use Magento\Checkout\Test\Fixture\SetBillingAddress as SetBillingAddressFixture; |
| 13 | +use Magento\Checkout\Test\Fixture\SetDeliveryMethod as SetDeliveryMethodFixture; |
| 14 | +use Magento\Checkout\Test\Fixture\SetGuestEmail as SetGuestEmailFixture; |
| 15 | +use Magento\Checkout\Test\Fixture\SetPaymentMethod as SetPaymentMethodFixture; |
| 16 | +use Magento\Checkout\Test\Fixture\SetShippingAddress as SetShippingAddressFixture; |
| 17 | +use Magento\Customer\Test\Fixture\Customer; |
10 | 18 | use Magento\Framework\Registry;
|
| 19 | +use Magento\Quote\Test\Fixture\AddProductToCart as AddProductToCartFixture; |
| 20 | +use Magento\Quote\Test\Fixture\CustomerCart; |
| 21 | +use Magento\Quote\Test\Fixture\GuestCart as GuestCartFixture; |
11 | 22 | use Magento\Sales\Api\OrderRepositoryInterface;
|
12 | 23 | use Magento\Sales\Model\ResourceModel\Order\Collection;
|
| 24 | +use Magento\Sales\Test\Fixture\Invoice as InvoiceFixture; |
| 25 | +use Magento\Sales\Test\Fixture\InvoiceComment as InvoiceCommentFixture ; |
| 26 | +use Magento\TestFramework\Fixture\DataFixture; |
13 | 27 | use Magento\TestFramework\Helper\Bootstrap;
|
14 | 28 | use Magento\TestFramework\TestCase\GraphQlAbstract;
|
15 | 29 | use Magento\GraphQl\GetCustomerAuthenticationHeader;
|
@@ -410,9 +424,29 @@ public function testPartialInvoiceForCustomerWithTaxesAndDiscounts()
|
410 | 424 | $this->deleteOrder();
|
411 | 425 | }
|
412 | 426 |
|
413 |
| - /** |
414 |
| - * @magentoApiDataFixture Magento/Sales/_files/customer_invoice_comments_for_search.php |
415 |
| - */ |
| 427 | + #[ |
| 428 | + DataFixture(Customer::class, ['email' => 'customer@search.example.com'], as: 'customer'), |
| 429 | + DataFixture(ProductFixture::class, as: 'product'), |
| 430 | + DataFixture(CustomerCart::class, ['customer_id' => '$customer.id$'], as: 'cart'), |
| 431 | + DataFixture(AddProductToCartFixture::class, ['cart_id' => '$cart.id$', 'product_id' => '$product.id$']), |
| 432 | + DataFixture(SetBillingAddressFixture::class, ['cart_id' => '$cart.id$']), |
| 433 | + DataFixture(SetShippingAddressFixture::class, ['cart_id' => '$cart.id$']), |
| 434 | + DataFixture(SetGuestEmailFixture::class, ['cart_id' => '$cart.id$']), |
| 435 | + DataFixture(SetDeliveryMethodFixture::class, ['cart_id' => '$cart.id$']), |
| 436 | + DataFixture(SetPaymentMethodFixture::class, ['cart_id' => '$cart.id$']), |
| 437 | + DataFixture(PlaceOrderFixture::class, ['cart_id' => '$cart.id$'], 'order'), |
| 438 | + DataFixture(InvoiceFixture::class, ['order_id' => '$order.id$'], 'invoice'), |
| 439 | + DataFixture(InvoiceCommentFixture::class, [ |
| 440 | + 'parent_id' => '$invoice.id$', |
| 441 | + 'comment' => 'visible_comment', |
| 442 | + 'is_visible_on_front' => 1, |
| 443 | + ]), |
| 444 | + DataFixture(InvoiceCommentFixture::class, [ |
| 445 | + 'parent_id' => '$invoice.id$', |
| 446 | + 'comment' => 'non_visible_comment', |
| 447 | + 'is_visible_on_front' => 0, |
| 448 | + ]), |
| 449 | + ] |
416 | 450 | public function testInvoiceCommentsQuery()
|
417 | 451 | {
|
418 | 452 | $query =
|
|
0 commit comments