Testing
6/28/26Less than 1 minute
Testing
vendor/bin/pestThe project uses Pest 4 (built on PHPUnit 12). Test configuration is in phpunit.xml.
Test Structure
tests/Pest.php— Pest configurationtests/DialogsTest.php— Tests an upstream private method via reflection (no FFI needed)
Testing Utilities
Libui\Testing\CallbackSpy— Assertion-based callback verification without an event loopLibui\Testing\Inspect— Widget inspection helpersWindow::resetMenuLock()— Available for tests that need to create menus after a Window
Writing Tests
Write new tests in Pest style:
test('text field emits change event', function () {
$field = new TextField('Name:', 'default');
$spy = new CallbackSpy();
$field->on('change', $spy);
$field->setValue('New');
expect($spy)->toHaveBeenCalled();
});