https://github.com/php-testo/testo
The Testing Framework
https://github.com/php-testo/testo
hacktoberfest
Last synced: about 1 month ago
JSON representation
The Testing Framework
- Host: GitHub
- URL: https://github.com/php-testo/testo
- Owner: php-testo
- License: bsd-3-clause
- Created: 2025-10-12T13:05:57.000Z (9 months ago)
- Default Branch: 1.x
- Last Pushed: 2026-04-29T10:39:58.000Z (3 months ago)
- Last Synced: 2026-04-29T12:25:59.428Z (3 months ago)
- Topics: hacktoberfest
- Language: PHP
- Homepage: https://php-testo.github.io
- Size: 959 KB
- Stars: 170
- Watchers: 4
- Forks: 6
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
The PHP Testing Framework You Control
[](https://php-testo.github.io)
[](https://boosty.to/roxblnfk)
Testo is an extensible testing framework built on a lightweight core with a middleware system.
It gives you full control over your testing environment while keeping the familiar PHP syntax you already know.
## Get Started
### Installation
```bash
composer require --dev testo/testo *
```
[](https://packagist.org/packages/testo/testo)
[](https://packagist.org/packages/testo/testo)
[](LICENSE.md)
[](https://packagist.org/packages/testo/testo/stats)
### Configuration
The fastest way to set up Testo in your project is the built-in `init` command:
```bash
vendor/bin/testo init
```
It will:
- detect your `src/` directory (or prompt for it),
- create `tests/Unit/` if missing,
- generate a minimal `testo.php` next to your `composer.json`,
- register `composer test` and `composer test:` scripts.
For a sub-app layout, point it at the project root: `vendor/bin/testo init --path=app`.
#### Tuning `testo.php` manually
`testo.php` is plain PHP returning an `ApplicationConfig` — edit it freely to add suites, plugins, or coverage. A typical setup looks like:
```php
makeExternalApiCall();
Assert::same($response->status, 200);
}
#[ExpectException(\RuntimeException::class)]
public function throwsException(): void
{
throw new \RuntimeException('Expected error');
}
}
```
What to note:
- Use the `#[Test]` attribute to mark test methods or classes
- Test classes don't need to extend any base class
- Use `Assert` class for assertions (`same`, `true`, `false`, `null`, `contains`, `instanceOf`, etc.)
- Testo provides multiple attributes to extend testing capabilities (retry policies, exception handling, and more)
## IDE Support
Testo comes with the [IDEA plugin `Testo`](https://plugins.jetbrains.com/plugin/28842-testo?noRedirect=true).
[](https://plugins.jetbrains.com/plugin/28842-testo/versions)
[](https://plugins.jetbrains.com/plugin/28842-testo/reviews)
[](https://plugins.jetbrains.com/plugin/28842-testo)