Fixed WC_Tests_Product_Data::test_product_getters_and_setters tests

This commit is contained in:
Claudio Sanches 2017-11-16 17:23:42 -02:00
parent 4d55aaf4ef
commit a32fae4191
1 changed files with 2 additions and 1 deletions

View File

@ -73,10 +73,11 @@ class WC_Tests_Product_Data extends WC_Unit_Test_Case {
$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_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->save();
$this->assertEquals( $image_id[0], $product->get_image_id() );
$product->delete( true );
}
/**