public function EventTrackerServiceTest::testProductImpressions in Commerce Google Tag Manager 8.2
Same name and namespace in other branches
- 8 tests/src/Unit/EventTrackerServiceTest.php \Drupal\Tests\commerce_google_tag_manager\Unit\EventTrackerServiceTest::testProductImpressions()
@covers ::productImpressions
@dataProvider productVariationProvider
File
- tests/
src/ Unit/ EventTrackerServiceTest.php, line 76
Class
- EventTrackerServiceTest
- Tests for the EventTracker service.
Namespace
Drupal\Tests\commerce_google_tag_manager\UnitCode
public function testProductImpressions($product_variation, $product_data) {
$this->eventStorage
->expects($this
->once())
->method('addEvent')
->with([
'event' => EventTrackerService::EVENT_PRODUCT_IMPRESSIONS,
'ecommerce' => [
'impressions' => [
array_merge($product_data, [
'list' => 'List Name',
]),
],
],
]);
$this->eventTracker
->productImpressions([
$product_variation,
], 'List Name');
}