WorkflowClientFake
in package
implements
WorkflowClientInterface
FinalYes
Records workflow client interactions and supplies configured test results.
Table of Contents
Interfaces
- WorkflowClientInterface
- The application-facing workflow operations implemented by Client and its test fake.
Properties
- $messages : array<int, array{workflow_id: string, stream_name: string, message_id: string, position: int, arguments: list, payload_identity: string}>
- $queries : array<int, array{workflow_id: string, name: string, arguments: list}>
- $queryResults : array<string, mixed>
- $results : array<int, string>
- $signals : array<int, array{workflow_id: string, name: string, arguments: list}>
- $starts : array<int, array{workflow_type: string, workflow_id: string, task_queue: string, input: list}>
- $updateResults : array<string, mixed>
- $updates : array<int, array{workflow_id: string, name: string, arguments: list}>
- $workflowResults : array<string, mixed>
- $workflowStreamAppendResults : array<string, WorkflowStreamAppendResult>
- $workflowStreamCloseResults : array<string, WorkflowStreamDescription>
- $workflowStreamPages : array<string, WorkflowStreamPage>
- $workflowStreams : array<string, array<int, WorkflowStreamDescription>>
Methods
- appendMessage() : array<string, mixed>
- appendWorkflowStream() : WorkflowStreamAppendResult
- assertMessageAppended() : void
- assertQueryRequested() : void
- assertResultRequested() : void
- assertSignalSent() : void
- assertUpdateRequested() : void
- assertWorkflowStarted() : void
- closeWorkflowStream() : WorkflowStreamDescription
- describeWorkflowStream() : WorkflowStreamDescription
- iterateWorkflowStream() : Generator<int, WorkflowStreamItem>
- listWorkflowStreams() : array<int, WorkflowStreamDescription>
- query() : mixed
- result() : mixed
- setQueryResult() : self
- setUpdateResult() : self
- setWorkflowResult() : self
- setWorkflowStreamAppendResult() : self
- setWorkflowStreamCloseResult() : self
- setWorkflowStreamPage() : self
- setWorkflowStreams() : self
- signal() : void
- startWorkflow() : WorkflowHandleInterface
- subscribeWorkflowStream() : WorkflowStreamPage
- update() : mixed
- workflowHandle() : WorkflowHandleInterface
- assertInteraction() : void
- configured() : mixed
- key() : string
- streamKey() : string
Properties
$messages
private
array<int, array{workflow_id: string, stream_name: string, message_id: string, position: int, arguments: list, payload_identity: string}>
$messages
= []
$queries
private
array<int, array{workflow_id: string, name: string, arguments: list}>
$queries
= []
$queryResults
private
array<string, mixed>
$queryResults
= []
$results
private
array<int, string>
$results
= []
$signals
private
array<int, array{workflow_id: string, name: string, arguments: list}>
$signals
= []
$starts
private
array<int, array{workflow_type: string, workflow_id: string, task_queue: string, input: list}>
$starts
= []
$updateResults
private
array<string, mixed>
$updateResults
= []
$updates
private
array<int, array{workflow_id: string, name: string, arguments: list}>
$updates
= []
$workflowResults
private
array<string, mixed>
$workflowResults
= []
$workflowStreamAppendResults
private
array<string, WorkflowStreamAppendResult>
$workflowStreamAppendResults
= []
$workflowStreamCloseResults
private
array<string, WorkflowStreamDescription>
$workflowStreamCloseResults
= []
$workflowStreamPages
private
array<string, WorkflowStreamPage>
$workflowStreamPages
= []
$workflowStreams
private
array<string, array<int, WorkflowStreamDescription>>
$workflowStreams
= []
Methods
appendMessage()
public
appendMessage(string $workflowId, string $streamName, string $messageId, array<int, mixed> $arguments) : array<string, mixed>
Parameters
- $workflowId : string
- $streamName : string
- $messageId : string
- $arguments : array<int, mixed>
Return values
array<string, mixed>appendWorkflowStream()
public
appendWorkflowStream(string $workflowId, string $runId, string $streamName, array<int, WorkflowStreamAppendItem> $items[, int|null $maxPendingItems = null ]) : WorkflowStreamAppendResult
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $items : array<int, WorkflowStreamAppendItem>
- $maxPendingItems : int|null = null
Return values
WorkflowStreamAppendResultassertMessageAppended()
public
assertMessageAppended(string $workflowId, string $streamName, string $messageId[, array<int, mixed>|null $arguments = null ]) : void
Parameters
- $workflowId : string
- $streamName : string
- $messageId : string
- $arguments : array<int, mixed>|null = null
assertQueryRequested()
public
assertQueryRequested(string $workflowId, string $name[, array<int, mixed>|null $arguments = null ]) : void
Parameters
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>|null = null
assertResultRequested()
public
assertResultRequested(string $workflowId) : void
Parameters
- $workflowId : string
assertSignalSent()
public
assertSignalSent(string $workflowId, string $name[, array<int, mixed>|null $arguments = null ]) : void
Parameters
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>|null = null
assertUpdateRequested()
public
assertUpdateRequested(string $workflowId, string $name[, array<int, mixed>|null $arguments = null ]) : void
Parameters
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>|null = null
assertWorkflowStarted()
public
assertWorkflowStarted(string $workflowType[, array<int, mixed>|null $input = null ][, string|null $workflowId = null ][, string|null $taskQueue = null ]) : void
Parameters
- $workflowType : string
- $input : array<int, mixed>|null = null
- $workflowId : string|null = null
- $taskQueue : string|null = null
closeWorkflowStream()
public
closeWorkflowStream(string $workflowId, string $runId, string $streamName[, string|null $errorReason = null ][, int|null $retentionSeconds = null ]) : WorkflowStreamDescription
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $errorReason : string|null = null
- $retentionSeconds : int|null = null
Return values
WorkflowStreamDescriptiondescribeWorkflowStream()
public
describeWorkflowStream(string $workflowId, string $runId, string $streamName) : WorkflowStreamDescription
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
Return values
WorkflowStreamDescriptioniterateWorkflowStream()
public
iterateWorkflowStream(string $workflowId, string $runId, string $streamName[, int $fromOffset = 0 ][, int $maxItems = 100 ][, int $waitSeconds = 30 ][, callable|null $cancelled = null ]) : Generator<int, WorkflowStreamItem>
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $fromOffset : int = 0
- $maxItems : int = 100
- $waitSeconds : int = 30
- $cancelled : callable|null = null
Return values
Generator<int, WorkflowStreamItem>listWorkflowStreams()
public
listWorkflowStreams(string $workflowId, string $runId) : array<int, WorkflowStreamDescription>
Parameters
- $workflowId : string
- $runId : string
Return values
array<int, WorkflowStreamDescription>query()
public
query(string $workflowId, string $name, array<int, mixed> $arguments) : mixed
Parameters
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>
result()
public
result(string $workflowId) : mixed
Parameters
- $workflowId : string
setQueryResult()
public
setQueryResult(string $workflowId, string $name, mixed $result) : self
Parameters
- $workflowId : string
- $name : string
- $result : mixed
Return values
selfsetUpdateResult()
public
setUpdateResult(string $workflowId, string $name, mixed $result) : self
Parameters
- $workflowId : string
- $name : string
- $result : mixed
Return values
selfsetWorkflowResult()
public
setWorkflowResult(string $workflowId, mixed $result) : self
Parameters
- $workflowId : string
- $result : mixed
Return values
selfsetWorkflowStreamAppendResult()
public
setWorkflowStreamAppendResult(string $workflowId, string $runId, string $streamName, WorkflowStreamAppendResult $result) : self
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $result : WorkflowStreamAppendResult
Return values
selfsetWorkflowStreamCloseResult()
public
setWorkflowStreamCloseResult(string $workflowId, string $runId, string $streamName, WorkflowStreamDescription $result) : self
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $result : WorkflowStreamDescription
Return values
selfsetWorkflowStreamPage()
public
setWorkflowStreamPage(string $workflowId, string $runId, string $streamName, int $fromOffset, WorkflowStreamPage $page) : self
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $fromOffset : int
- $page : WorkflowStreamPage
Return values
selfsetWorkflowStreams()
public
setWorkflowStreams(string $workflowId, string $runId, array<int, WorkflowStreamDescription> $streams) : self
Parameters
- $workflowId : string
- $runId : string
- $streams : array<int, WorkflowStreamDescription>
Return values
selfsignal()
public
signal(string $workflowId, string $name, array<int, mixed> $arguments) : void
Parameters
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>
startWorkflow()
public
startWorkflow(string $workflowType, string $workflowId, string $taskQueue[, array<int, mixed> $input = [] ][, int $executionTimeoutSeconds = 3600 ][, int $runTimeoutSeconds = 600 ][, string|null $duplicatePolicy = null ][, array<string|int, mixed>|null $memo = null ][, array<string|int, mixed>|null $searchAttributes = null ][, int|null $priority = null ][, string|null $fairnessKey = null ][, int|null $fairnessWeight = null ][, string|null $buildId = null ]) : WorkflowHandleInterface
Parameters
- $workflowType : string
- $workflowId : string
- $taskQueue : string
- $input : array<int, mixed> = []
- $executionTimeoutSeconds : int = 3600
- $runTimeoutSeconds : int = 600
- $duplicatePolicy : string|null = null
- $memo : array<string|int, mixed>|null = null
- $searchAttributes : array<string|int, mixed>|null = null
- $priority : int|null = null
- $fairnessKey : string|null = null
- $fairnessWeight : int|null = null
- $buildId : string|null = null
Return values
WorkflowHandleInterfacesubscribeWorkflowStream()
public
subscribeWorkflowStream(string $workflowId, string $runId, string $streamName[, int $fromOffset = 0 ][, int $maxItems = 100 ][, int $waitSeconds = 0 ][, callable|null $cancelled = null ]) : WorkflowStreamPage
Parameters
- $workflowId : string
- $runId : string
- $streamName : string
- $fromOffset : int = 0
- $maxItems : int = 100
- $waitSeconds : int = 0
- $cancelled : callable|null = null
Return values
WorkflowStreamPageupdate()
public
update(string $workflowId, string $name, array<int, mixed> $arguments) : mixed
Parameters
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>
workflowHandle()
public
workflowHandle(string $workflowId[, string|null $selectedRunId = null ]) : WorkflowHandleInterface
Parameters
- $workflowId : string
- $selectedRunId : string|null = null
Return values
WorkflowHandleInterfaceassertInteraction()
private
assertInteraction(array<int, array{workflow_id: string, name: string, arguments: list}> $interactions, string $kind, string $workflowId, string $name, array<int, mixed>|null $arguments) : void
Parameters
- $interactions : array<int, array{workflow_id: string, name: string, arguments: list}>
- $kind : string
- $workflowId : string
- $name : string
- $arguments : array<int, mixed>|null
configured()
private
configured(array<string, mixed> $configured, string $workflowId, string $name, string $kind) : mixed
Parameters
- $configured : array<string, mixed>
- $workflowId : string
- $name : string
- $kind : string
key()
private
key(string $workflowId, string $name) : string
Parameters
- $workflowId : string
- $name : string
Return values
stringstreamKey()
private
streamKey(string $workflowId, string $runId[, string $streamName = '' ][, int|null $fromOffset = null ]) : string
Parameters
- $workflowId : string
- $runId : string
- $streamName : string = ''
- $fromOffset : int|null = null