Beispiel #1
0
 /**
  * Test wc_update_product_stock().
  *
  * @since 2.3
  */
 public function test_wc_update_product_stock()
 {
     // Create product
     $product = WC_Helper_Product::create_simple_product();
     update_post_meta($product->get_id(), '_manage_stock', 'yes');
     wc_update_product_stock($product->get_id(), 5);
     $product = new WC_Product_Simple($product->get_id());
     $this->assertEquals(5, $product->get_stock_quantity());
     // Delete Product
     WC_Helper_Product::delete_product($product->get_id());
 }