You are here

public function PayPalPaymentIPNControllerTest::testDelete in PayPal for Payment 7

Tests delete().

@depends testSave

File

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

Class

PayPalPaymentIPNControllerTest
Tests PayPalPaymentIPNController functionality.

Code

public function testDelete() {
  $ipn = new PayPalPaymentIPN(array(
    'psiid' => 42,
  ));
  PayPalPaymentIPNController::save($ipn);
  PayPalPaymentIPNController::delete($ipn->psiid);
  $count = db_select('paypal_payment_ipn', 'mpi')
    ->condition('txn_id', $ipn->txn_id)
    ->countQuery()
    ->execute()
    ->fetchField();
  $this
    ->assertFalse($count, 'An IPN is deleted.');
}