$response =
$this->
getBrowser()->
getResponse()->
getContent();
static::
assertIsString($response);
$response =
json_decode($response, true, 512, \JSON_THROW_ON_ERROR
);
static::
assertEquals(Response::HTTP_NOT_FOUND,
$this->
getBrowser()->
getResponse()->
getStatusCode());
static::
assertArrayHasKey('errors',
$response);
} public function testGetAvailableStates(): void
{ $context = Context::
createDefaultContext();
$customerId =
$this->
createCustomer($context);
$orderId =
$this->
createOrder($customerId,
$context);
$this->
getBrowser()->
request('GET', '/api/_action/state-machine/order/' .
$orderId . '/state'
);
static::
assertEquals(200,
$this->
getBrowser()->
getResponse()->
getStatusCode());
$response =
$this->
getBrowser()->
getResponse()->
getContent();
static::
assertIsString($response);
$response =
json_decode($response, true, 512, \JSON_THROW_ON_ERROR
);
static::
assertCount(2,
$response['transitions'
]);
static::
assertEquals('cancel',
$response['transitions'
][0
]['actionName'
]);