Switch to assertCount for count assertions in test

This commit is contained in:
Jonathan Sadowski 2020-04-24 13:54:12 -05:00
parent 3d0bfd8ee2
commit 3f70f70f3a
1 changed files with 2 additions and 2 deletions

View File

@ -2074,7 +2074,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case {
remove_filter( 'woocommerce_add_to_cart_redirect', '__return_false' ); remove_filter( 'woocommerce_add_to_cart_redirect', '__return_false' );
// Check if the item is in the cart. // Check if the item is in the cart.
$this->assertEquals( 1, count( WC()->cart->get_cart_contents() ) ); $this->assertCount( 1, WC()->cart->get_cart_contents() );
$this->assertEquals( 1, WC()->cart->get_cart_contents_count() ); $this->assertEquals( 1, WC()->cart->get_cart_contents_count() );
// Add variation using parent id. // Add variation using parent id.
@ -2090,7 +2090,7 @@ class WC_Tests_Cart extends WC_Unit_Test_Case {
); );
// Check that the second add to cart call increases the quantity of the existing cart-item. // Check that the second add to cart call increases the quantity of the existing cart-item.
$this->assertEquals( 1, count( WC()->cart->get_cart_contents() ) ); $this->assertCount( 1, WC()->cart->get_cart_contents() );
$this->assertEquals( 2, WC()->cart->get_cart_contents_count() ); $this->assertEquals( 2, WC()->cart->get_cart_contents_count() );
} }