public static function assertCreatedWithClientId(
        $status,
        $contentType,
        $content,
        $location,
        string $expectedLocation,
        array $expected,
        bool $strict = true,
        string $message = ''
    ): Document
    {
        $expectedId = $expected['id'] ?? null;

        if (!$expectedId) {
            throw new \InvalidArgumentException('Expected resource hash must have an id.');
        }

        self::assertStatusCode($status, self::STATUS_CREATED, $content, $message);
        PHPUnitAssert::assertSame(
            "$expectedLocation/{$expectedId}",
            $location,
            $message ?: 'Unexpected Location header.'
        );

        return self::assertContent($contentType, $content, self::JSON_API_MEDIA_TYPE, $message)
            ->assertHash($expected, '/data', $strict, $message);
    }
public static function assertCreatedWithClientId(
        $status,
        $contentType,
        $content,
        $location,
        string $expectedLocation,
        array $expected,
        bool $strict = true,
        string $message = ''
    ): Document
    {
        $expectedId = $expected['id'] ?? null;

        if (!$expectedId) {
            throw new \InvalidArgumentException('Expected resource hash must have an id.');
        }

        self::assertStatusCode($status, self::STATUS_CREATED, $content, $message);
        PHPUnitAssert::assertSame(
            "$expectedLocation/{$expectedId}",
            $location,
            $message ?: 'Unexpected Location header.'
        );

        return self::assertContent($contentType, $content, self::JSON_API_MEDIA_TYPE, $message)
            ->assertHash($expected, '/data', $strict, $message);
    }
public static function assertCreatedWithClientId ( $ status , $ contentType , $ content , $ location , string $ expectedLocation , array $ expected , bool $ strict = true , string $ message = '' ) : Document { $ expectedId = $ expected [ 'id' ] ?? null ; if ( ! $ expectedId ) { throw new \ InvalidArgumentException ( 'Expected resource hash must have an id.' ) ; } self :: assertStatusCode ( $ status , self :: STATUS_CREATED , $ content , $ message ) ; PHPUnitAssert :: assertSame ( "$expectedLocation/{$expectedId}" , $ location , $ message ? : 'Unexpected Location header.' ) ; return self :: assertContent ( $ contentType , $ content , self :: JSON_API_MEDIA_TYPE , $ message ) -> assertHash ( $ expected , '/data' , $ strict , $ message ) ; }
Assert that a resource was created with a client generated id.

@param $status
@param $contentType
@param $content
@param $location
@param string $expectedLocation
@param array $expected
@param bool $strict
@param string $message
@return Document
Assert that a resource was created with a client generated id .