Download the PHP package emaadali/pest-database-isolation-plugin without Composer

On this page you can find all versions of the php package emaadali/pest-database-isolation-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pest-database-isolation-plugin

Pest Database Isolation Plugin

Laravel-focused Pest plugin for isolating concurrent test runs and parallel test workers with Neon branches or local Postgres databases.

Installation

Usage

In tests/Pest.php:

The plugin also exposes a stable run id for isolating other test artifacts created during the same Pest command:

The run id is stored in PEST_TEST_RUN_ID and is shared with Laravel parallel test workers.

The plugin auto-selects a driver. If your DB_URL, DATABASE_URL, or DB_HOST contains neon.tech, it uses the neon driver. Otherwise it uses the pgsql driver.

You can configure the driver explicitly:

Neon Driver

Configure Neon:

The root test branch is created once per Pest run and deleted when the parent test process exits. Laravel parallel workers automatically create expiring child branches from that root branch and point the worker database connection at the child branch.

When the neon driver is selected but NEON_API_KEY, NEON_PROJECT_ID, or NEON_PARENT_BRANCH_ID is missing, the plugin throws an exception instead of silently falling back.

Postgres Driver

The pgsql driver creates a unique database per test run and worker, such as:

Laravel's RefreshDatabase trait then runs migrate:fresh against that worker database normally. The plugin drops the worker database on shutdown.

Because this driver creates and drops databases, it only operates on a local Postgres host (localhost, 127.0.0.1, ::1, or a Unix socket). Pointing it at a remote host throws an exception.

The plugin connects to the postgres maintenance database to create and drop worker databases. Set PEST_TEST_PGSQL_ADMIN_DATABASE to use a different one:

Worktree databases

The package ships a vendor/bin/setup-worktree-database binary for giving each git worktree its own isolated local Postgres database. It reads the connection details from the worktree's .env, creates a database named <base>_wt_<worktree> (worktree name from CURSOR_WORKTREE_NAME, falling back to the directory name), and rewrites .env to point at it.

Call it from your worktree setup, after composer install and before migrating:

The database is created empty (migrate it yourself), recreated fresh on each run, and—like the pgsql test driver—only operates on a local Postgres host.


All versions of pest-database-isolation-plugin with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/testing Version ^11.0|^12.0|^13.0
php Version ^8.3
pestphp/pest Version ^4.4.3
pestphp/pest-plugin Version ^4.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package emaadali/pest-database-isolation-plugin contains the following files

Loading the files please wait ...