A powerful VS Code extension for exploring, organizing, and executing PHP test collections with comprehensive Docker support.
- ๐ Collection Organization - Group your tests by folders (Unit, Feature, Integration...)
- ๐ฏ Granular Execution - Run individual tests, entire files, or complete collections
- ๐ณ Native Docker Support - Seamless execution in containers with automatic command transformation
- ๐ Visual Status - Icons for passed/failed/running tests with detailed error information
- ๐ Error Details - Complete visualization of PHP failures and errors
- โก Smart Cache - Optimized scanning with automatic updates
- ๐ Complete Logging - All commands tracked in dedicated Output tab
- ๏ฟฝ๏ธ Terminal Management - Intelligent terminal reuse and cleanup
- Install: Download
php-test-collections-explorer-0.1.0.vsix - VS Code:
Ctrl+Shift+PโExtensions: Install from VSIX... - Open a PHP project with tests
- View: "PHP Test Collections" appears automatically in the Test tab
#Run in your terminal
chmod +x install.sh
./install.sh
๐ณ Docker Integration Tests (5 files)
โโโ โ
AuthTest.php (3 tests)
โ โโโ โ
testLogin
โ โโโ โ testFailedLogin
โ โโโ โช testLogout
โโโ โ
DatabaseTest.php (2 tests)
๐ Unit Tests (8 files)
โโโ โ
UserTest.php (4 tests)
โโโ ...
{
"phpTestCollections.collections": [
{
"name": "Unit Tests",
"path": "tests/Unit",
"command": "vendor/bin/phpunit tests/Unit",
"useDocker": false
},
{
"name": "Docker Integration",
"path": "tests/Integration",
"command": "vendor/bin/phpunit tests/Integration",
"useDocker": true,
"dockerImage": "my-app"
}
],
"phpTestCollections.logLevel": "info"
}| Action | Result | Generated Command |
|---|---|---|
testLogin only |
--filter "UserTest::testLogin" |
|
| All tests in file | --filter "UserTest" |
|
| Entire test suite | Full command |
Automatic command transformation:
- Local:
vendor/bin/phpunit --filter "UserTest" tests/Unit/UserTest.php - Docker:
docker exec my-app vendor/bin/phpunit --filter "UserTest" tests/Unit/UserTest.php
| Icon | Status | Description |
|---|---|---|
| โ | Passed | Test successful |
| โ | Failed | Assertion failed |
| ๐ฅ | Error | PHP error |
| ๐ | Running | Executing |
| โช | Unknown | Not tested |
{
"phpTestCollections.collections": [
{
"name": "Feature Tests",
"path": "tests/Feature",
"command": "vendor/bin/phpunit --testsuite=Feature"
},
{
"name": "Unit Tests",
"path": "tests/Unit",
"command": "vendor/bin/phpunit --testsuite=Unit"
}
]
}{
"name": "Tests Container",
"path": "tests",
"command": "vendor/bin/phpunit",
"useDocker": true,
"dockerImage": "my-project_app"
}{
"phpTestCollections.collections": [
{
"name": "Unit Tests",
"path": "tests/Unit",
"command": "vendor/bin/phpunit tests/Unit"
},
{
"name": "Integration Tests",
"path": "tests/Integration",
"command": "vendor/bin/phpunit tests/Integration"
}
]
}- Output Tab: "PHP Test Collections"
- Configurable Levels:
error|warn|info|debug - Real-time Filtering: Only relevant messages displayed
- Traced Commands with timestamps
- Detailed Docker errors
- ๐ด Error: Critical failures only
- ๐ก Warning: + Configuration issues
- ๐ต Info: + Test execution (default)
- ๐ฃ Debug: + Internal operations
Control the verbosity of extension output with configurable logging levels:
{
"phpTestCollections.logLevel": "info"
}| Level | Description | Output |
|---|---|---|
"error" |
Critical errors only | โ Fatal errors, crashes |
"warn" |
Errors + warnings | โ + |
"info" |
Standard output (default) | โ + |
"debug" |
Verbose development mode | โ + |
Examples:
- Production:
"error"- Only critical issues - Development:
"debug"- Full diagnostic information - CI/CD:
"warn"- Balanced output for automation - Default:
"info"- Perfect for daily usage
- Force refresh: ๐ Button
- Change log level: VS Code Settings โ "PHP Test Collections"
- View logs: Output โ "PHP Test Collections"
# Clone the repo
git clone [your-repo]
cd Tests-vs-ext
# Install dependencies
npm install
# Compile
npm run compile
# Launch dev mode
F5 (Extension Development Host)
# Create package
vsce package
#Generate your own package
npx @vscode/vsce packageโ
PHP Developers working with PHPUnit
โ
Laravel/Symfony projects with organized tests
โ
Docker environments for integration
โ
E2E testing with complex configurations
โ
Teams needing consistency in test execution
- ๐ Logs: Output โ "PHP Test Collections"
- ๐ Debugging: Check the usage guide
- ๐ Issues: Create an issue
- ๐ types/: Centralized TypeScript interfaces
- ๐ LoggingService: Configurable logging system with 4 levels (113 lines)
- ๐พ CacheService: JSON cache management (228 lines)
- ๐ TestRunner: PHPUnit execution engine (492 lines)
- ๐ TestParser: PHP parsing with dual detection (190 lines)
- ๐๏ธ FileWatcher: Real-time file monitoring (202 lines)
- Code Reduction: 68% (1877 โ 595 lines in main file)
- Bundle Size: 85.3 KiB (optimized)
- Cache System: Workspace-specific JSON persistence
- Compilation: Zero TypeScript errors
- VS Code ^1.105.0
- PHP project with PHPUnit tests
- Optional: Docker for containerized execution
๐ Transform your PHP testing workflow with a powerful visual interface!