function PaymentTestPaymentLineItemFormElementWebTestCase::SubmitButton in Payment 7
Test the presence of widget's submit button.
2 calls to PaymentTestPaymentLineItemFormElementWebTestCase::SubmitButton()
- PaymentTestPaymentLineItemFormElementWebTestCase::testAJAXSubmission in tests/
payment_test/ tests/ PaymentTestPaymentLineItemFormElementWebTestCase.test - Test an AJAX submission.
- PaymentTestPaymentLineItemFormElementWebTestCase::testSubmission in tests/
payment_test/ tests/ PaymentTestPaymentLineItemFormElementWebTestCase.test - Test a regular submission.
File
- tests/
payment_test/ tests/ PaymentTestPaymentLineItemFormElementWebTestCase.test, line 50 - Contains class PaymentTestPaymentLineItemFormElementWebTestCase.
Class
- PaymentTestPaymentLineItemFormElementWebTestCase
- Tests the payment_line_item form element.
Code
function SubmitButton($present) {
$elements = $this
->xpath('//input[@id="payment-ajax-replace"]');
if ($present) {
$this
->assertTrue(isset($elements[0]), "Payment line item configuration widget contains an <em>Add a line item</em> button if the number if line items is less than the widget's cardinality.");
}
else {
$this
->assertFalse(isset($elements[0]), 'Payment line item configuration widget contains no <em>Add a line item</em> button.');
}
}