You are here

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

@covers ::addEvent

Asserts usage of Private Temp Store for events queue.

File

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

Class

EventStorageServiceTest
@coversDefaultClass \Drupal\commerce_google_tag_manager\EventStorageService

Namespace

Drupal\Tests\commerce_google_tag_manager\Kernel

Code

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