Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Sep 23, 2024
1 parent f4ecafc commit 300c48f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/unit-tests/api/products.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function test_create_product() {
$nutrient = wp_insert_term( 'Salt', 'product_nutrient', array( 'slug' => 'salt' ) );
$nutrient_2 = wp_insert_term( 'Natrium', 'product_nutrient', array( 'slug' => 'natrium' ) );
$allergen = wp_insert_term( 'Nut', 'product_allergen', array( 'slug' => 'nut' ) );
// $attachment_id = WC_GZD_Helper_Product::create_attachment( 'test' );
$attachment_id = WC_GZD_Helper_Product::create_attachment();

// Create simple.
$request = new WP_REST_Request( 'POST', '/wc/v3/products' );
Expand Down Expand Up @@ -127,6 +127,9 @@ public function test_create_product() {
'sale_price_regular_label' => array( 'id' => $sale_term['term_id'] ),
'differential_taxation' => false,
'is_food' => true,
'safety_attachment_ids' => array(
$attachment_id
),
'food' => array(
'ingredients' => '<strong>Test</strong>, another',
'description' => 'Test',
Expand Down Expand Up @@ -166,7 +169,7 @@ public function test_create_product() {
$this->assertEquals( '70.0', $data['unit_price']['price_sale'] );

$this->assertEquals( 'woocommerce', $data['manufacturer']['slug'] );
// $this->assertEquals( array( $attachment_id ), $data['safety_attachment_ids'] );
$this->assertEquals( array( $attachment_id ), $data['safety_attachment_ids'] );

$this->assertEquals( 'test_gtin', $data['gtin'] );
$this->assertEquals( 'test_mpn', $data['mpn'] );
Expand Down

0 comments on commit 300c48f

Please sign in to comment.