Greenlight

Documentation

API reference

On this page

Integration fixture API

This reference lists integration fixture definitions, contexts, resources, and sensitive values.

These signatures are the public API.

FixtureResource

Namespace: Greenlight\IntegrationFixture

JSON-safe information exposed by one orchestrator-owned integration fixture.

Ordinary values and secrets are kept separate so debug output can redact credentials. Secrets are strings and require an explicit reveal() call.

final readonly class FixtureResource

View source

from()

Creates one resource from ordinary values and secrets.

Values can contain null, integers, booleans, finite floats, UTF-8 strings, lists, and maps. Map keys must be non-empty UTF-8 strings. Values can contain up to 16 nested lists or maps below the top-level map. Secrets must map non-empty UTF-8 string keys to UTF-8 string values.

public static function from(array $values = [], #[\SensitiveParameter] array $secrets = []): self

PHPDoc:

View source

empty()

public static function empty(): self

View source

has()

public function has(string $key): bool

View source

value()

public function value(string $key): mixed

PHPDoc:

View source

string()

public function string(string $key): string

PHPDoc:

View source

int()

public function int(string $key): int

PHPDoc:

View source

float()

public function float(string $key): float

PHPDoc:

View source

bool()

public function bool(string $key): bool

PHPDoc:

View source

list()

public function list(string $key): array

PHPDoc:

View source

map()

public function map(string $key): array

PHPDoc:

View source

secret()

public function secret(string $key): SensitiveValue

PHPDoc:

View source

mergedWith()

public function mergedWith(self $channel): self

View source

__debugInfo()

public function __debugInfo(): array

PHPDoc:

View source

IntegrationFixtureContext

Namespace: Greenlight\IntegrationFixture

Supplies orchestrator-side operations while Greenlight provisions one integration fixture.

interface IntegrationFixtureContext

View source

runId()

public function runId(): string;

PHPDoc:

View source

configuredWorkers()

Returns the worker limit for the selected execution adapter. In-process execution returns one, including a fallback from process-pool execution.

public function configuredWorkers(): int;

PHPDoc:

View source

channels()

The channel numbers that can be live during this execution.

public function channels(): array;

PHPDoc:

View source

shard()

public function shard(): ?array;

PHPDoc:

View source

dependency()

Gets the shared resource or the resource for one channel.

public function dependency(string $id, ?int $channel = null): FixtureResource;

PHPDoc:

View source

defer()

Register cleanup immediately after the provisioner acquires a resource. This makes cleanup available if a later operation fails.

public function defer(\Closure $cleanup): void;

PHPDoc:

View source

expose()

Publishes shared data plus optional channel-specific overlays.

public function expose(FixtureResource $shared, array $channels = []): void;

PHPDoc:

View source

IntegrationFixtureDefinition

Namespace: Greenlight\IntegrationFixture

One orchestrator-owned integration fixture and its dependencies. IDs must remain string keys in PHP maps.

final readonly class IntegrationFixtureDefinition

View source

$id

public string $id;

PHPDoc:

View source

$dependsOn

public array $dependsOn;

PHPDoc:

View source

$provision

public \Closure $provision

View source

__construct()

Creates one fixture definition.

Each ID must be a non-empty UTF-8 string that is not an integer string. Dependency IDs must be unique.

public function __construct(
    string $id,
    public \Closure $provision,
    array $dependsOn = [],
)

PHPDoc:

View source

IntegrationResources

Namespace: Greenlight\IntegrationFixture

The integration fixtures visible to one worker channel.

A worker receives shared data merged with only its own channel data. This object does not contain data allocated only to other channels. Fixture IDs must remain string keys in PHP maps.

final readonly class IntegrationResources

View source

__construct()

public function __construct(private array $fixtures = [])

PHPDoc:

View source

empty()

public static function empty(): self

View source

has()

public function has(string $id): bool

View source

fixture()

public function fixture(string $id): FixtureResource

PHPDoc:

View source

__debugInfo()

public function __debugInfo(): array

PHPDoc:

View source

SensitiveValue

Namespace: Greenlight\IntegrationFixture

A fixture value that code must reveal explicitly.

Object dumps and exports do not include the underlying value.

final readonly class SensitiveValue

View source

__construct()

public function __construct(#[\SensitiveParameter] string $value)

View source

reveal()

public function reveal(): string

View source

__debugInfo()

public function __debugInfo(): array

PHPDoc:

View source