You are here

public function OrderStatusUpdateEventTest::testOrderStatusUpdateEvent in Ubercart 8.4

Tests the event metadata.

File

uc_order/tests/src/Unit/Integration/Event/OrderStatusUpdateEventTest.php, line 19

Class

OrderStatusUpdateEventTest
Checks that the event "uc_order_status_update" is correctly defined.

Namespace

Drupal\Tests\uc_order\Unit\Integration\Event

Code

public function testOrderStatusUpdateEvent() {

  // Verify our event is discoverable.
  $event = $this->eventManager
    ->createInstance('uc_order_status_update');
  $original_order_context_definition = $event
    ->getContextDefinition('original_order');
  $this
    ->assertSame('entity:uc_order', $original_order_context_definition
    ->getDataType());
  $this
    ->assertSame('Original order', $original_order_context_definition
    ->getLabel());
  $order_context_definition = $event
    ->getContextDefinition('order');
  $this
    ->assertSame('entity:uc_order', $order_context_definition
    ->getDataType());
  $this
    ->assertSame('Updated order', $order_context_definition
    ->getLabel());
}