static function PaymentGenerate::paymentMethod in Payment 7
Generate a payment method.
Parameters
string $controller_class_name:
integer $uid:
Return value
1 call to PaymentGenerate::paymentMethod()
- PaymentTestEntityCrudWebTestCase::testPaymentMethodCRUD in tests/
payment_test/ tests/ PaymentTestEntityCrudWebTestCase.test - Test payment method CRUD functionality.
File
- ./
payment.generate.inc, line 21 - Contains functions for generating content and configuration.
Class
- PaymentGenerate
- Content and configuration generation.
Code
static function paymentMethod($controller_class_name = 'PaymentMethodControllerUnavailable', $uid = 1) {
require_once './modules/simpletest/drupal_web_test_case.php';
$name = DrupalTestCase::randomName();
$controller = payment_method_controller_load($controller_class_name);
$payment_method = new PaymentMethod(array(
'controller' => $controller,
'controller_data' => $controller->controller_data_defaults,
'name' => strtolower($name),
'title_generic' => strtoupper($name) . '-general',
'title_specific' => strtoupper($name) . '-specific',
'uid' => $uid,
));
return $payment_method;
}