Skip to content

Commit

Permalink
cookie name filter test
Browse files Browse the repository at this point in the history
  • Loading branch information
codingmusician committed Jan 8, 2025
1 parent 2eb3d55 commit 040b575
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/commerce_integration/TEC/Tickets/Commerce/CartTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,23 @@ public function test_cart_total_is_valid() {
$assertion_msg = 'Cart->get_total() should return 0 when the cart contains only free tickets.';
$this->assertEquals( 0, $cart->get_cart_total(), $assertion_msg );
}

/**
* @test
*
* @covers \TEC\Tickets\Commerce\Cart::get_cart_hash_cookie_name
*/
public function test_cart_hash_cookie_name() {
$original_cookie_name = Cart::get_cart_hash_cookie_name();
$this->assertEquals( Cart::$cart_hash_cookie_name, $original_cookie_name );

add_filter( 'tribe_tickets_commerce_cart_hash_cookie_name', function() {
return 'different_cookie_name';
} );

$different_cookie_name = Cart::get_cart_hash_cookie_name();
$this->assertEquals( 'different_cookie_name', $different_cookie_name );

$this->assertNotEquals( $original_cookie_name, $different_cookie_name );
}
}

0 comments on commit 040b575

Please sign in to comment.