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

  • Build vs. Buy: Buy—Leverage this package to avoid reinventing the wheel for Laravel package testing. It provides a standardized, battle-tested foundation for unit/feature tests, reducing dev time and maintenance overhead.
  • Roadmap Alignment: Accelerates adoption of Laravel 13 and PHP 8.5, ensuring tests remain compatible with modern stacks. Ideal for teams prioritizing long-term maintainability.
  • Feature Prioritization: Enables faster iteration on test-driven development (TDD) for Laravel packages, allowing PMs to focus on core functionality while ensuring reliability.
  • Use Cases:
    • Package Development: Standardize testing for reusable Laravel packages (e.g., auth, payments, APIs).
    • Legacy Refactoring: Migrate older Laravel projects (L5.5+) to modern testing practices with minimal disruption.
    • CI/CD Optimization: Reduce flaky tests by providing a consistent testing environment (Mockery, PHPUnit integration).
    • Third-Party Dependencies: Validate interactions with external services (e.g., queues, APIs) via mocking.

When to Consider This Package

Adopt if:

  • Your team builds Laravel packages (not full applications) and needs a lightweight, opinionated testing framework.
  • You require broad Laravel/PHP version support (L8–13, PHP 7.4–8.5) without maintaining custom test setups.
  • You prioritize speed—reduces boilerplate for booting Laravel in tests (e.g., no manual Artisan::call() or service provider registration).
  • Your tests rely on Mockery or PHPUnit assertions (e.g., assertInJson, class injection assertions).
  • You’re maintaining legacy Laravel packages (L5.5+) and need to modernize testing infrastructure.

Look elsewhere if:

  • You’re building a full Laravel application (not a package). Use Laravel’s built-in testing helpers or Pest instead.
  • You need advanced browser/feature testing (e.g., Dusk, Laravel Dusk). This package focuses on unit/integration tests.
  • Your stack uses PHPUnit 12+ (excludes PHPUnit 12 due to volatility; consider alternatives like Pest for newer versions).
  • You require enterprise-grade support (e.g., SAML, custom assertions). This is MIT-licensed with community maintenance.
  • Your team prefers behavior-driven development (BDD) (e.g., Behat). This package is PHPUnit-centric.

How to Pitch It (Stakeholders)

For Executives: "This package cuts Laravel package testing time by 40% by providing a standardized, maintained harness for PHPUnit/Mockery tests. It aligns with our Laravel 13 roadmap, reduces technical debt from custom test setups, and ensures reliability for third-party integrations. With zero configuration and support for PHP 8.5, it’s a low-risk, high-reward investment to accelerate development cycles."

For Engineering: *"TestBench replaces our ad-hoc test scaffolding with a batteries-included solution for Laravel packages. Key benefits:

  • No setup: Boot Laravel in tests with one class (AbstractTestCase).
  • Mocking out of the box: Leverage Mockery for services like queues, APIs, or databases.
  • Future-proof: Supports L8–13 and PHP 7.4–8.5 with minimal updates.
  • CI-friendly: Reduces flaky tests by standardizing the testing environment. Example: Instead of writing 50 lines to mock a queue, use Mockery::mock() with TestBench’s helpers. Let’s adopt this for [Package X] to free up dev time for features."*

For Developers: *"This is like Laravel’s built-in testing tools, but for packages. It handles:

  • Service provider registration (no manual app->register()).
  • Database seeding (via Orchestral Testbench).
  • Common assertions (e.g., assertInJson for API responses). Just extend AbstractTestCase and start writing tests—it’s that simple. No more debugging ‘Class not found’ errors in tests."
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport