Download the PHP
package vielhuber/cassette without Composer
On this page you can find all versions of the php package
vielhuber/cassette. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor vielhuber Package cassette Short Description Record real HTTP flows once, replay them deterministically as regression tests. License
MIT
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 cassette
📼 cassette 📼
cassette hooks into your PHP application at the lowest level — intercepting database calls and outgoing HTTP requests via uopz and serialises every return value to a JSON tape. On replay, the server runs normally but all external I/O is served from that tape, making each test completely self-contained: no database, no network, no side effects. Visual regression is layered on top via Playwright, which navigates through the recorded request sequence and compares screenshots against committed baselines.
Installation
Production
Development
Usage
Notes
**Requirements:**
- PHP ≥ 8.3 with the [uopz](https://www.php.net/manual/en/book.uopz.php) extension
- Node.js (for visual screenshot regression — installed automatically on first use)
**Project root resolution.** Every command resolves the project root in this order:
1. `--root=` flag
2. `CASSETTE_ROOT` environment variable
3. Current working directory (default)
So `cd /var/www/my-project && vendor/bin/cassette record run_001` just works without any flags.
**Toggle uopz and inject the bootstrap line** — `up`/`down` enable/disable uopz (incl. the PHP 8.5 patch) and write/remove the `require_once` hook in `wp-config.php` (WordPress) or `public/index.php` (Laravel):
`.cassette/config.json` is created automatically on the first `vendor/bin/cassette record` call.
## Usage
| Command | Description |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `vendor/bin/cassette up [--php=]` | Enable uopz, install LD_PRELOAD shim (PHP 8.5), inject bootstrap line |
| `vendor/bin/cassette down [--php=]` | Reverse `up` — disable uopz and remove bootstrap line |
| `vendor/bin/cassette record ` | Switch to record mode and clear old data — then click through the flow in the browser |
| `vendor/bin/cassette stop ` | Stop recording — further requests are no longer captured |
| `vendor/bin/cassette replay [--refresh] [--base-url=] [--http-only\|--screenshot-only]` | HTTP diff + visual screenshot comparison; `--refresh` recreates baselines |
| `vendor/bin/cassette accept ` | Interactively accept HTTP diffs as new baseline |
| `vendor/bin/cassette delete ` | Delete a run including all its data and screenshots |
| `vendor/bin/cassette delete --all` | Delete all runs |
| `vendor/bin/cassette list` | List all recorded runs with request count and screenshots |
All commands accept `--root=`. If omitted, `CASSETTE_ROOT` (env) is used, falling back to the current working directory.
Exit code `0` = all green, `1` = deviations found. CI-compatible.
All run data is stored in `.cassette/runs//`. The directory is created on the first `vendor/bin/cassette` invocation with a self-contained `.cassette/.gitignore` that excludes everything (`*`), so recordings stay out of git without touching the project's own `.gitignore`. To track screenshot baselines, replace that file's contents with negation patterns:
## Development workflow (working on cassette itself)
When developing cassette alongside a project, you can run the CLI directly from the cassette source directory and point it at the target project — either via `CASSETTE_ROOT` or via `--root`:
Or with an explicit flag:
This way the target project's `composer.json` stays completely untouched — no path-repository, no `minimum-stability`, no symlinks. All cassette data is read from and written to `/var/www/my-project/.cassette/` as usual.
## Portability
Recordings are captured on one host (e.g. `https://custom-tld.dev`) but can be
replayed anywhere — CI, localhost, staging — without re-recording:
The `--base-url` flag replaces the host for both the HTTP diff and the Playwright
screenshots. The recorded `base_url` in `http.json` is never modified.
For GitHub Actions, pass the URL as a secret:
### No database required for replay
During replay, all database queries and outgoing HTTP calls are intercepted by
[uopz](https://www.php.net/manual/en/book.uopz.php) and served from the recorded
cassette data. The server must be running and reachable, but:
- **no real database connection is needed** — the DB state at replay time is completely irrelevant
- **no test fixtures or seed data** are required
- external APIs and curl calls are mocked the same way
This makes cassette replays safe to run on CI, on a fresh machine, or against a
server whose database is empty, stale, or even offline.
### curl interception
To intercept `__::curl()` calls, add [`vielhuber/stringhelper`](https://github.com/vielhuber/stringhelper) to your project:
Without it, cassette still records and replays all database calls — curl interception is simply skipped.
## Configuration
Create `.cassette/config.json` to customise recording and screenshot behaviour per project:
| Key | Default | Description |
| ------------------------------ | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ignoreUrls` | `[]` | List of URI substrings — any HTTP request whose path contains one of these strings is silently skipped during recording (not written to `http.json`) |
| `screenshot.headless` | `true` | Run Playwright in headless mode |
| `screenshot.zoom` | `0.7` | CSS zoom applied to `` before each screenshot |
| `screenshot.maxDiffPixelRatio` | `0.01` | Maximum allowed pixel difference ratio (0–1) |
| `screenshot.maskSelectors` | `[]` | CSS selectors whose elements are hidden before each screenshot (uses direct DOM manipulation, so `position: fixed` elements are reliably hidden) |
| `screenshot.maskDates` | `true` | Automatically hide all date and time values in the page (ISO dates `2026-03-29`, German dates `29.03.2026`, times `12:34` / `12:34:56`) including `` values and plain text nodes |
| `screenshot.waitAfterGoto` | `0` | Extra milliseconds to wait after `networkidle` before taking the screenshot. Used as a fixed wait by default, or as a ceiling when `domStableMs > 0` |
| `screenshot.domStableMs` | `0` | Opt-in early-exit. When set > 0, the wait exits early once the DOM signature (HTML length + scrollHeight) has been stable for this many consecutive milliseconds, capped at `waitAfterGoto`. Skips signature-only changes (CSS animations, image decoding) — leave at `0` for pages with rich client-side interactivity |
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 vielhuber/cassette contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.