A beautiful, real-time progress wrapper for PHPUnit and ParaTest that transforms your test output into a modern, visually appealing experience.
- Real-time Progress Bar: Visual progress indicator showing test completion percentage
- Beautiful Output: Enhanced colors, Unicode symbols, and modern formatting
- Dual Runner Support: Works with both ParaTest (parallel) and PHPUnit (single-process)
- Smart Failure Reporting: Clear, organized display of test failures and errors
- Execution Timing: Shows formatted execution time (seconds, minutes, hours)
- Status Summary: Comprehensive test results with pass/fail counts
- Clean Interface: Organized output with dividers and structured information
โฏ ./phpunit.sh
[โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100% โ 1044 of 1044
โ All tests passed
โ OK (1044 tests, 1896 assertions)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Success! All tests completed successfully in 7.0s
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โฏ ./phpunit.sh
[โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 100% โ 1043 โ 1 of 1044
โ Tests failed
Passed: 1043
Failed: 1
โ Detailed failure information:
โ There was 1 failure:
1) AppTest\Error\ApiClientProblemTest::testCreateWithHttpStatusCode
โโ Failed asserting that 403 is identical to 404.
โ /Users/tim.alexander/mw/test/Error/ApiClientProblemTest.php:31
โ FAILURES!
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Testing completed with 1 failure(s) in 7.0s
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Bash: Compatible shell environment
- PHPUnit: For single-process testing
- ParaTest: For parallel testing (recommended)
- Unix-like OS: macOS, Linux, or WSL
-
Download the script:
curl -o phpunit.sh https://raw.githubusercontent.com/TimAnthonyAlexander/phpunit-progress/main/phpunit.sh chmod +x phpunit.sh
-
Or clone the repository:
git clone https://github.com/TimAnthonyAlexander/phpunit-progress.git cd phpunit-progress chmod +x phpunit.sh
Edit the TEST_CMD variable in phpunit.sh to match your setup:
TEST_CMD=(vendor/bin/paratest --colors=never --functional)TEST_CMD=(vendor/bin/phpunit --colors=never)TEST_CMD=(path/to/custom-runner <options>)Important: Keep exactly one TEST_CMD assignment active by commenting out the others.
./phpunit.sh./phpunit.sh --filter=MyTestClass
./phpunit.sh --group=integration
./phpunit.sh tests/Unit/# Copy to your git hooks directory
cp phpunit.sh .git/hooks/pre-push# GitHub Actions example
- name: Run Tests with Progress
run: ./phpunit.sh{
"scripts": {
"test": "./phpunit.sh",
"test:filter": "./phpunit.sh --filter"
}
}The script uses various visual elements for enhanced readability:
- Progress Bar:
โfor completed tests,โfor remaining - Status Icons:
โsuccess,โfailure,โwarning,โนinfo - Color Coding:
- ๐ข Green: Passed tests and success messages
- ๐ด Red: Failed tests and error messages
- ๐ก Yellow: Warnings and intermediate progress
- ๐ต Blue/Cyan: Information and progress indicators
# Change the BAR_WIDTH variable (default: 50)
BAR_WIDTH=80Edit the color variables at the top of the script:
green=$'\033[0;32m'
red=$'\033[0;31m'
yellow=$'\033[1;33m'
# ... etcScript doesn't execute
chmod +x phpunit.shNo progress shown
- Ensure your test runner outputs progress in the expected format
- Check that
--colors=neveris included in your TEST_CMD
Incomplete progress bar
- The script parses output patterns like "488 / 1227 ( 39%)"
- Verify your test runner produces compatible output
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built for PHP projects using PHPUnit and ParaTest
- Inspired by modern CLI tools and progress indicators
- Designed for developer productivity and visual clarity
Made with โค๏ธ for the PHP testing community