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 135
Fixture
store(RecordedResponse $recordedResponse)
Store a recorded response as the fixture.
at line 153
string
getFixturePath()
Get the absolute fixture path.
at line 181
protected string
defineName()
Define the fixture name.
at line 189
protected RecordedResponse
swapSensitiveHeaders(RecordedResponse $recordedResponse)
Redact sensitive headers.
at line 210
protected RecordedResponse
swapSensitiveJson(RecordedResponse $recordedResponse)
Redact sensitive JSON values.
at line 239
protected RecordedResponse
swapSensitiveBodyWithRegex(RecordedResponse $recordedResponse)
Redact sensitive response body patterns.
at line 258
protected array
defineSensitiveHeaders()
Define sensitive response headers.
at line 268
protected array
defineSensitiveJsonParameters()
Define sensitive JSON attributes.
at line 278
protected array
defineSensitiveRegexPatterns()
Define sensitive response body patterns.
at line 286
protected RecordedResponse
beforeSave(RecordedResponse $recordedResponse)
Prepare a recorded response before storage.
at line 296
mixed
getContext(string|null $key = null)
Get fixture context or a single context value.
at line 306
Fixture
setContext(string $key, mixed $value)
Set a fixture context value.
at line 319
Fixture
withContext(array $context)
Merge fixture context values.
at line 329
protected SaloonManager
manager()
Resolve the Saloon manager.