NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #3814 most downloaded on Packagist
PHPUnit test helpers to check JSON API documents.
Last release 6 months ago
02 Apr 2026
Ships fairly regularly
a new release about every 6 months
Nearly every release is documented
notes for 25 of 25 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
26 releases · first in 2017
Package now supports PHPUnit 13.
Package now supports Laravel 13.
Package now supports PHPUnit 12.
One column per quarter.
Package now requires illuminate/support 11 or 12.
illuminate/support 11 or 12.Remove PHP 8.4 deprecation notices
Remove PHP 8.4 deprecation notices
Package is now licensed under the MIT License.
illuminate/support 10 or 11, dropping support for 9.8.2.PHPUnit 10 and drop old PHP, PHPUnit and Laravel versions.
PHPUnit 10 and drop old PHP, PHPUnit and Laravel versions.
Package now supports Laravel 10 and PHP 8.2.
improvements. Refer to changelog for details.
improvements. Refer to changelog for details.
Carbon
dates, the developer previously had to manually call $date->jsonSerialize() to put the expected JSON string value
in their expected resource arrays. This also fixes a bug where the assertions failed to correctly compare floats that
encoded to integers in JSON - e.g. 4.0 encodes as 4 but the assertion failed as it was attempting to compare a
float to a decoded integer.assertStatusCode method now expects the status code to be an integer. Previously it allowed
strings.assertIncluded method type-hint for the expected value has changed from array to iterable.IdentifiersInDocument constraint IdentifiersInOrder. In addition, this now extends the
SubsetsInOrder constraint, rather than the SubsetInDocument constraint.HasHttpAssertions trait now does not throw an exception for its getExpectedType() method if the expected
string is empty. Instead an exception is thrown from the JsonObject method that casts an id value to a resource
identifier if the expected type is empty. This is an improvement because it means an expected type only needs to be
set if you are using a UrlRoutable, int or string value for an assertion. Previously an exception would be
thrown stating that an expected type needed to be set even if the expected type did not need to be used, e.g. if using
an array value that had the type key set.Assert::assertExactListInOrder assertion. Use Assert::assertExact instead.HasDocumentAssertions::assertExactListInOrder assertion, which means it is also removed from the
Document class. Use assertExact instead.Compare class and the HasHttpAssertions trait. The Utils\JsonObject and
Utils\JsonStack classes should be used instead:
identifiers()identifier()identifiable()assertDeleted() - use assertNoContent() or assertMetaWithoutData() depending on your expected response.assertUpdated() - use assertNoContent() or assertFetchedOne() depending on your expected response.HttpMessage class previously delegated methods calls to the Document class if the method did not exist on the
message. This was not actually in use and unnecessarily increased the complexity of the messsage class. It has
therefore been removed. Call methods directly on the document if needed.Minor improvements, refer to changelog for details.
Minor improvements, refer to changelog for details.
assertMetaWithoutData and
assertExactMetaWithoutData assertions now assert a successful HTTP status code. Previously they were expecting
200 OK though this is too restrictive for a meta-only response. However, the assertions will continue to fail for
204 No Content responses because they are expecting the response to have content.Location header passed to the
assertCreatedWithClientId assertion can now include the expected resource id. Previously the expected header value
had to be passed without the id.The assertCreatedWithServerId, assertCreatedWithClientId and assertCreatedNoContent methods will now fail with a better assertion message if the Locat
assertCreatedWithServerId, assertCreatedWithClientId and assertCreatedNoContent methods will now fail with a
better assertion message if the Location header is missing.assertDoesntHaveIncluded assertion to assert that the JSON:API document does not have the top-level included
member.assertDoesntHaveMeta assertion to assert the JSON:API document does not have the top-level meta member.assertDoesntHaveLinks assertion to assert the JSON:API document does not have the top-level links member.assertFetchedManyInOrder assertion did not work if the expected data was an empty array.assertFetchedToMany and assertFetchedToManyInOrder assertions did not work if the expected data was an empty
array.The following methods are deprecated and will be removed in 4.0:
7.4.8.0.9.0.assertCreatedWithServerId() and assertCreatedWithClientId() can now be null, indicating that the Location
header is not expected.4.0:
assertDeleted() - use assertNoContent() or assertMetaWithoutData() depending on your expected response.assertUpdated() - use assertNoContent() or assertFetchedOne() depending on your expected response.### Added - Package now supports PHP 8.
Package now supports Laravel 8.
Package now supports PHP Unit 9.
Package now supports Laravel 7.
Minimum illuminate/support version is now 5.8 (previously 5.5).
illuminate/support version is now 5.8 (previously 5.5).7.5 (previously 6.0).assertNoContent() method from the Concerns\HasHttpAssertions trait. Unlike other assertion methods in
that trait, this method refers to a HTTP status description which means it is likely to collide with assertions
provided by frameworks. For example, Laravel 6.1.0 introduced an assertNoContent() method to its test response
which is not compatible with the implementation provided by this package.Package now supports Laravel 6.
Package now supports PHPUnit 8.
### Added - #3 Can now assert exact errors on a document and HTTP message. - #5 Can now assert a server generated id with a known id. ### Fixed - #6 F
New implementation using constraint classes. Assertions are now provided via the Assert and HttpAssert classes, with traits in the Concerns namespace
Assert and HttpAssert
classes, with traits in the Concerns namespace for adding these to test classes.7.1.AbstractTraversableTesterDocumentTesterErrorsTesterErrorTesterObjectTesterResourceIdentifierTesterResourceObjectsTesterResourceObjectTesterObject tester now had meta test helpers.
Now supports PHPUnit 5.7 to 7.0.
This package no longer supports PHP 5.6.
Can now assert that a resource object is one of multiple types using assertTypeIs().
assertTypeIs().data member of a document is null.data member of a document is a resource identifier.errors member.Initial commit of classes and tests brought in from cloudcreativity/json-api at 0.10.1.
Initial commit of classes and tests brought in from cloudcreativity/json-api at 0.10.1.
Your coding agent can read these notes before it upgrades. Set up the MCP server →