Cart get_cross_sells test

This commit is contained in:
Gerhard Potgieter 2017-12-13 16:33:17 +02:00
parent 2f239311f2
commit deb2ad8f40
1 changed files with 11 additions and 0 deletions

View File

@ -1361,4 +1361,15 @@ class WC_Tests_Cart extends WC_Unit_Test_Case {
// Clean up product.
WC_Helper_Product::delete_product( $product->get_id() );
}
public function test_get_cross_sells() {
// Create dummy product.
$product = WC_Helper_Product::create_simple_product();
WC()->cart->add_to_cart( $product->get_id(), 1 );
$this->assertEquals( array(), WC()->cart->get_cross_sells() );
// Clean up the cart.
WC()->cart->empty_cart();
// Clean up product.
WC_Helper_Product::delete_product( $product->get_id() );
}
}