You are here

public function EventStorageServiceTest::testAddEventFifoQueue 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::testAddEventFifoQueue()

@covers ::addEvent

Asserts the events queue follows the FIFO (First in First out) pattern.

File

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

Class

EventStorageServiceTest
@coversDefaultClass \Drupal\commerce_google_tag_manager\EventStorageService

Namespace

Drupal\Tests\commerce_google_tag_manager\Kernel

Code

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