Код: Выделить всё
$I->wantTo("Create new claim");
$I->haveHttpHeader('accept', 'application/json');
$I->haveHttpHeader('content-type', 'application/json; charset=utf-8');
$I->amBearerAuthenticated($I->generateCorrectToken($example['userId']));
$I->sendPostAsJson('/api/claims/', $example['json']);
$I->seeResponseCodeIsSuccessful();
$I->seeResponseIsJson();
$I->seeResponseMatchesJsonType([
'code' => 'integer',
'message' => 'string',
'status' => 'boolean',
]);
$I->seeResponseContainsJson([
'code' => 2058,
'status' => false,
'message' => 'XML не прошел валидацию',
]);
Неверный ответ JSON не содержит предоставленный JSON
- Ожидается | + Фактический @@ @@ Массив ( 'code' => 2058 'status' => false
- 'message' => 'XML �� ������ ���� �����'
- 'message' => 'XML не прошел валидацию' )
PS: codeception/codeception: 4.2.2
Подробнее здесь: https://stackoverflow.com/questions/792 ... g-to-match
Мобильная версия