mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-06 04:02:36 +02:00
Overhaul the Docsify documentation (English + Russian) so it matches the current codebase and follows one consistent pattern. Content accuracy (post-migration): - Rewrite development/autoloader.md to PSR-4 / Composer (the old XC_Autoloader scanner, igbinary tmp/cache/autoload_map and registerDirectories are gone). - PascalCase every source path (src/core -> src/Core, domain/Stream, cli/Commands, public/Controllers, Infrastructure/Redis, ...) across all docs. - Replace the removed autoload.php references with vendor/autoload.php (build_system, bootstrap-contexts, error-handling, modules). - ssl-generation: note that the installer now auto-generates a unique self-signed certificate before Nginx starts. Common pattern (Clean & uniform): - Strip emoji from headings; remove the in-page Navigation blocks (the Docsify sidebar already provides navigation). - One H1 + intro per doc; uniform "Related files" / "Связанные файлы" section, added to the code-centric docs that lacked it. Structure: - Remove the empty stray docs/api/; move updates_checklist.md into builds/; link the previously-orphaned ucs-integration.md. - Regroup the sidebars (split the oversized guides group into Developer Guides / Security & Access / Integrations; fold builds into Build & Release). Augment: - dev-workflow: Local Setup (make dev-tools) + Quality Checks (phpstan, cs, gates). - build_system: Composer Dependencies section (committed prod-only vendor, committed lock, dev tools via composer install, no build-time vendor step). en/ru parity: - Apply the same structure, fixes and pattern to docs/ru/ (translated), including a new Russian ucs-integration.md. The en and ru file sets are now identical.
83 lines
1.9 KiB
Markdown
83 lines
1.9 KiB
Markdown
# PHPUnit PHAR: Download and Run Tests
|
|
|
|
This guide shows how to run project tests with a fixed PHP binary:
|
|
|
|
- PHP binary: `/home/xc_vm/bin/php/bin/php`
|
|
- PHPUnit binary: local `tools/.bin/phpunit.phar`
|
|
|
|
## Why this setup
|
|
|
|
`phpunit.phar` does not include PHP. It always runs through a PHP interpreter.
|
|
|
|
If you run `./phpunit.phar` directly, it may use another `php` from `PATH`.
|
|
Use the explicit binary path to keep runtime consistent.
|
|
|
|
## 1. Check PHP
|
|
|
|
```bash
|
|
/home/xc_vm/bin/php/bin/php -v
|
|
```
|
|
|
|
## 2. Download PHPUnit PHAR
|
|
|
|
This project is pinned to PHP 8.1, so use PHPUnit 10.
|
|
|
|
```bash
|
|
cd /home/xc_vm
|
|
mkdir -p tools/.bin
|
|
wget -O tools/.bin/phpunit.phar https://phar.phpunit.de/phpunit-10.phar
|
|
chmod +x tools/.bin/phpunit.phar
|
|
```
|
|
|
|
## 3. Verify PHPUnit
|
|
|
|
```bash
|
|
/home/xc_vm/bin/php/bin/php tools/.bin/phpunit.phar --version
|
|
```
|
|
|
|
## 4. Run all tests
|
|
|
|
Project config file:
|
|
|
|
- `tests/phpunit.xml.dist`
|
|
|
|
Run:
|
|
|
|
```bash
|
|
/home/xc_vm/bin/php/bin/php tools/.bin/phpunit.phar -c tests/phpunit.xml.dist
|
|
```
|
|
|
|
## 5. Run a single test file
|
|
|
|
```bash
|
|
/home/xc_vm/bin/php/bin/php tools/.bin/phpunit.phar -c tests/phpunit.xml.dist tests/Unit/GitHubReleasesTest.php
|
|
```
|
|
|
|
## 6. Show which test is running now
|
|
|
|
Use debug mode to print the currently executing test:
|
|
|
|
```bash
|
|
/home/xc_vm/bin/php/bin/php tools/.bin/phpunit.phar -c tests/phpunit.xml.dist --debug --no-progress
|
|
```
|
|
|
|
## 7. Optional: Coverage output
|
|
|
|
If `xdebug` or `pcov` is installed:
|
|
|
|
```bash
|
|
XDEBUG_MODE=coverage /home/xc_vm/bin/php/bin/php tools/.bin/phpunit.phar -c tests/phpunit.xml.dist --coverage-text
|
|
```
|
|
|
|
## Security note
|
|
|
|
Do not commit `phpunit.phar` into the repository. Keep it local (`tools/.bin`) and update independently.
|
|
|
|
## Related files
|
|
|
|
| File | Role |
|
|
| --- | --- |
|
|
| `tools/.bin/phpunit.phar` | Pinned PHPUnit binary |
|
|
| `tests/phpunit.xml.dist` | PHPUnit configuration |
|
|
| `tests/bootstrap.php` | Test bootstrap (Composer autoloader + constants) |
|