Fixed WC_Tests_Product_Data::test_product_getters_and_setters tests
This commit is contained in:
parent
4d55aaf4ef
commit
a32fae4191
|
@ -73,10 +73,11 @@ class WC_Tests_Product_Data extends WC_Unit_Test_Case {
|
||||||
$this->assertEquals( $product->get_date_on_sale_to()->getTimestamp(), 1477267200 );
|
$this->assertEquals( $product->get_date_on_sale_to()->getTimestamp(), 1477267200 );
|
||||||
|
|
||||||
$image_url = media_sideload_image( "https://cldup.com/Dr1Bczxq4q.png", $product->get_id(), '', 'src' );
|
$image_url = media_sideload_image( "https://cldup.com/Dr1Bczxq4q.png", $product->get_id(), '', 'src' );
|
||||||
$image_id = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ) );
|
$image_id = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE guid='%s';", $image_url ) );
|
||||||
$product->set_image_id( $image_id[0] );
|
$product->set_image_id( $image_id[0] );
|
||||||
$product->save();
|
$product->save();
|
||||||
$this->assertEquals( $image_id[0], $product->get_image_id() );
|
$this->assertEquals( $image_id[0], $product->get_image_id() );
|
||||||
|
$product->delete( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue