diff --git a/guides/10-APITesting.md b/guides/10-APITesting.md index b282d21e9..2ac7b7f17 100644 --- a/guides/10-APITesting.md +++ b/guides/10-APITesting.md @@ -136,7 +136,8 @@ $response = $I->send('TRACE', '/posts'); If API endpoint accepts JSON you can use `send` methods with `AsJson` suffix to convert data automatically. In this case `Content-Type` header is sent with `application/json` value and response if JSON is parsed: -```php$I->sendPostAsJson('/users', ['name' => 'old name']); +```php +$I->sendPostAsJson('/users', ['name' => 'old name']); $users = $I->sendGetAsJson('/users'); $I->sendPutAsJson('/users/' . $users[0]['id'], ['name' => 'new name']); $I->sendDeleteAsJson('/users/' . $users[1]['id']);