nexus4812 / plain-php-test-framework
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/nexus4812/plain-php-test-framework
Requires
- php: ^5.3 || ^7.0 || ^8.0
Requires (Dev)
This package is auto-updated.
Last update: 2025-12-21 10:55:46 UTC
README
日本語 | English
What this is
A minimal test framework that works on PHP 5.3 and newer. It aims to feel PHPUnit-like so legacy projects can migrate gradually. The design keeps future switching to PHPUnit as painless as possible.
Status: Draft. Breaking changes without backwards compatibility may happen.
Installation
composer require --dev nexus4812/plain-php-test-framework
If you are on PHP 5.3, use composer 2.2.
Good fit for
- Running tests on legacy PHP 5.3 environments
- Using a PHPUnit-like style where PHPUnit itself cannot be installed
- Keeping test code aligned for a future move to PHPUnit
Not a good fit for
- Needing modern PHPUnit features (attributes, data providers, mocks, coverage, etc.)
- Expecting full PHPUnit compatibility
Features
- Works on PHP 5.3 to 8.5
- Composer PSR-4 autoloading (Composer 2.2 compatible)
- Basic assertions:
assertSame/assertTrue/assertFalse/assertCount - Simple CLI runner:
bin/run-tests
Quick start
- Write a test
<?php use PlainPhp\TestFramework\TestCase; use PlainPhp\TestFramework\Assert; class ExampleTest extends TestCase { public function testAdds() { Assert::assertSame(2, 1 + 1); } }
- Run tests
php bin/run-tests
By default it searches tests/. You can also pass a custom path.
php bin/run-tests path/to/tests
Migration mindset
This framework is not the final destination for PHPUnit compatibility. It is a temporary, minimal stepping stone toward PHPUnit. When you can migrate, switch to PHPUnit.