Search by

stewart-php / testing

Zolli

Test Stewart apps without Home Assistant: an app harness, recording fakes and virtual time

v2.0.0 2026-10-23 21:31 UTC

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.