Skip to content

Releases: Codeception/module-rest

2.0.0

07 Dec 05:27
da2666b
Compare
Choose a tag to compare

What's Changed

  • PHP 7.4 or higher is required.
  • Updated code base to PHP 7.4 by @TavoNiievez in #57 and #65

Full Changelog: 1.4.2...2.0.0

Added JSON check to `AsJson`

18 Nov 19:12
Compare
Choose a tag to compare

Added seeResponseIsJson() to send*AsJson actions

AsJson Step Decorator

17 Nov 12:52
Compare
Choose a tag to compare

Step descorator AsJson was introduced to simplify sending and parsing JSON requests and responses.
Add it to suite configuration:

actor: ApiTester
step_decorators:
    - \Codeception\Step\AsJson

or if you use API template:

suites:
    api:
        actor: ApiTester
        step_decorators:
            - \Codeception\Step\AsJson

Rebuild actions:

./vendor/bin/codecept build

And you get new actions:

  • sendPostAsJson
  • sendGetAsJson

... basically all send* methods will receive AsJson pair which sends request in JSON and returns parsed response:

<?php
$user = $I->sendPostAsJson('user', ['id' => 1]);
codecept_debug($user['id'])
$I->assertEquals(1, $user['id'])

return response on send* actions

17 Nov 10:52
Compare
Choose a tag to compare

send* actions were updated to return a response:

$response = $I->sendGet('/users');
$response = $I->sendPost('/users', ['name' => 'jon']);
$response = $I->sendPut('/users/1', ['name' => 'jon']);
$response = $I->sendPatch('/users/1', ['name' => 'jon']);
$response = $I->sendDelete('/users/1');
$response = $I->send('PATCH','/users/1', ['name' => 'jon']);

1.3.2

08 Oct 09:37
2f35e75
Compare
Choose a tag to compare

DELETE method sends request body

23 Apr 09:02
293a010
Compare
Choose a tag to compare

Revert change implemented in 1.3.0

1.3.0

08 Apr 08:28
2cd9901
Compare
Choose a tag to compare
  • Add generic send method taking HTTP method as parameter
  • Don't send request body with DELETE and OPTIONS requests
  • Validate url and params parameters of all send methods
  • Document that sendPost, sendPut, sendPatch methods accept string and JsonSerializable as params too
  • Other documentation improvements

1.2.8

02 Mar 06:51
4c8c6bd
Compare
Choose a tag to compare

Append query params to URL for HEAD requests

Fix deprecation error

04 Nov 17:06
beeb5a9
Compare
Choose a tag to compare
  • Replaced deprecated JsonPath data() method with getData #37 by @SoftCreatR

softcreatr/jsonpath

03 Nov 07:11
77cba3d
Compare
Choose a tag to compare
  • Replace flow/jsonpath with softcreatr/jsonpath (#35)