ApiTest

TestOptions
in package

Class TestOptions

Contains configuration options for API endpoint testing.

Table of Contents

Properties

$contentRequired  : bool
Indicates whether content is required in the response body.
$errorExpected  : bool
Indicates whether an HTTP error or an 'error' response field is expected. Transport failures without a response are always rethrown.
$guzzleAdditionalOptions  : null|array<string, mixed>
Additional Guzzle options to be included.
$requestDataType  : null|string
The data type for the request.
$tryBasicAsserts  : bool
Indicates whether included basic asserts should be tried.
$userAgent  : string
The user agent for the request.

Methods

__construct()  : mixed
TestOptions constructor.

Properties

$contentRequired

Indicates whether content is required in the response body.

public bool $contentRequired = true

$errorExpected

Indicates whether an HTTP error or an 'error' response field is expected. Transport failures without a response are always rethrown.

public bool $errorExpected = false

$guzzleAdditionalOptions

Additional Guzzle options to be included.

public null|array<string, mixed> $guzzleAdditionalOptions = null

The headers option must be an array or null.

$requestDataType

The data type for the request.

public null|string $requestDataType = null

Can be one of the following values: 'body', 'form_params', 'json', 'multipart'.

$tryBasicAsserts

Indicates whether included basic asserts should be tried.

public bool $tryBasicAsserts = true

$userAgent

The user agent for the request.

public string $userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) ' . 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 ' . 'Safari/537.36'

Methods

__construct()

TestOptions constructor.

public __construct() : mixed

Initializes the API options with default values.

On this page

Search results