class Image

Methods

of(string $prompt)

Generate an image.

fake(Closure|array $responses = [])

Fake image generation.

static void
assertGenerated(Closure $callback)

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

static void
assertNotGenerated(Closure $callback)

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

static void
assertNothingGenerated()

Assert that no images were generated.

static void
assertQueued(Closure $callback)

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

static void
assertNotQueued(Closure $callback)

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

static void
assertNothingQueued()

Assert that no queued image generations were recorded.

static bool
isFaked()

Determine if image generation is faked.

Details

at line 20
static PendingImageGeneration of(string $prompt)

Generate an image.

Parameters

string $prompt

Return Value

PendingImageGeneration

Exceptions

InvalidArgumentException

at line 30
static FakeImageGateway fake(Closure|array $responses = [])

Fake image generation.

The fake gateway is shared across requests in the worker.

Parameters

Closure|array $responses

Return Value

FakeImageGateway

at line 39
static void assertGenerated(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 47
static void assertNotGenerated(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 55
static void assertNothingGenerated()

Assert that no images were generated.

Return Value

void

at line 63
static void assertQueued(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 71
static void assertNotQueued(Closure $callback)

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

Parameters

Closure $callback

Return Value

void

at line 79
static void assertNothingQueued()

Assert that no queued image generations were recorded.

Return Value

void

at line 87
static bool isFaked()

Determine if image generation is faked.

Return Value

bool