coders-tm/laravel-core / .agents/skills/testbench-docs
testbench-package-testing
VerifiedDevelops and tests Laravel packages using Orchestra Testbench. Activates when writing package tests, configuring testbench.yaml, managing migrations, defining routes/environment for tests, using Testbench Dusk for browser tests, or working with Workbench for package preview.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.2 KB |
| api-examples.md | markdown | 907 B |
| getting-started.md | markdown | 3.2 KB |
| getting-started/configuration.md | markdown | 5.2 KB |
| markdown-examples.md | markdown | 1.0 KB |
| testbench-dusk.md | markdown | 3.3 KB |
| testbench-dusk/the-basic.md | markdown | 3.3 KB |
| testbench-dusk/troubleshooting.md | markdown | 1.7 KB |
| testbench.md | markdown | 2.7 KB |
| testbench/cli.md | markdown | 1.9 KB |
| testbench/integrations.md | markdown | 2.0 KB |
| testbench/the-basic.md | markdown | 6.4 KB |
| testbench/the-basic/databases.md | markdown | 5.0 KB |
| testbench/the-basic/environment.md | markdown | 4.9 KB |
| testbench/the-basic/routes.md | markdown | 2.3 KB |
| testbench/troubleshooting.md | markdown | 3.5 KB |
| workbench.md | markdown | 1.2 KB |
testbench/cli.md
View on GitHub# Command-line Interface
Testbench provides support for a command line tool equivalent to `artisan` command where you can interact directly with the stub Laravel application.
For example instead of refreshing the database on every test you may now seed the database before running `phpunit`, using:
```bash
vendor/bin/testbench migrate
```
or, you can setup the application such as installing Passport:
```bash
vendor/bin/testbench passport:install
```
Both commands allow you to setup the testing environment where before you were only able to use the `TestCase::setUp()` method.
While the `testbench` CLI was originally designed to help with testing, you might be able to run other features to help package development such as running `ide-helper:models` etc.
::: warning NOTES & CONSIDERATIONS
The command wouldn't work for file stubbing as the generated file will be based on the booted Laravel application and not your package directories.
:::
[[toc]]
## Available Commands
`testbench` CLI also introduces a few commands to help your package's development.
### Create SQLite Database
This command creates `database/database.sqlite` on your package's Laravel skeleton. You can invoke it by running the following command:
```bash
vendor/bin/testbench package:create-sqlite-db
```
### Drop SQLite Database
This command drop `database/database.sqlite` on your package's Laravel skeleton. You can invoke it by running the following command:
```bash
vendor/bin/testbench package:drop-sqlite-db
```
### Purge Skeleton
This command will purge the skeleton and reset everything to default. You can also configure `purge` section under the `testbench.yaml` configuration files such as:
```yaml
purge:
directories:
- public/vendor/*
files:
- lang/*.json
```
You can invoke it by running the following command:
```bash
vendor/bin/testbench package:purge-skeleton
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |