You are here

public function OrderWorkflowTest::testOrderCancellation in Commerce Shipping 8.2

Tests the order cancellation.

File

tests/src/Kernel/OrderWorkflowTest.php, line 85

Class

OrderWorkflowTest
Tests the interaction between order and shipping workflows.

Namespace

Drupal\Tests\commerce_shipping\Kernel

Code

public function testOrderCancellation() {
  $transitions = $this->order
    ->getState()
    ->getTransitions();
  $this->order
    ->getState()
    ->applyTransition($transitions['cancel']);
  $this->order
    ->save();
  $shipment = $this
    ->reloadEntity($this->shipment);
  $this
    ->assertEquals('canceled', $shipment
    ->getState()->value, 'The shipment has been correctly canceled.');
}