src/HttpAssert.php
public static function assertError(
        $status,
        $contentType,
        $content,
        int $expectedStatus,
        array $error = [],
        bool $strict = true,
        string $message = ''
    ): Document
    {
        $document = self::assertJsonApi($status, $contentType, $content, $expectedStatus, $message)
            ->assertNotExists('/data', $message);

        if ($error) {
            $document->assertError($error, $strict, $message);
        } else {
            $document->assertExists('/error', $message);
        }

        return $document;
    }
public static function assertError(
        $status,
        $contentType,
        $content,
        int $expectedStatus,
        array $error = [],
        bool $strict = true,
        string $message = ''
    ): Document
    {
        $document = self::assertJsonApi($status, $contentType, $content, $expectedStatus, $message)
            ->assertNotExists('/data', $message);

        if ($error) {
            $document->assertError($error, $strict, $message);
        } else {
            $document->assertExists('/error', $message);
        }

        return $document;
    }
Assert the document contains a single error that matches the supplied error.

@param $status
@param $contentType
@param $content
@param int $expectedStatus
@param array $error
@param bool $strict
@param string $message
@return Document