fix: php unit startup command
This commit is contained in:
@@ -71,7 +71,7 @@ The tests are written and failing. Now implement the minimum code to make them p
|
|||||||
|
|
||||||
```
|
```
|
||||||
Tests are green. Refactor the implementation for [readability / removing duplication / naming].
|
Tests are green. Refactor the implementation for [readability / removing duplication / naming].
|
||||||
Run php bin/phpunit after each change to confirm tests stay green.
|
Run vendor/bin/phpunit after each change to confirm tests stay green.
|
||||||
```
|
```
|
||||||
|
|
||||||
**Common anti-patterns**
|
**Common anti-patterns**
|
||||||
@@ -87,16 +87,16 @@ Run php bin/phpunit after each change to confirm tests stay green.
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run full suite
|
# Run full suite
|
||||||
php bin/phpunit
|
vendor/bin/phpunit
|
||||||
|
|
||||||
# Run with human-readable output
|
# Run with human-readable output
|
||||||
php bin/phpunit --testdox
|
vendor/bin/phpunit --testdox
|
||||||
|
|
||||||
# Run a single test file
|
# Run a single test file
|
||||||
php bin/phpunit tests/Unit/Service/SvgRendererTest.php
|
vendor/bin/phpunit tests/Unit/Service/SvgRendererTest.php
|
||||||
|
|
||||||
# Run tests matching a filter
|
# Run tests matching a filter
|
||||||
php bin/phpunit --filter it_renders
|
vendor/bin/phpunit --filter it_renders
|
||||||
```
|
```
|
||||||
|
|
||||||
### Auto-run hook
|
### Auto-run hook
|
||||||
@@ -109,7 +109,7 @@ Add to `.claude/settings.json` to run PHPUnit automatically after every file edi
|
|||||||
"PostToolUse": [
|
"PostToolUse": [
|
||||||
{
|
{
|
||||||
"matcher": "Edit|Write",
|
"matcher": "Edit|Write",
|
||||||
"command": "php bin/phpunit 2>&1 | tail -20"
|
"command": "vendor/bin/phpunit 2>&1 | tail -20"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ docker compose up -d --build
|
|||||||
docker compose exec graph sh
|
docker compose exec graph sh
|
||||||
|
|
||||||
# Run tests inside the container
|
# Run tests inside the container
|
||||||
docker compose exec graph php bin/phpunit
|
docker compose exec graph vendor/bin/phpunit
|
||||||
|
|
||||||
# Disable Xdebug for faster test runs
|
# Disable Xdebug for faster test runs
|
||||||
XDEBUG_MODE=off docker compose up -d
|
XDEBUG_MODE=off docker compose up -d
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
"phpunit/phpunit": "^11.5",
|
"phpunit/phpunit": "^11.5",
|
||||||
"symfony/phpunit-bridge": "^7.4"
|
"symfony/phpunit-bridge": "^7.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
|
||||||
"test": "php bin/phpunit"
|
|
||||||
},
|
|
||||||
"config": {
|
"config": {
|
||||||
"optimize-autoloader": true,
|
"optimize-autoloader": true,
|
||||||
"sort-packages": true,
|
"sort-packages": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user