Fixture
class Fixture
Constants
| protected FIXTURE_EXTENSION |
The fixture extension. |
Properties
| protected null|array<string, mixed> | $merge | Data merged into the mocked response body. |
|
| protected null|Closure(array<string, mixed>): array<string, mixed> | $through | The response body transformer. |
|
| protected ArrayRepository | $context | The fixture context. |
|
| protected Filesystem | $files | The filesystem used by the fixture. |
Methods
Create a fixture.
Load the mock response from the fixture.
Get the absolute fixture path.
Define the fixture name.
Redact sensitive response body patterns.
Define sensitive response headers.
Define sensitive JSON attributes.
Define sensitive response body patterns.
Get fixture context or a single context value.
Set a fixture context value.
Merge fixture context values.
Resolve the Saloon manager.
Details
at line 51
__construct(string $name = '', Filesystem|null $files = null, ArrayRepository|null $context = null)
Create a fixture.
at line 66
Fixture
merge(array $merge = [])
Merge data into the mocked response body.
at line 89
MockResponse|null
getMockResponse()
Load the mock response from the fixture.
at line 140
Fixture
store(RecordedResponse $recordedResponse)
Store a recorded response as the fixture.
at line 163
string
getFixturePath()
Get the absolute fixture path.
at line 191
protected string
defineName()
Define the fixture name.
at line 199
protected RecordedResponse
swapSensitiveHeaders(RecordedResponse $recordedResponse)
Redact sensitive headers.
at line 221
protected RecordedResponse
swapSensitiveJson(RecordedResponse $recordedResponse)
Redact sensitive JSON values.
at line 250
protected RecordedResponse
swapSensitiveBodyWithRegex(RecordedResponse $recordedResponse)
Redact sensitive response body patterns.
at line 271
protected array
defineSensitiveHeaders()
Define sensitive response headers.
Rules apply to each value of a matching header.
at line 281
protected array
defineSensitiveJsonParameters()
Define sensitive JSON attributes.
at line 291
protected array
defineSensitiveRegexPatterns()
Define sensitive response body patterns.
at line 299
protected RecordedResponse
beforeSave(RecordedResponse $recordedResponse)
Prepare a recorded response before storage.
at line 309
mixed
getContext(string|null $key = null)
Get fixture context or a single context value.
at line 319
Fixture
setContext(string $key, mixed $value)
Set a fixture context value.
at line 332
Fixture
withContext(array $context)
Merge fixture context values.
at line 342
protected SaloonManager
manager()
Resolve the Saloon manager.