adachsoft / workflow-launcher-contract-tests
Reusable PHPUnit contract tests for workflow launcher implementations.
Package info
gitlab.com/a.adach/workflow-launcher-contract-tests
pkg:composer/adachsoft/workflow-launcher-contract-tests
Requires
- php: ^8.3
- adachsoft/workflow-launcher-contracts: ^0.1.0 || ^0.2.0
Requires (Dev)
- adachsoft/php-code-style: ^0.7.3
- friendsofphp/php-cs-fixer: ^3.95
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^12.5
- rector/rector: ^2.8
- symplify/phpstan-rules: ^14.19
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Reusable PHPUnit behavioral contract suites for implementations of WorkflowLauncherInterface and ConcurrencySlotInterface. Use them to verify that a workflow launcher or concurrency-slot adapter honors the shared contracts without depending on a particular workflow execution engine.
Capabilities
- Check launch results, unknown workflows, idempotency, budget rejection, and concurrency-key behavior.
- Check concurrency limits, independent keys, reservation release, re-entrant reservations, and TTL expiration.
- Supply a mutable PSR clock for deterministic expiration tests.
Installation
Install the package as a development dependency:
composer require --dev adachsoft/workflow-launcher-contract-tests
Usage
Create concrete PHPUnit test classes in your project that extend the relevant abstract contract suite and implement its factory method. The factories should return your production implementation configured for the case supplied by the contract test. See the integration example.
Requirements
The package requires PHP 8.3 or later, PHPUnit 12.5 or later, and adachsoft/workflow-launcher-contracts. PHPUnit is included as a runtime dependency because the reusable contract suites extend PHPUnit's TestCase class.