From b433e75c8806fe89a31282d34388ff48f8333c02 Mon Sep 17 00:00:00 2001 From: Wojdylak Date: Wed, 15 Nov 2023 16:13:45 +0100 Subject: [PATCH] [Test][Api/Admin] Remove locale from POST/PUT --- tests/Api/Admin/CatalogPromotionsTest.php | 3 --- tests/Api/Admin/ProductAssociationTypesTest.php | 1 - tests/Api/Admin/ProductAttributesTest.php | 16 ---------------- tests/Api/Admin/ProductVariantsTest.php | 3 --- tests/Api/Admin/PromotionsTest.php | 1 - tests/Api/Admin/TaxonsTest.php | 2 -- 6 files changed, 26 deletions(-) diff --git a/tests/Api/Admin/CatalogPromotionsTest.php b/tests/Api/Admin/CatalogPromotionsTest.php index 549de8a532e..32a2af7aeb5 100644 --- a/tests/Api/Admin/CatalogPromotionsTest.php +++ b/tests/Api/Admin/CatalogPromotionsTest.php @@ -108,7 +108,6 @@ public function it_creates_a_catalog_promotion(): void ], ], 'translations' => ['en_US' => [ - 'locale' => 'en_US', 'label' => 'T-Shirts discount', 'description' => '50% discount on every T-Shirt', ]], @@ -271,7 +270,6 @@ public function it_does_not_create_a_catalog_promotion_with_invalid_scopes(): vo ], ], 'translations' => ['en_US' => [ - 'locale' => 'en_US', 'label' => 'T-Shirts discount', 'description' => '50% discount on every T-Shirt', ]], @@ -370,7 +368,6 @@ public function it_does_not_create_a_catalog_promotion_with_invalid_actions(): v ], ], 'translations' => ['en_US' => [ - 'locale' => 'en_US', 'label' => 'T-Shirts discount', 'description' => '50% discount on every T-Shirt', ]], diff --git a/tests/Api/Admin/ProductAssociationTypesTest.php b/tests/Api/Admin/ProductAssociationTypesTest.php index f43ac45af1f..b67d965ee5f 100644 --- a/tests/Api/Admin/ProductAssociationTypesTest.php +++ b/tests/Api/Admin/ProductAssociationTypesTest.php @@ -90,7 +90,6 @@ public function it_creates_product_association_type(): void 'translations' => ['en_US' => [ 'name' => 'test', 'description' => 'test description', - 'locale' => 'en_US' ]] ], JSON_THROW_ON_ERROR), ); diff --git a/tests/Api/Admin/ProductAttributesTest.php b/tests/Api/Admin/ProductAttributesTest.php index 640d9d73199..7e2cfc6b635 100644 --- a/tests/Api/Admin/ProductAttributesTest.php +++ b/tests/Api/Admin/ProductAttributesTest.php @@ -110,7 +110,6 @@ public function it_creates_a_text_product_attribute(): void 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -140,7 +139,6 @@ public function it_creates_a_textarea_product_attribute(): void 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -170,7 +168,6 @@ public function it_creates_a_checkbox_product_attribute(): void 'translatable' => false, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'New', ], ], @@ -200,7 +197,6 @@ public function it_creates_an_integer_product_attribute(): void 'translatable' => false, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Pages', ], ], @@ -230,7 +226,6 @@ public function it_creates_a_float_product_attribute(): void 'translatable' => false, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Display size', ], ], @@ -260,7 +255,6 @@ public function it_creates_a_percent_product_attribute(): void 'translatable' => false, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Damage reduction', ], ], @@ -293,7 +287,6 @@ public function it_creates_a_datetime_product_attribute(): void 'translatable' => false, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Published at', ], ], @@ -326,7 +319,6 @@ public function it_creates_a_date_product_attribute(): void 'translatable' => false, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Published at', ], ], @@ -370,7 +362,6 @@ public function it_creates_a_select_product_attribute(): void 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -419,7 +410,6 @@ public function it_does_not_create_a_product_attribute_with_unregistered_type(): 'type' => 'foobar', 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Test', ], ], @@ -453,7 +443,6 @@ public function it_does_not_create_a_text_product_attribute_with_invalid_configu 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -497,7 +486,6 @@ public function it_does_not_create_a_select_product_attribute_with_disabled_mult 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -541,7 +529,6 @@ public function it_does_not_create_a_select_product_attribute_with_invalid_max_e 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -584,7 +571,6 @@ public function it_does_not_create_a_select_product_attribute_with_invalid_min_e 'translatable' => true, 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Material', ], ], @@ -641,11 +627,9 @@ public function it_updates_a_product_attribute(): void '/api/v2/admin/product-attribute-translations/%s', $productAttribute->getTranslation('en_US')->getId(), ), - 'locale' => 'en_US', 'name' => 'Additional information', ], 'pl_PL' => [ - 'locale' => 'pl_PL', 'name' => 'Dodatkowe informacje', ], ] diff --git a/tests/Api/Admin/ProductVariantsTest.php b/tests/Api/Admin/ProductVariantsTest.php index c070703e679..bba428d9708 100644 --- a/tests/Api/Admin/ProductVariantsTest.php +++ b/tests/Api/Admin/ProductVariantsTest.php @@ -114,7 +114,6 @@ public function it_creates_a_product_variant_with_all_optional_data(): void ]], 'translations' => [ 'en_US' => [ - 'locale' => 'en_US', 'name' => 'Red mug', ], ], @@ -285,7 +284,6 @@ public function it_does_not_allow_to_create_product_variant_with_invalid_locale_ ]], 'translations' => [ 'NON-EXISTING-LOCALE-CODE' => [ - 'locale' => 'NON-EXISTING-LOCALE-CODE', 'name' => 'Yellow mug', ], ], @@ -384,7 +382,6 @@ public function it_does_not_allow_to_update_product_variant_with_invalid_locale_ ]], 'translations' => [ 'NON-EXISTING-LOCALE-CODE' => [ - 'locale' => 'NON-EXISTING-LOCALE-CODE', 'name' => 'Yellow mug', ], ], diff --git a/tests/Api/Admin/PromotionsTest.php b/tests/Api/Admin/PromotionsTest.php index 0e8be6c0b24..2db48ecec81 100644 --- a/tests/Api/Admin/PromotionsTest.php +++ b/tests/Api/Admin/PromotionsTest.php @@ -74,7 +74,6 @@ public function it_creates_promotion(): void 'code' => 'tshirts_discount', 'appliesToDiscounted' => false, 'translations' => ['en_US' => [ - 'locale' => 'en_US', 'label' => 'T-Shirts discount', ]], ], JSON_THROW_ON_ERROR), diff --git a/tests/Api/Admin/TaxonsTest.php b/tests/Api/Admin/TaxonsTest.php index fb5bb0c57c8..7713c2fc2ba 100644 --- a/tests/Api/Admin/TaxonsTest.php +++ b/tests/Api/Admin/TaxonsTest.php @@ -76,7 +76,6 @@ public function it_creates_a_taxon(): void 'en_US' => [ 'name' => 'Watches', 'slug' => 'watches', - 'locale' => 'en_US' ] ] ], JSON_THROW_ON_ERROR), @@ -126,7 +125,6 @@ public function it_does_not_create_a_taxon_with_taken_code(): void 'en_US' => [ 'name' => 'Watches', 'slug' => 'watches', - 'locale' => 'en_US' ] ] ], JSON_THROW_ON_ERROR),