You are here

public function EventStorageServiceTest::testAddEventSameSkipped in Commerce Google Tag Manager 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/EventStorageServiceTest.php \Drupal\Tests\commerce_google_tag_manager\Kernel\EventStorageServiceTest::testAddEventSameSkipped()

@covers ::addEvent

Asserts strictly same event aren't added twice in the events queue.

File

tests/src/Kernel/EventStorageServiceTest.php, line 176

Class

EventStorageServiceTest
@coversDefaultClass \Drupal\commerce_google_tag_manager\EventStorageService

Namespace

Drupal\Tests\commerce_google_tag_manager\Kernel

Code

public function testAddEventSameSkipped() {
  $this->eventStorage
    ->addEvent($this->detailEvent);
  $this->eventStorage
    ->addEvent($this->detailEvent);
  $events = $this->tempStore
    ->get('events');
  $this
    ->assertSame([
    '0e05cdf318b5832a7caf62ad11d386f4' => $this->detailEvent,
  ], $events);
}