recca0120/vscode-phpunit

Run PHPUnit and Pest tests in VS Code with the native Test Explorer. Supports Docker, SSH, Laravel Sail, ParaTest, and Xdebug step-debugging.

168

stars

1,062

commits

TypeScript

primary language

Jul 13, 2026

updated

marketplace.visualstudio.com/items?itemName=recca0120.vscode-phpunit
pest
pestphp
php
phpunit
test
test-explorer
testing
vscode
vscode-extension

README

vscode-phpunit

Monorepo for the PHPUnit & Pest Test Explorer VS Code extension.

Version Installs License

Packages

PackageDescription
packages/phpunit@vscode-phpunit/phpunit — PHPUnit/Pest parser, runner, and tree-sitter utilities. Built with tsup (ESM + CJS).
packages/extensionVS Code extension — Test Explorer integration for PHPUnit & Pest. Bundled with esbuild. Depends on @vscode-phpunit/phpunit.

packages/phpunit

Core library that parses PHPUnit/Pest test files (via tree-sitter WASM), builds command lines, and processes test output. Published as @vscode-phpunit/phpunit.

  • Build: tsup outputs ESM/CJS to dist/, and copies tree-sitter.wasm / tree-sitter-php.wasm into dist/.
  • Test: Vitest

packages/extension

VS Code extension that integrates with the native Test Explorer UI. Consumes @vscode-phpunit/phpunit as a dev dependency; esbuild bundles everything into a single dist/extension.js.

  • Build: esbuild bundles to dist/extension.js, and copies WASM files from node_modules/@vscode/tree-sitter-wasm/wasm/ to dist/.
  • Test: Vitest (unit) + @vscode/test-electron (e2e)
  • Package: @vscode/vsce produces .vsix

Development

Prerequisites

Setup

pnpm install

Common Commands

# Compile all packages (phpunit tsup + extension esbuild)
pnpm compile

# Run all unit tests
pnpm test

# Run e2e tests (extension only)
pnpm test:e2e

# Lint
pnpm lint

# Type check
pnpm typecheck

# Production build for extension (minified)
pnpm package

# Produce .vsix file
cd packages/extension && pnpm exec vsce package --no-dependencies

Debugging the Extension

The repository includes launch configurations in .vscode/launch.json:

ConfigurationDescription
Run ExtensionOpens with a local phpunit-stub project
Run Extension (Multi-Workspace)Opens a multi-folder workspace (local)
Run Extension (Docker Multi-Workspace)Opens a multi-folder workspace running inside Docker

Docker Multi-Workspace Setup

  1. Start the shared container:

    cd packages/phpunit/tests/fixtures/workspaces
    docker compose up -d --build
    
  2. Select Run Extension (Docker Multi-Workspace) from the debug panel and press F5.

  3. Stop the container:

    docker compose down
    

Contributing

License

MIT

Contributors

recca0120

1,034 commits

zobo

11 commits

Jhuntenburg

6 commits

rserry

2 commits

recca0120/vscode-phpunit

Run PHPUnit and Pest tests in VS Code with the native Test Explorer. Supports Docker, SSH, Laravel Sail, ParaTest, and Xdebug step-debugging.

168

stars

1,062

commits

TypeScript

primary language

Jul 13, 2026

updated

marketplace.visualstudio.com/items?itemName=recca0120.vscode-phpunit
pest
pestphp
php
phpunit
test
test-explorer
testing
vscode
vscode-extension

README

vscode-phpunit

Monorepo for the PHPUnit & Pest Test Explorer VS Code extension.

Version Installs License

Packages

PackageDescription
packages/phpunit@vscode-phpunit/phpunit — PHPUnit/Pest parser, runner, and tree-sitter utilities. Built with tsup (ESM + CJS).
packages/extensionVS Code extension — Test Explorer integration for PHPUnit & Pest. Bundled with esbuild. Depends on @vscode-phpunit/phpunit.

packages/phpunit

Core library that parses PHPUnit/Pest test files (via tree-sitter WASM), builds command lines, and processes test output. Published as @vscode-phpunit/phpunit.

  • Build: tsup outputs ESM/CJS to dist/, and copies tree-sitter.wasm / tree-sitter-php.wasm into dist/.
  • Test: Vitest

packages/extension

VS Code extension that integrates with the native Test Explorer UI. Consumes @vscode-phpunit/phpunit as a dev dependency; esbuild bundles everything into a single dist/extension.js.

  • Build: esbuild bundles to dist/extension.js, and copies WASM files from node_modules/@vscode/tree-sitter-wasm/wasm/ to dist/.
  • Test: Vitest (unit) + @vscode/test-electron (e2e)
  • Package: @vscode/vsce produces .vsix

Development

Prerequisites

Setup

pnpm install

Common Commands

# Compile all packages (phpunit tsup + extension esbuild)
pnpm compile

# Run all unit tests
pnpm test

# Run e2e tests (extension only)
pnpm test:e2e

# Lint
pnpm lint

# Type check
pnpm typecheck

# Production build for extension (minified)
pnpm package

# Produce .vsix file
cd packages/extension && pnpm exec vsce package --no-dependencies

Debugging the Extension

The repository includes launch configurations in .vscode/launch.json:

ConfigurationDescription
Run ExtensionOpens with a local phpunit-stub project
Run Extension (Multi-Workspace)Opens a multi-folder workspace (local)
Run Extension (Docker Multi-Workspace)Opens a multi-folder workspace running inside Docker

Docker Multi-Workspace Setup

  1. Start the shared container:

    cd packages/phpunit/tests/fixtures/workspaces
    docker compose up -d --build
    
  2. Select Run Extension (Docker Multi-Workspace) from the debug panel and press F5.

  3. Stop the container:

    docker compose down
    

Contributing

License

MIT

Contributors

recca0120

1,034 commits

zobo

11 commits

Jhuntenburg

6 commits

rserry

2 commits

Languages

TypeScript

99.4%