You are here

public function PayPalPaymentECPaymentMethodControllerTest::testloadAuthentication in PayPal for Payment 7

Tests loadAuthentication().

File

paypal_payment_ec/tests/PayPalPaymentECPaymentMethodControllerTest.test, line 46
Contains \PayPalPaymentECPaymentMethodControllerTest.

Class

PayPalPaymentECPaymentMethodControllerTest
Tests payment execution.

Code

public function testloadAuthentication() {
  $controller = payment_method_controller_load('PayPalPaymentECPaymentMethodController');
  $token = new PayPalPaymentECAuthentication('foo', time(), 1);
  $controller
    ->saveAuthentication($token);
  $token_loaded = $controller
    ->loadAuthentication($token->pid);
  $this
    ->assertTrue($token_loaded instanceof PayPalPaymentECAuthentication);
  $this
    ->assertEqual((array) $token_loaded, (array) $token);

  // @todo Test token expiry.
}