Add NullRunner stub for integration tests with X_EXPERIMENTAL_RUNNER#296
Add NullRunner stub for integration tests with X_EXPERIMENTAL_RUNNER#296
NullRunner stub for integration tests with X_EXPERIMENTAL_RUNNER#296Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new NullRunner stub for integration testing with the experimental X_EXPERIMENTAL_RUNNER environment variable. The NullRunner allows the application lifecycle to be managed externally, making it useful for integration testing scenarios where you want to manually invoke the application instead of running the built-in server.
Key changes:
- Introduces
NullRunnerclass that implements a no-op__invoke()method for external application lifecycle management - Adds integration tests demonstrating NullRunner usage in PHPT format
- Updates PHPUnit and PHPStan configurations to support PHPT test files
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Runner/NullRunner.php | New runner stub that does nothing when invoked, allowing external application lifecycle management |
| tests/Runner/NullRunnerTest.php | Unit test verifying NullRunner returns immediately without invoking the handler |
| tests/integration/tests/AppStopsWithoutOutputWithNullRunner.phpt | Integration test verifying app stops immediately with no output when using NullRunner |
| tests/integration/tests/AppInvokeIndexReturnsResponse.phpt | Integration test verifying app can be manually invoked to handle requests when using NullRunner |
| tests/integration/public/index.php | Updated to configure AccessLogHandler to use /dev/null when running with experimental runner |
| tests/AppTest.php | Added unit test verifying NullRunner integration with App class |
| src/App.php | Updated type hints and documentation references to use more generic callable types |
| phpunit.xml.dist | Added support for .phpt test files and refined integration test exclusions |
| phpunit.xml.legacy | Added support for .phpt test files and refined integration test exclusions |
| phpstan.neon.dist | Added .phpt file extension for static analysis |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This changeset adds a new
NullRunnerstub for integration tests with the newX_EXPERIMENTAL_RUNNERenvironment variable. This experimental application runner can be used in environments where the application lifecycle is managed externally. It can be useful for integration testing or when embedding the application in other systems.Note that this runner is not intended for production use and is not loaded by default. You need to explicitly configure your application to use this runner through the
X_EXPERIMENTAL_RUNNERenvironment variable:Likewise, you may pass this runner through an environment variable from your integration tests, see also included PHPT test files for examples.
Builds on top of #295, #294, #292, #289, #288, #287, #236, #224, #44, reactphp/promise#248, and others