cable8mm / phpunit-start-kit
Phpunit Start Kit is the simple code for starting TDD
v3.0.0
2026-07-06 15:38 UTC
Requires
- php: ^8.3
Requires (Dev)
- laravel/pint: ^1.0
- pestphp/pest: ^4.0
README
A starter kit for creating PHP libraries with PHPUnit testing and modern development tools.
Requirements
- PHP 8.3 or higher
- Composer 2.0 or higher
Features
- ✅ Pest Testing: Pre-configured Pest 4.x support with example tests
- ✅ Code Linting: Laravel Pint for automatic code style enforcement
- ✅ CI/CD Ready: GitHub Actions workflows for testing and code style
- ✅ Auto CHANGELOG: Automatic changelog updates on GitHub releases
- ✅ Modern PHP: PHP 8.3+ with strict types and PSR-4 autoloading
- ✅ EditorConfig: Consistent coding styles across editors
- ✅ Complete Documentation: README, CHANGELOG, and MIT License included
Installation
As a Template (Recommended)
Create a new project from this starter kit:
composer create-project cable8mm/phpunit-start-kit <package_name> cd <package_name>
As a Dependency
composer require cable8mm/phpunit-start-kit
Quick Start
-
Update package information in
composer.json:- Change
nameto your package name (e.g.,your-vendor/your-package) - Update
authorsinformation - Add your package dependencies
- Change
-
Customize the source code:
- Modify
src/StartKit.phpwith your implementation - Update namespace to match your package
- Modify
-
Write tests:
- Update
tests/StartKitTest.phpwith your test cases - Add more test files as needed
- Update
-
Update documentation:
- Edit
README.mdwith your project description - Update
CHANGELOG.mdwith your release notes
- Edit
Available Commands
# Run tests composer test # Check code style composer inspect # Fix code style automatically composer lint # Generate API documentation (requires doctum.phar) composer apidoc
Project Structure
.
├── src/
│ └── StartKit.php # Main source code
├── tests/
│ └── StartKitTest.php # Test files
├── .github/
│ └── workflows/
│ ├── run-tests.yml # Automated testing
│ ├── code-style.yml # Code linting
│ └── update-changelog.yml # Auto CHANGELOG updates
├── composer.json # Package configuration
├── phpunit.xml # PHPUnit configuration
├── .editorconfig # Editor configuration
├── CHANGELOG.md # Change log
└── README.md # Project documentation
GitHub Actions Workflows
This starter kit includes three pre-configured GitHub Actions:
- run-tests.yml: Runs tests on multiple PHP versions (8.2, 8.3, 8.4, 8.5)
- code-style.yml: Automatically fixes code style with Laravel Pint
- update-changelog.yml: Updates CHANGELOG.md when a new release is published
Testing
The kit includes example tests using Pest's elegant syntax:
test('it can be instantiated', function () { $startKit = new StartKit; expect($startKit)->toBeInstanceOf(StartKit::class); });
Code Style
This project uses Laravel Pint for code styling, which follows PSR-12 standards with Laravel conventions.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The PHPUnit Start Kit is open-sourced software licensed under the MIT license.