You are here

public function PayPalPaymentIPNControllerTest::testSave in PayPal for Payment 7

Tests save().

File

paypal_payment_ipn/tests/PayPalPaymentIPNControllerTest.test, line 35
Contains \PayPalPaymentIPNControllerTest.

Class

PayPalPaymentIPNControllerTest
Tests PayPalPaymentIPNController functionality.

Code

public function testSave() {
  $ipn_variables = $this
    ->mockIPNVariables(9);

  // Test inserting an IPN.
  $ipn = new PayPalPaymentIPN($ipn_variables);
  PayPalPaymentIPNController::save($ipn);
  $this
    ->assertTrue($this
    ->IPNExists($ipn), 'All IPN properties were inserted correctly.');

  // Test updating an IPN.
  $ipn = new PayPalPaymentIPN($ipn_variables);
  $ipn->pid = 7;
  PayPalPaymentIPNController::save($ipn);
  $this
    ->assertTrue($this
    ->IPNExists($ipn), 'All IPN properties were updated correctly.');
}