@@ -296,6 +296,34 @@ public function test_is_wcpay_frt_review_feature_active_returns_true() {
296296 $ this ->clear_feature_flag_options ( [ 'wcpay_frt_review_feature_active ' ] );
297297 }
298298
299+ public function test_is_tokenized_cart_ece_enabled_returns_true_when_site_flag_is_true () {
300+ $ this ->mock_cache ->method ( 'get ' )->willReturn ( [] );
301+ $ this ->set_feature_flag_option ( '_wcpay_feature_tokenized_cart_ece ' , '1 ' );
302+ $ this ->assertTrue ( WC_Payments_Features::is_tokenized_cart_ece_enabled () );
303+ $ this ->clear_feature_flag_options ( [ '_wcpay_feature_tokenized_cart_ece ' ] );
304+ }
305+
306+ public function test_is_tokenized_cart_ece_enabled_returns_false_when_site_flag_is_false () {
307+ $ this ->mock_cache ->method ( 'get ' )->willReturn ( [] );
308+ $ this ->set_feature_flag_option ( '_wcpay_feature_tokenized_cart_ece ' , '0 ' );
309+ $ this ->assertFalse ( WC_Payments_Features::is_tokenized_cart_ece_enabled () );
310+ $ this ->clear_feature_flag_options ( [ '_wcpay_feature_tokenized_cart_ece ' ] );
311+ }
312+
313+ public function test_is_tokenized_cart_ece_enabled_returns_false_when_account_flag_is_true () {
314+ $ this ->mock_cache ->method ( 'get ' )->willReturn ( [ 'is_tokenized_ece_disabled ' => true ] );
315+ $ this ->set_feature_flag_option ( '_wcpay_feature_tokenized_cart_ece ' , '1 ' );
316+ $ this ->assertFalse ( WC_Payments_Features::is_tokenized_cart_ece_enabled () );
317+ $ this ->clear_feature_flag_options ( [ '_wcpay_feature_tokenized_cart_ece ' ] );
318+ }
319+
320+ public function test_is_tokenized_cart_ece_enabled_returns_true_when_account_flag_is_false () {
321+ $ this ->mock_cache ->method ( 'get ' )->willReturn ( [ 'is_tokenized_ece_disabled ' => false ] );
322+ $ this ->set_feature_flag_option ( '_wcpay_feature_tokenized_cart_ece ' , '1 ' );
323+ $ this ->assertTrue ( WC_Payments_Features::is_tokenized_cart_ece_enabled () );
324+ $ this ->clear_feature_flag_options ( [ '_wcpay_feature_tokenized_cart_ece ' ] );
325+ }
326+
299327 public function test_is_frt_review_feature_active_returns_false_when_flag_is_not_set () {
300328 $ this ->assertFalse ( WC_Payments_Features::is_frt_review_feature_active () );
301329 }
0 commit comments