- What is cerbero/octane-testbench used for?
- It is a development-only test utility for Laravel applications running on Octane. It provides helpers to exercise Octane-specific request lifecycles and long-running worker behavior in your test suite. Use it to check that state does not leak between sequential requests before deploying to persistent workers.
- How do I install cerbero/octane-testbench in a Laravel project?
- Install it as a dev dependency with composer require --dev cerbero/octane-testbench. The typical setup does not require a service provider or config publishing in deployed environments. Wire the helpers into your existing PHPUnit or Pest test suite and pin the version in composer.lock.
- Does cerbero/octane-testbench work with PHPUnit and Pest?
- It is intended to extend rather than replace existing test primitives, so it should compose with PHPUnit or Pest suites. Integration is normally a require-dev install plus test-suite wiring, not a parallel test harness. Verify the exact PHPUnit or Pest version compatibility in your own matrix before making it blocking in CI.
- Which Laravel and Octane versions does cerbero/octane-testbench support?
- The provided context does not give a broad compatibility guarantee, so treat version support as something to verify. Check the package Composer constraints against your pinned Laravel major, Octane major, PHP version, and PHPUnit or Pest version. Octane internals move between releases, so pin the package and re-run compatibility checks on upgrades.
- Does cerbero/octane-testbench run in production?
- No, it is a require-dev dependency with zero production runtime footprint. You do not need a service provider or configuration in deployed environments. It is meant only for test suites that validate Octane worker behavior.
- What Octane-specific problems does cerbero/octane-testbench help test?
- It targets the correctness risks created by Octane's long-lived workers, including container singletons, static properties, config mutations, auth guards, and queued closures. Standard Laravel HTTP tests do not exercise the worker lifecycle, so leaks can surface only under load. The package helps you simulate sequential requests and assert request isolation and state checks.
- Does cerbero/octane-testbench work with Swoole, RoadRunner, and FrankenPHP?
- The helpers target Octane request lifecycles and worker behavior, but driver equivalence is explicitly a question to validate. Run the same smoke scenario against whichever driver you use, such as Swoole, RoadRunner, or FrankenPHP. Do not assume identical behavior across drivers without a green test run.
- Is cerbero/octane-testbench safe to depend on in CI?
- It is small, MIT-licensed, and forkable, which lowers the cost if upstream goes quiet. The main risks are single-maintainer concentration and limited downstream validation, so pin versions and read the source before relying on correctness assertions. Failures should appear as red CI rather than silent production issues, but start with a non-blocking job until stable.
- What are alternatives to cerbero/octane-testbench for testing Octane apps?
- Standard Laravel HTTP and feature tests do not exercise Octane's long-running worker lifecycle, so custom sequential-request tests are the usual alternative. Teams can also write targeted container-reset and static-state checks without a package. This package packages those helpers into a focused dev utility rather than replacing your existing test stack.
- How do I verify cerbero/octane-testbench actually catches state leaks?
- Write a negative test by deliberately introducing a known state leak in a stateful service, then simulate sequential requests and confirm the test fails. If the package does not catch that intentional leak, stop and reassess before broadening adoption. Once validated, add coverage for auth, config, caches, container singletons, and static registries.