stewart-php / testing
Test Stewart apps without Home Assistant: an app harness, recording fakes and virtual time
v2.0.0
2026-10-23 21:31 UTC
Requires
- php: >=8.5.12
- amphp/amp: ^3.1.1
- amphp/byte-stream: ^2.1
- amphp/http-client: ^5.3
- amphp/socket: ^2.4
- amphp/websocket: ^2.0.4
- amphp/websocket-client: ^2.0.2
- phpunit/phpunit: ^13.3
- psr/log: ^3.0
- stewart-php/contracts: v2.0.0
- stewart-php/store: v2.0.0
- stewart-php/support: v2.0.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
- amphp/cache: <2.0.1
- amphp/dns: <2.2
- daverandom/libdns: <2.1
Replaces
None
README
Test Stewart apps without Home Assistant. AppHarness builds an app with its options and recording fakes, and
runs timers, schedules and waits on virtual time.
composer require --dev stewart-php/testing
$harness = new AppHarness(); $harness->ha->seedState('binary_sensor.front_door', 'off'); $harness->startApp(DoorAlarmApp::class, ['door' => 'binary_sensor.front_door']); $harness->ha->pushState('binary_sensor.front_door', 'on'); $harness->advanceTime(Duration::minutes(5)); self::assertSame('notify.notify', $harness->ha->getLastCall()->getActionName());
Part of Stewart: Home Assistant automations in PHP. Start a project from stewart-php/skeleton rather than requiring packages one by one.
Documentation: stewart-php.github.io/docs.
This repository is a read-only split of the monorepo. Open issues and pull requests at stewart-php/stewart.
License
MIT; see LICENSE.