Update the test to make sure there are no error notices

This commit is contained in:
Jonathan Sadowski 2020-04-24 14:02:14 -05:00
parent 3f70f70f3a
commit 790c8ae8ae
1 changed files with 7 additions and 0 deletions

View File

@ -2077,6 +2077,9 @@ class WC_Tests_Cart extends WC_Unit_Test_Case {
$this->assertCount( 1, WC()->cart->get_cart_contents() );
$this->assertEquals( 1, WC()->cart->get_cart_contents_count() );
// Check that there are no error notices.
$this->assertArrayNotHasKey( 'error', $notices );
// Add variation using parent id.
WC()->cart->add_to_cart(
$product->get_id(),
@ -2088,10 +2091,14 @@ class WC_Tests_Cart extends WC_Unit_Test_Case {
'attribute_pa_number' => '2',
)
);
$notices = WC()->session->get( 'wc_notices', array() );
// Check that the second add to cart call increases the quantity of the existing cart-item.
$this->assertCount( 1, WC()->cart->get_cart_contents() );
$this->assertEquals( 2, WC()->cart->get_cart_contents_count() );
// Check that there are no error notices.
$this->assertArrayNotHasKey( 'error', $notices );
}
/**