diff --git a/tests/Tools/HelperTrait/ProductTrait.php b/tests/Tools/HelperTrait/ProductTrait.php index c51755fe6c..4f67d19fbd 100644 --- a/tests/Tools/HelperTrait/ProductTrait.php +++ b/tests/Tools/HelperTrait/ProductTrait.php @@ -487,7 +487,12 @@ protected function generate_mock_image_attachment( int $product_id, string $imag * @return WCProductAdapter The adapted products with the rules applied. */ protected function generate_attribute_mapping_adapted_product( $rules, $categories = [] ) { - $product = WC_Helper_Product::create_simple_product( false ); + $product = WC_Helper_Product::create_simple_product( + false, + [ + 'sku' => 'Mapped Product SKU', + ] + ); $attributes = [ WC_Helper_Product::create_product_attribute_object( 'size', [ 's', 'xs' ] ), diff --git a/tests/Unit/Product/AttributeMapping/AttributeMappingWCProductAdapterTest.php b/tests/Unit/Product/AttributeMapping/AttributeMappingWCProductAdapterTest.php index 528660be0d..51945d88bc 100644 --- a/tests/Unit/Product/AttributeMapping/AttributeMappingWCProductAdapterTest.php +++ b/tests/Unit/Product/AttributeMapping/AttributeMappingWCProductAdapterTest.php @@ -112,7 +112,7 @@ public function test_maps_rules_product_fields_sku() { $adapted_product = $this->generate_attribute_mapping_adapted_product( $rules ); $adapted_variation = $this->generate_attribute_mapping_adapted_product_variant( $rules ); - $this->assertEquals( 'DUMMY SKU', $adapted_product->getGtin() ); + $this->assertEquals( 'Mapped Product SKU', $adapted_product->getGtin() ); $this->assertEquals( 'DUMMY SKU VARIABLE HUGE BLUE ANY NUMBER', $adapted_variation->getGtin() ); }