예제 #1
0
 /**
  * Test set/is a token as default.
  * @since 2.6.0
  */
 public function test_wc_payment_token_is_default()
 {
     $token = new WC_Payment_Token_Stub();
     $token->set_default(true);
     $this->assertTrue($token->is_default());
     $token->set_default(false);
     $this->assertFalse($token->is_default());
 }
예제 #2
0
 /**
  * Test is_default.
  * @since 2.6.0
  */
 public function test_wc_payment_token_is_default_returns_correct_state()
 {
     $token = new \WC_Payment_Token_Stub(1, array('is_default' => true));
     $this->assertTrue($token->is_default());
     $token = new \WC_Payment_Token_Stub(1);
     $this->assertFalse($token->is_default());
     $token = new \WC_Payment_Token_Stub(1, array('is_default' => false));
     $this->assertFalse($token->is_default());
 }