|
8 | 8 | namespace Magento\GraphQl\Sales;
|
9 | 9 |
|
10 | 10 | use Exception;
|
| 11 | +use Magento\TestFramework\Fixture\Config; |
11 | 12 | use Magento\TestFramework\TestCase\GraphQlAbstract;
|
12 | 13 |
|
13 | 14 | class SalesTaxStoreConfigTest extends GraphQlAbstract
|
14 | 15 | {
|
15 | 16 | private const CONFIG_KEYS = [
|
16 |
| - 'display_product_prices_in_catalog', |
17 |
| - 'display_shipping_prices', |
18 |
| - 'orders_invoices_credit_memos_display_price', |
19 |
| - 'orders_invoices_credit_memos_display_subtotal', |
20 |
| - 'orders_invoices_credit_memos_display_shipping_amount', |
21 |
| - 'orders_invoices_credit_memos_display_grandtotal', |
22 |
| - 'orders_invoices_credit_memos_display_full_summary', |
23 |
| - 'orders_invoices_credit_memos_display_zero_tax', |
24 |
| - 'fixed_product_taxes_enable', |
25 |
| - 'fixed_product_taxes_display_prices_in_product_lists', |
26 |
| - 'fixed_product_taxes_display_prices_on_product_view_page', |
27 |
| - 'fixed_product_taxes_display_prices_in_sales_modules', |
28 |
| - 'fixed_product_taxes_display_prices_in_emails', |
29 |
| - 'fixed_product_taxes_apply_tax_to_fpt', |
30 |
| - 'fixed_product_taxes_include_fpt_in_subtotal', |
| 17 | + 'display_product_prices_in_catalog' => 1, |
| 18 | + 'display_shipping_prices' => 2, |
| 19 | + 'orders_invoices_credit_memos_display_price' => 1, |
| 20 | + 'orders_invoices_credit_memos_display_subtotal' => 2, |
| 21 | + 'orders_invoices_credit_memos_display_shipping_amount' => 3, |
| 22 | + 'orders_invoices_credit_memos_display_grandtotal' => 0, |
| 23 | + 'orders_invoices_credit_memos_display_full_summary' => 0, |
| 24 | + 'orders_invoices_credit_memos_display_zero_tax' => 0, |
| 25 | + 'fixed_product_taxes_enable' => 0, |
| 26 | + 'fixed_product_taxes_display_prices_in_product_lists' => 1, |
| 27 | + 'fixed_product_taxes_display_prices_on_product_view_page' => 1, |
| 28 | + 'fixed_product_taxes_display_prices_in_sales_modules' => 1, |
| 29 | + 'fixed_product_taxes_display_prices_in_emails' => 1, |
| 30 | + 'fixed_product_taxes_apply_tax_to_fpt' => 0, |
| 31 | + 'fixed_product_taxes_include_fpt_in_subtotal' => 0 |
31 | 32 | ];
|
| 33 | + |
32 | 34 | /**
|
33 | 35 | * @throws Exception
|
34 | 36 | */
|
35 |
| - public function testSalesTaxStoreConfigExists() |
| 37 | + #[ |
| 38 | + Config('tax/display/type', 1), |
| 39 | + Config('tax/display/shipping', 2), |
| 40 | + Config('tax/sales_display/price', 1), |
| 41 | + Config('tax/sales_display/subtotal', 2), |
| 42 | + Config('tax/sales_display/shipping', 3), |
| 43 | + Config('tax/sales_display/grandtotal', 0), |
| 44 | + Config('tax/sales_display/full_summary', 0), |
| 45 | + Config('tax/sales_display/zero_tax', 0), |
| 46 | + Config('tax/weee/enable', 0), |
| 47 | + Config('tax/weee/display_list', 1), |
| 48 | + Config('tax/weee/display', 1), |
| 49 | + Config('tax/weee/display_sales', 1), |
| 50 | + Config('tax/weee/display_email', 1), |
| 51 | + Config('tax/weee/apply_vat', 0), |
| 52 | + Config('tax/weee/include_in_subtotal', 0) |
| 53 | + ] |
| 54 | + public function testSalesTaxStoreConfig() |
36 | 55 | {
|
37 | 56 | $response = $this->graphQlQuery($this->getQuery());
|
38 |
| - $this->assertArrayHasKey('storeConfig', $response); |
39 |
| - $this->assertStoreConfigsExist($response['storeConfig']); |
40 |
| - } |
41 |
| - |
42 |
| - /** |
43 |
| - * Check if all the added store configs are returned in graphql response |
44 |
| - * |
45 |
| - * @param array $response |
46 |
| - * @return void |
47 |
| - */ |
48 |
| - private function assertStoreConfigsExist(array $response): void |
49 |
| - { |
50 |
| - foreach (self::CONFIG_KEYS as $key) { |
51 |
| - $this->assertArrayHasKey($key, $response); |
52 |
| - } |
| 57 | + $this->assertEquals(self::CONFIG_KEYS, $response['storeConfig']); |
53 | 58 | }
|
54 | 59 |
|
55 | 60 | /**
|
|
0 commit comments