You are here

public function PayPalPaymentECPaymentExecution::assertPaymentExecution in PayPal for Payment 7

Asserts a correct payment execution.

3 calls to PayPalPaymentECPaymentExecution::assertPaymentExecution()
PayPalPaymentECPaymentExecution::testPaymentExecutionFail in paypal_payment_ec/tests/PayPalPaymentECPaymentExecution.test
Tests payment execution using the sandbox server.
PayPalPaymentECPaymentExecution::testPaymentExecutionSuccessAutomaticCapture in paypal_payment_ec/tests/PayPalPaymentECPaymentExecution.test
Tests payment execution.
PayPalPaymentECPaymentExecution::testPaymentExecutionSuccessManualCapture in paypal_payment_ec/tests/PayPalPaymentECPaymentExecution.test
Tests payment execution.

File

paypal_payment_ec/tests/PayPalPaymentECPaymentExecution.test, line 56
Contains \PayPalPaymentECPaymentExecution.

Class

PayPalPaymentECPaymentExecution
Tests payment execution.

Code

public function assertPaymentExecution($server, $capture, $payment_status) {
  $payment_method = $this
    ->paymentMethodCreate(2, payment_method_controller_load('PayPalPaymentECPaymentMethodController'));
  $payment_method->controller_data = array(
    'capture' => $capture,
    'email_address' => 'b@b.b',
    'server' => $server,
  );
  entity_save('payment_method', $payment_method);
  $this
    ->drupalPost('paypal_payment_ec_test/form/' . $payment_method->pmid, array(), t('Pay'));
  $this
    ->assertURL('<front>');
  $pid = 1;
  $payment = entity_load_single('payment', $pid);
  $this
    ->assertEqual($payment
    ->getStatus()->status, $payment_status);
}