src/HttpAssert.php
public static function assertCreatedWithServerId(
        $status,
        $contentType,
        $content,
        $location,
        string $expectedLocation,
        array $expected,
        bool $strict = true,
        string $message = ''
    ): Document
    {
        self::assertStatusCode($status, self::STATUS_CREATED, $content, $message);
        $document = self::assertServerGeneratedId($contentType, $content, $expected, $strict, $message);
        $id = $document->get('/data/id');

        PHPUnitAssert::assertNotEmpty($id, $message ?: 'Expecting content to contain a resource id.');
        $expectedLocation = rtrim($expectedLocation, '/') . '/' . $id;
        PHPUnitAssert::assertSame($expectedLocation, $location, $message ?: 'Unexpected Location header.');

        return $document;
    }
public static function assertCreatedWithServerId(
        $status,
        $contentType,
        $content,
        $location,
        string $expectedLocation,
        array $expected,
        bool $strict = true,
        string $message = ''
    ): Document
    {
        self::assertStatusCode($status, self::STATUS_CREATED, $content, $message);
        $document = self::assertServerGeneratedId($contentType, $content, $expected, $strict, $message);
        $id = $document->get('/data/id');

        PHPUnitAssert::assertNotEmpty($id, $message ?: 'Expecting content to contain a resource id.');
        $expectedLocation = rtrim($expectedLocation, '/') . '/' . $id;
        PHPUnitAssert::assertSame($expectedLocation, $location, $message ?: 'Unexpected Location header.');

        return $document;
    }
Assert that a resource was created with a server generated id.

@param $status
@param $contentType
@param $content
@param $location
@param string $expectedLocation
the expected location without the id.
@param array $expected
@param bool $strict
@param string $message
@return Document