References ApiTestAssertionsTrait
Reference
T
Trait

ApiPlatform\Symfony\Bundle\Test\ApiTestAssertionsTrait

See also

Methods

assertJsonContains

Asserts that the retrieved JSON contains the specified subset.This method delegates to static::assertArraySubset().

public assertJsonContains(array|string $subset, bool $checkForObjectIdentity, string $message): null

Parameters

subsetarray
string
checkForObjectIdentitybool
messagestring

Returns

null

assertJsonEquals

Asserts that the retrieved JSON is equal to $json.Both values are canonicalized before the comparison.

public assertJsonEquals(array|string $json, string $message): null

Parameters

jsonarray
string
messagestring

Returns

null

assertArraySubset

Asserts that an array has a specified subset.Imported from dms/phpunit-arraysubset, because the original constraint has been deprecated.

public assertArraySubset(iterable $subset, iterable $array, bool $checkForObjectIdentity, string $message): null

Parameters

subsetiterable
arrayiterable
checkForObjectIdentitybool
messagestring

Returns

null

See also

assertMatchesJsonSchema

public assertMatchesJsonSchema(object|array|string $jsonSchema, null|int $checkMode, string $message): null

Parameters

jsonSchemaobject
array
string
checkModeint
messagestring

Returns

null

assertMatchesResourceCollectionJsonSchema

public assertMatchesResourceCollectionJsonSchema(string $resourceClass, null|string $operationName, string $format, null|array $serializationContext): null

Parameters

resourceClassstring
operationNamestring
formatstring
serializationContextarray

Returns

null

assertMatchesResourceItemJsonSchema

public assertMatchesResourceItemJsonSchema(string $resourceClass, null|string $operationName, string $format, null|array $serializationContext): null

Parameters

resourceClassstring
operationNamestring
formatstring
serializationContextarray

Returns

null

getMercureMessages

public getMercureMessages(null|string $hubName): array<int, Symfony\Component\Mercure\Update>

Parameters

hubNamestring

Returns

array<int, Symfony\Component\Mercure\Update>

getMercureMessage

public getMercureMessage(int $index, null|string $hubName): Symfony\Component\Mercure\Update

Parameters

indexint
hubNamestring

Returns

Symfony\Component\Mercure\Update

assertMercureUpdateMatchesJsonSchema

public assertMercureUpdateMatchesJsonSchema(Symfony\Component\Mercure\Update $update, array $topics, object|array|string $jsonSchema, bool $private, null|string $id, null|string $type, null|int $retry, string $message): null

Parameters

updateSymfony\Component\Mercure\Update
topicsarray
jsonSchemaobject
array
string
privatebool
idstring
typestring
retryint
messagestring

Returns

null

getMercureRegistry

public getMercureRegistry(): Symfony\Component\Mercure\HubRegistry

Returns

Symfony\Component\Mercure\HubRegistry

getMercureHub

public getMercureHub(null|string $name): Symfony\Component\Mercure\Debug\TraceableHub

Parameters

namestring

Returns

Symfony\Component\Mercure\Debug\TraceableHub

assertResponseIsSuccessful

public assertResponseIsSuccessful(string $message): null

Parameters

messagestring

Returns

null

assertResponseStatusCodeSame

public assertResponseStatusCodeSame(int $expectedCode, string $message): null

Parameters

expectedCodeint
messagestring

Returns

null

assertResponseFormatSame

public assertResponseFormatSame(null|string $expectedFormat, string $message): null

Parameters

expectedFormatstring
messagestring

Returns

null

assertResponseRedirects

public assertResponseRedirects(null|string $expectedLocation, null|int $expectedCode, string $message): null

Parameters

expectedLocationstring
expectedCodeint
messagestring

Returns

null

assertResponseHasHeader

public assertResponseHasHeader(string $headerName, string $message): null

Parameters

headerNamestring
messagestring

Returns

null

assertResponseNotHasHeader

public assertResponseNotHasHeader(string $headerName, string $message): null

Parameters

headerNamestring
messagestring

Returns

null

assertResponseHeaderSame

public assertResponseHeaderSame(string $headerName, string $expectedValue, string $message): null

Parameters

headerNamestring
expectedValuestring
messagestring

Returns

null

assertResponseHeaderNotSame

public assertResponseHeaderNotSame(string $headerName, string $expectedValue, string $message): null

Parameters

headerNamestring
expectedValuestring
messagestring

Returns

null

assertResponseHasCookie

public assertResponseHasCookie(string $name, string $path, null|string $domain, string $message): null

Parameters

namestring
pathstring
domainstring
messagestring

Returns

null

assertResponseNotHasCookie

public assertResponseNotHasCookie(string $name, string $path, null|string $domain, string $message): null

Parameters

namestring
pathstring
domainstring
messagestring

Returns

null

assertResponseCookieValueSame

public assertResponseCookieValueSame(string $name, string $expectedValue, string $path, null|string $domain, string $message): null

Parameters

namestring
expectedValuestring
pathstring
domainstring
messagestring

Returns

null

assertResponseIsUnprocessable

public assertResponseIsUnprocessable(string $message): null

Parameters

messagestring

Returns

null

assertBrowserHasCookie

public assertBrowserHasCookie(string $name, string $path, null|string $domain, string $message): null

Parameters

namestring
pathstring
domainstring
messagestring

Returns

null

assertBrowserNotHasCookie

public assertBrowserNotHasCookie(string $name, string $path, null|string $domain, string $message): null

Parameters

namestring
pathstring
domainstring
messagestring

Returns

null

assertBrowserCookieValueSame

public assertBrowserCookieValueSame(string $name, string $expectedValue, bool $raw, string $path, null|string $domain, string $message): null

Parameters

namestring
expectedValuestring
rawbool
pathstring
domainstring
messagestring

Returns

null

assertRequestAttributeValueSame

public assertRequestAttributeValueSame(string $name, string $expectedValue, string $message): null

Parameters

namestring
expectedValuestring
messagestring

Returns

null

assertRouteSame

public assertRouteSame(string $expectedRoute, array $parameters, string $message): null

Parameters

expectedRoutestring
parametersarray
messagestring

Returns

null

assertThatForResponse

public assertThatForResponse(PHPUnit\Framework\Constraint\Constraint $constraint, string $message): null

Parameters

constraintPHPUnit\Framework\Constraint\Constraint
messagestring

Returns

null

assertThatForClient

public assertThatForClient(PHPUnit\Framework\Constraint\Constraint $constraint, string $message): null

Parameters

constraintPHPUnit\Framework\Constraint\Constraint
messagestring

Returns

null

getClient

protected getClient(null|Symfony\Component\BrowserKit\AbstractBrowser $newClient): Symfony\Component\BrowserKit\AbstractBrowser

Parameters

newClientSymfony\Component\BrowserKit\AbstractBrowser

Returns

Symfony\Component\BrowserKit\AbstractBrowser

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop