You are here

function PaymentTestPaymentLineItemFormElementWebTestCase::LineItemElements in Payment 7

Test the presence of widget's input elements.

2 calls to PaymentTestPaymentLineItemFormElementWebTestCase::LineItemElements()
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 38
Contains class PaymentTestPaymentLineItemFormElementWebTestCase.

Class

PaymentTestPaymentLineItemFormElementWebTestCase
Tests the payment_line_item form element.

Code

function LineItemElements($delta_max = 0) {
  for ($delta = 0; $delta <= $delta_max; $delta++) {
    foreach (array(
      'amount',
      'description',
      'name',
      'quantity',
      'tax-rate',
    ) as $name) {
      $elements = $this
        ->xpath('//input[@id="edit-line-item-container-' . $delta . '-' . $name . '"]');
      $this
        ->assertTrue(isset($elements[0]), "Payment line item configuration widget contains <em>{$name}</em> element for line item {$delta}.");
    }
  }
}