Orchestra Testbench

repository·11.x·Indexed 25 days ago

https://github.com/orchestral/testbench

A specialized testing helper for developers building Laravel packages that provides a simulated Laravel environment to facilitate comprehensive testing of package functionality.

Tokens
428
Snippets
0
Records
7
Agent score
31%

What's inside Testbench

  1. What is Testbench?

    11.x
    Testbench is a Laravel testing helper designed specifically for package development. It provides the necessary infrastructure to write tests for Laravel packages by simulating a Laravel environment within your test suite.
  2. Migrate from v10.x to v11.0.0

    11.x

    When upgrading to version 11.0.0, note the following removals of deprecated components and annotations:

    Removed Classes and Traits

    • Orchestra\Testbench\Foundation\Env class
    • Orchestra\Testbench\Foundation\Console\Concerns\HandleTerminatingConsole trait

    Removed Methods and Functions

    • Orchestra\Testbench\Foundation\Console\Actions\Action::pathLocation() method
    • orchestra\testbench\laravel_migration_path() function

    Removed Annotations

    The following annotations are no longer supported:

    • @define-env
    • @environment-setup
    • @define-db
    • @define-route
  3. Use the WithFixtures trait to automatically load fixtures

    11.x

    Starting from version 10.9.0, you can use the Orchestra estbench\Concerns\WithFixtures trait in your tests to automatically load fixture files.

    Additionally, in version 10.10.0, you can configure your testbench.yaml file with seeders: true to automatically run seeders during the test setup.