public function PayPalPaymentECPaymentMethodUI::testUI in PayPal for Payment 7
Tests PayPalPaymentECPaymentMethodController::payment_method_configuration_form_elements_callback.
File
- paypal_payment_ec/
tests/ PayPalPaymentECPaymentMethodUI.test, line 36 - Contains \PayPalPaymentECPaymentMethodCRUD.
Class
- PayPalPaymentECPaymentMethodUI
- Tests the PayPalPaymentECPaymentMethodController UI.
Code
public function testUI() {
$controller_class_name = 'PayPalPaymentECPaymentMethodController';
$controller = payment_method_controller_load($controller_class_name);
$controller_data = array(
'capture' => $controller::CAPTURE_MANUAL,
'email_address' => 'b@b.b',
'password' => 'foobaz',
'username' => 'foobar',
'server' => $controller::NVP_API_SERVER_SANDBOX,
'signature' => 'bazqux',
) + $controller->controller_data_defaults;
$account = $this
->drupalCreateUser(array(
'payment.payment_method.create.' . $controller_class_name,
));
$this
->drupalLogin($account);
$this
->drupalPost('admin/config/services/payment/method/add/' . $controller_class_name, array(
'title_specific' => 'Foo',
'name' => 'foo',
'controller_form[authentication][email_address]' => $controller_data['email_address'],
'controller_form[authentication][password]' => $controller_data['password'],
'controller_form[authentication][signature]' => $controller_data['signature'],
'controller_form[authentication][username]' => $controller_data['username'],
'controller_form[workflow][server]' => $controller_data['server'],
'controller_form[workflow][capture]' => $controller_data['capture'],
), t('Save'));
$payment_method_loaded = entity_load_single('payment_method', 1);
$this
->assertEqual($controller_data, $payment_method_loaded->controller_data);
}