You are here

public function ProductLoadEventTest::testProductLoadEvent in Ubercart 8.4

Tests the event metadata.

File

uc_product/tests/src/Unit/Integration/Event/ProductLoadEventTest.php, line 41

Class

ProductLoadEventTest
Checks that the event "uc_product_load" is correctly defined.

Namespace

Drupal\Tests\uc_product\Unit\Integration\Event

Code

public function testProductLoadEvent() {

  // Verify our event is discoverable.
  $event = $this->eventManager
    ->createInstance('uc_product_load');
  $product_context_definition = $event
    ->getContextDefinition('product');
  $this
    ->assertSame('entity:node', $product_context_definition
    ->getDataType());
  $this
    ->assertSame('Product', $product_context_definition
    ->getLabel());
}