trait InteractsWithFakeImages

Properties

protected FakeImageGateway|null $fakeImageGateway

The fake image gateway instance.

protected array $recordedImageGenerations

All of the recorded image generations.

protected array $recordedQueuedImageGenerations

All of the recorded image generations that were queued.

Methods

fakeImages(Closure|array $responses = [])

Fake image generation.

assertImageGenerated(Closure $callback)

Assert that an image was generated matching a given truth test.

assertImageNotGenerated(Closure $callback)

Assert that an image was not generated matching a given truth test.

assertNoImagesGenerated()

Assert that no images were generated.

assertImageQueued(Closure $callback)

Assert that a queued image generation was recorded matching a given truth test.

assertImageNotQueued(Closure $callback)

Assert that a queued image generation was not recorded matching a given truth test.

assertNoImagesQueued()

Assert that no queued image generations were recorded.

bool
imagesAreFaked()

Determine if image generation is faked.

fakeImageGateway()

Get the fake image gateway.

Details

at line 37
FakeImageGateway fakeImages(Closure|array $responses = [])

Fake image generation.

On the shared manager, the fake gateway affects every request.

Parameters

Closure|array $responses

Return Value

FakeImageGateway

at line 48
InteractsWithFakeImages recordImageGeneration(ImagePrompt|QueuedImagePrompt $prompt)

Record an image generation.

Recorded prompts remain on the worker-shared manager.

Parameters

ImagePrompt|QueuedImagePrompt $prompt

Return Value

InteractsWithFakeImages

at line 63
InteractsWithFakeImages assertImageGenerated(Closure $callback)

Assert that an image was generated matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeImages

at line 76
InteractsWithFakeImages assertImageNotGenerated(Closure $callback)

Assert that an image was not generated matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeImages

at line 89
InteractsWithFakeImages assertNoImagesGenerated()

Assert that no images were generated.

at line 102
InteractsWithFakeImages assertImageQueued(Closure $callback)

Assert that a queued image generation was recorded matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeImages

at line 115
InteractsWithFakeImages assertImageNotQueued(Closure $callback)

Assert that a queued image generation was not recorded matching a given truth test.

Parameters

Closure $callback

Return Value

InteractsWithFakeImages

at line 128
InteractsWithFakeImages assertNoImagesQueued()

Assert that no queued image generations were recorded.

at line 143
bool imagesAreFaked()

Determine if image generation is faked.

Return Value

bool

at line 151
FakeImageGateway|null fakeImageGateway()

Get the fake image gateway.

Return Value

FakeImageGateway|null