You are here

public function EventTrackerServiceTest::testCheckoutOption in Commerce Google Tag Manager 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/EventTrackerServiceTest.php \Drupal\Tests\commerce_google_tag_manager\Unit\EventTrackerServiceTest::testCheckoutOption()

@covers ::checkoutOption

@dataProvider checkoutOptionDataProvider

File

tests/src/Unit/EventTrackerServiceTest.php, line 262

Class

EventTrackerServiceTest
Tests for the EventTracker service.

Namespace

Drupal\Tests\commerce_google_tag_manager\Unit

Code

public function testCheckoutOption($step_index, $checkout_option) {
  $this->eventStorage
    ->expects($this
    ->once())
    ->method('addEvent')
    ->with([
    'event' => EventTrackerService::EVENT_CHECKOUT_OPTION,
    'ecommerce' => [
      'checkout_option' => [
        'actionField' => [
          'step' => $step_index,
          'option' => $checkout_option,
        ],
      ],
    ],
  ]);
  $this->eventTracker
    ->checkoutOption($step_index, $checkout_option);
}