You are here

static function PaymentWebTestCase::paymentMethodCreate in Payment 7

Create, save, and return a PaymentMethod.

Parameters

integer $uid: The user ID of the payment method's owner.

PaymentMethodController $controller: An optional controller to set. Defaults to PaymentMethodControllerUnavailable.

Return value

PaymentMethod

6 calls to PaymentWebTestCase::paymentMethodCreate()
PaymentreferenceTestQueueWebTestCase::testQueueCRUD in modules/paymentreference/tests/paymentreference_test/tests/PaymentreferenceTestQueueWebTestCase.test
PaymentreferenceTestQueueWebTestCase::testQueueFieldImplementation in modules/paymentreference/tests/paymentreference_test/tests/PaymentreferenceTestQueueWebTestCase.test
PaymentTestActionHookAndCallbackWebTestCase::testActionHooksAndCallbacks in tests/payment_test/tests/PaymentTestActionHookAndCallbackWebTestCase.test
Test whether all action hooks and callbacks are invoked.
PaymentTestEntityCrudWebTestCase::testPaymentCRUD in tests/payment_test/tests/PaymentTestEntityCrudWebTestCase.test
Test payment CRUD functionality.
PaymentTestPaymentMethodEntityPermissionWebTestCase::testPaymentMethodEntityPermissions in tests/payment_test/tests/PaymentTestPaymentMethodEntityPermissionWebTestCase.test

... See full list

File

tests/PaymentWebTestCase.test, line 59

Class

PaymentWebTestCase
Provides reusable code for testing payments and payment methods.

Code

static function paymentMethodCreate($uid, PaymentMethodController $controller = NULL) {
  $name = self::randomName();
  $controller = $controller ? $controller : payment_method_controller_load('PaymentMethodControllerUnavailable');
  $payment_method = new PaymentMethod(array(
    'controller' => $controller,
    'controller_data' => $controller->controller_data_defaults,
    'name' => $name,
    'title' => $name,
    'uid' => $uid,
  ));
  return $payment_method;
}