You are here

protected function MolliePaymentOffsiteFormTest::helperGotoCheckoutAndProceedPayment in Commerce Mollie 8

Go to checkout, proceed payment (go to Mollie).

5 calls to MolliePaymentOffsiteFormTest::helperGotoCheckoutAndProceedPayment()
MolliePaymentOffsiteFormTest::testMolliePaymentStatusCanceled in tests/src/Functional/MolliePaymentOffsiteFormTest.php
Tests MOLLIE payment with CANCELED status.
MolliePaymentOffsiteFormTest::testMolliePaymentStatusExpired in tests/src/Functional/MolliePaymentOffsiteFormTest.php
Tests MOLLIE payment with EXPIRED status.
MolliePaymentOffsiteFormTest::testMolliePaymentStatusFailed in tests/src/Functional/MolliePaymentOffsiteFormTest.php
Tests MOLLIE payment with FAILED status.
MolliePaymentOffsiteFormTest::testMolliePaymentStatusOpen in tests/src/Functional/MolliePaymentOffsiteFormTest.php
Tests MOLLIE payment with OPEN status.
MolliePaymentOffsiteFormTest::testMolliePaymentStatusPaid in tests/src/Functional/MolliePaymentOffsiteFormTest.php
Tests MOLLIE payment with PAID status.

File

tests/src/Functional/MolliePaymentOffsiteFormTest.php, line 355

Class

MolliePaymentOffsiteFormTest
Tests the checkout form that initializes a payment.

Namespace

Drupal\Tests\commerce_mollie\Functional

Code

protected function helperGotoCheckoutAndProceedPayment() {
  $cart_link = $this
    ->getSession()
    ->getPage()
    ->findLink('your cart');
  $cart_link
    ->click();
  $this
    ->submitForm([], 'Checkout');
  $this
    ->assertSession()
    ->pageTextContains('Order Summary');
  $this
    ->submitForm([
    'payment_information[billing_information][address][0][address][given_name]' => 'Johnny',
    'payment_information[billing_information][address][0][address][family_name]' => 'Appleseed',
    'payment_information[billing_information][address][0][address][address_line1]' => '123 New York Drive',
    'payment_information[billing_information][address][0][address][locality]' => 'New York City',
    'payment_information[billing_information][address][0][address][administrative_area]' => 'NY',
    'payment_information[billing_information][address][0][address][postal_code]' => '10001',
  ], 'Continue to review');
  $this
    ->assertSession()
    ->pageTextContains('Contact information');
  $this
    ->assertSession()
    ->pageTextContains($this->loggedInUser
    ->getEmail());
  $this
    ->assertSession()
    ->pageTextContains('Payment information');
  $this
    ->assertSession()
    ->pageTextContains('Order Summary');
  $this
    ->submitForm([], 'Pay and complete purchase');
}