Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Testbench Laravel Package

graham-campbell/testbench

Testing utilities for Laravel packages, built on PHPUnit, Mockery, Orchestral Testbench, and Laravel Testbench Core. Supports Laravel 8–13 and PHP 7.4–8.5, with compatibility for PHPUnit 9–11 to help you run fast, reliable package test suites.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardized Testing Framework: Adopt a unified testing approach for Laravel applications and packages, reducing fragmentation across teams and projects. This supports long-term maintainability and onboarding efficiency.
  • Build vs. Buy Decision: Buy—avoids reinventing the wheel for Laravel-specific test utilities. Leverages battle-tested libraries (PHPUnit, Mockery, Orchestral Testbench) to accelerate test development.
  • Roadmap for Test-Driven Development (TDD): Enables faster iteration by providing pre-configured test environments for Laravel packages and applications. Aligns with initiatives to improve code quality, reduce bugs, and accelerate feature delivery.
  • Use Cases:
    • Package Development: Rapidly test Laravel packages in isolation with AbstractPackageTestCase, ensuring compatibility across Laravel versions.
    • Application Testing: Streamline Laravel application tests with AbstractAppTestCase, including HTTP, unit, and feature tests.
    • CI/CD Integration: Reduce flaky tests and setup time in pipelines by using consistent test environments.
    • Legacy System Modernization: Gradually introduce testing to older Laravel apps (back to L5.5) without major refactoring.

When to Consider This Package

  • Adopt if:

    • Your team uses Laravel 8–13 and PHPUnit 9–11 (or PHP 7.4–8.5).
    • You develop Laravel packages or need to test third-party packages in isolation.
    • You want to standardize testing across multiple Laravel versions without maintaining custom test setups.
    • Your team prioritizes TDD, CI/CD, or test coverage and needs a lightweight, zero-configuration solution.
    • You’re migrating from Orchestral Testbench or need a drop-in replacement with broader Laravel version support.
  • Look elsewhere if:

    • You use Laravel <5.5 or PHPUnit 6/7 (limited support; consider legacy forks or custom solutions).
    • Your project requires advanced mocking beyond Mockery (e.g., Prophecy) or custom Laravel bootstrapping.
    • You’re already satisfied with PestPHP or Laravel’s built-in testing tools (though TestBench offers more package-focused features).
    • Your team lacks PHPUnit/Mockery familiarity (steeper learning curve than Pest’s fluent syntax).
    • You need enterprise-grade support (Tidelift is available but not free; consider paid alternatives like Laravel Shift).

How to Pitch It (Stakeholders)

For Executives:

*"Laravel TestBench is a plug-and-play solution to eliminate the pain of writing and maintaining tests for Laravel applications and packages. By adopting this, we can:

  • Reduce technical debt: Standardize testing across teams, cutting debugging time by 30%+ (based on similar tools).
  • Accelerate releases: Faster test cycles in CI/CD (no more flaky environments or manual bootstrapping).
  • Future-proof our stack: Supports Laravel 8–13 and PHP 8.5, aligning with our roadmap for modern PHP.
  • Lower costs: Zero-config setup avoids hiring specialized test engineers; MIT license means no licensing fees. Investment: Minimal (Composer install). ROI: Faster iterations, fewer production bugs, and easier onboarding for new devs."*

For Engineering:

*"TestBench gives us:

  • Package Testing Superpowers: AbstractPackageTestCase lets us test packages in isolation (e.g., for [PackageName]) without spinning up a full Laravel app. Saves hours per release.
  • Consistency: Works across Laravel 8–13 and PHPUnit 9–11—no more ‘it works on my machine’ issues in CI.
  • Mockery + PHPUnit: Full control over dependencies and assertions, with helpers like assertInJson() for API tests.
  • Zero Friction: No config, no service providers to register. Just extend AbstractTestCase and go. Trade-offs: Slightly more verbose than Pest, but more flexible for complex package tests. If we’re all-in on Pest, we can evaluate alternatives—but TestBench is the industry standard for Laravel packages.* Proposal: Pilot with our next package release or a high-risk feature. Measure test setup time and flakiness reduction."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope