11<p align =" center " >
2- <a href="#installation "><img alt="TESTO"
2+ <a href="#get-started "><img alt="TESTO"
33 src="https://github.com/php-testo/.github/blob/1.x/resources/logo-full.svg?raw=true"
44 style="width: 2in; display: block"
55 /></a>
1616
1717<br />
1818
19- ## Installation
19+ Testo is an extensible testing framework built on a lightweight core with a middleware system.
20+ It gives you full control over your testing environment while keeping the familiar PHP syntax you already know.
21+
22+
23+ ## Get Started
24+
25+ ### Installation
2026
2127``` bash
2228composer require testo/testo
@@ -27,6 +33,93 @@ composer require testo/testo
2733[ ![ License] ( https://img.shields.io/packagist/l/testo/testo.svg?style=flat-square )] ( LICENSE.md )
2834[ ![ Total Destroys] ( https://img.shields.io/packagist/dt/testo/testo.svg?style=flat-square )] ( https://packagist.org/packages/testo/testo/stats )
2935
36+ ### Configuration
37+
38+ By default, if no configuration file is provided, Testo will run tests from the ` tests ` folder.
39+
40+ To customize the configuration, create a ` testo.php ` file in the root of your project:
41+
42+ ``` php
43+ <?php
44+
45+ declare(strict_types=1);
46+
47+ use Testo\Config\ApplicationConfig;
48+ use Testo\Config\SuiteConfig;
49+ use Testo\Config\FinderConfig;
50+
51+ return new ApplicationConfig(
52+ suites: [
53+ new SuiteConfig(
54+ name: 'Unit',
55+ location: new FinderConfig(
56+ include: ['tests/Unit'],
57+ ),
58+ ),
59+ ],
60+ );
61+ ```
62+
63+ ### Running Tests
64+
65+ To run your tests, execute:
66+
67+ ``` bash
68+ vendor/bin/testo
69+ ```
70+
71+ ### Writing Your First Test
72+
73+ Create a test class in the configured test directory (e.g., ` tests/CalculatorTest.php ` ):
74+
75+ ``` php
76+ <?php
77+
78+ declare(strict_types=1);
79+
80+ namespace Tests;
81+
82+ use Testo\Assert;
83+ use Testo\Attribute\Test;
84+ use Testo\Attribute\RetryPolicy;
85+ use Testo\Attribute\ExpectException;
86+
87+ final class CalculatorTest
88+ {
89+ #[Test]
90+ public function dividesNumbers(): void
91+ {
92+ $result = 10 / 2;
93+
94+ Assert::same(5.0, $result);
95+ Assert::notSame(5, $result); // Types matter!
96+ }
97+
98+ #[Test]
99+ #[RetryPolicy(maxAttempts: 3)]
100+ public function flakyApiCall(): void
101+ {
102+ // Retries up to 3 times if test fails
103+ $response = $this->makeExternalApiCall();
104+
105+ Assert::same(200, $response->status);
106+ }
107+
108+ #[Test]
109+ #[ExpectException(\RuntimeException::class)]
110+ public function throwsException(): void
111+ {
112+ throw new \RuntimeException('Expected error');
113+ }
114+ }
115+ ```
116+
117+ What to note:
118+ - Use the ` #[Test] ` attribute to mark test methods
119+ - Test classes don't need to extend any base class
120+ - Use ` Assert ` class for assertions (` same ` , ` true ` , ` false ` , ` null ` , ` contains ` , ` instanceOf ` , etc.)
121+ - Testo provides multiple attributes to extend testing capabilities (retry policies, exception handling, and more)
122+
30123## IDE Support
31124
32125Testo comes with the [ IDEA plugin ` Testo ` ] ( https://plugins.jetbrains.com/plugin/28842-testo?noRedirect=true ) .
0 commit comments