morebec/orkestra-event-sourcing-testing
Composer 安装命令:
composer require morebec/orkestra-event-sourcing-testing
包简介
Orkestra component with utilities for easily testing event sourced systems based on Orkestra and Symfony
README 文档
README
Utilities to easily test event sourced systems based on Orkestra and Symfony using a fluent API.
Installation
composer require morebec/orkestra-orkestra-exceptions
Usage:
class RegisterCustomerCommandHandlerTest extends EventSourcedTestCase { /** * @return void * @throws Throwable */ public function test(): void { $customerId = uniqid('cus_', true); $this ->defineScenario() ->givenCurrentDateIs(new DateTime("2020-01-01")) ->whenCommand(from(static function() use ($customerId) { $command = new RegistercustomerCommand(); $command->customerId = $customerId; return $command; })) ->messageBusShouldRespondWithPayload(null) ->messageBusShouldRespondWithStatusCodeSucceeded() ->expectSingleEventSameAs(from(static function() use ($customerId) { $event = new CustomerRegisteredEvent(); $event->customerId = $customerId; return $event; })) ->runScenario() ; } }
统计信息
- 总下载量: 91
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2022-01-12