Skip to content

Commit fed4dc2

Browse files
committed
Remove namespaces from samples
1 parent e832c8e commit fed4dc2

12 files changed

Lines changed: 12 additions & 76 deletions

docs/data-providers.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ Data providers let you run one test with different sets of input data. Each set
77
The simplest way — specify data directly above the method:
88

99
```php
10-
use Testo\Attribute\Test;
11-
use Testo\Attribute\DataSet;
12-
1310
#[Test]
1411
#[DataSet([1, 1, 2])]
1512
#[DataSet([2, 3, 5])]
@@ -38,9 +35,6 @@ public function testSum(int $a, int $b, int $expected): void { ... }
3835
For large amounts of data or dynamic generation, use `DataProvider`. It accepts a method or callable that returns test data:
3936

4037
```php
41-
use Testo\Attribute\Test;
42-
use Testo\Sample\DataProvider;
43-
4438
#[Test]
4539
#[DataProvider('userDataProvider')]
4640
public function testUserValidation(string $email, bool $expected): void

docs/events.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ Event characteristics:
1717
Register listeners via `EventListenerCollector` interface in your plugins. See [plugins](./plugins.md) for plugin development.
1818

1919
```php
20-
use Testo\Config\EventListenerCollector;
21-
use Testo\Test\Event\Test\TestFinished;
22-
2320
class MyPlugin
2421
{
2522
public function configure(EventListenerCollector $events): void
@@ -133,8 +130,6 @@ Since events are classes, you can listen to parent classes or interfaces to hand
133130
### Listen to All Test Events
134131

135132
```php
136-
use Testo\Test\Event\Test\TestEvent;
137-
138133
$events->addListener(TestEvent::class, function (TestEvent $event) {
139134
// Fires for: TestStarting, TestFinished, TestRetrying, TestBatchStarting, etc.
140135
$this->logger->debug("Test event: " . get_class($event));
@@ -144,8 +139,6 @@ $events->addListener(TestEvent::class, function (TestEvent $event) {
144139
### Listen to All Events with Results
145140

146141
```php
147-
use Testo\Test\Event\Test\TestResultEvent;
148-
149142
$events->addListener(TestResultEvent::class, function (TestResultEvent $event) {
150143
// Fires for: TestFinished, TestBatchFinished, TestPipelineFinished
151144
if ($event->testResult->isFailed()) {
@@ -157,8 +150,6 @@ $events->addListener(TestResultEvent::class, function (TestResultEvent $event) {
157150
### Listen to All Test Case Events
158151

159152
```php
160-
use Testo\Test\Event\TestCase\TestCaseEvent;
161-
162153
$events->addListener(TestCaseEvent::class, function (TestCaseEvent $event) {
163154
// Fires for all TestCase* events (test case level)
164155
$this->trackCase($event->caseInfo);

docs/filtering.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Testo provides a flexible filtering system that operates in multiple stages to p
1111
The `Testo\Common\Filter` class is an immutable DTO containing test filtering criteria:
1212

1313
```php
14-
use Testo\Common\Filter;
15-
1614
$filter = new Filter(
1715
suites: ['Unit', 'Integration'],
1816
names: ['UserTest::testLogin', 'testAuthentication'],
@@ -47,9 +45,6 @@ $filter = new Filter(
4745
The `Filter` object can be passed to `Application::run()`:
4846

4947
```php
50-
use Testo\Application;
51-
use Testo\Common\Filter;
52-
5348
$app = Application::createFromInput(/* ... */);
5449

5550
$filter = new Filter(

docs/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ To customize the configuration, create a `testo.php` file in the root of your pr
2727

2828
declare(strict_types=1);
2929

30-
use Testo\Config\ApplicationConfig;
31-
use Testo\Config\SuiteConfig;
32-
use Testo\Config\FinderConfig;
30+
use Testo\Application\Config\ApplicationConfig;
31+
use Testo\Application\Config\SuiteConfig;
32+
use Testo\Application\Config\FinderConfig;
3333

3434
return new ApplicationConfig(
3535
suites: [
@@ -55,9 +55,9 @@ declare(strict_types=1);
5555
namespace Tests;
5656

5757
use Testo\Assert;
58-
use Testo\Attribute\Test;
59-
use Testo\Attribute\RetryPolicy;
60-
use Testo\Attribute\ExpectException;
58+
use Testo\Assert\ExpectException;
59+
use Testo\Application\Attribute\Test;
60+
use Testo\Retry\RetryPolicy;
6161

6262
final class CalculatorTest
6363
{

docs/inline-tests.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Inline tests let you write test cases directly on the method being tested using the `#[TestInline]` attribute. No separate test class needed.
44

55
```php
6-
use Testo\Sample\TestInline;
7-
86
#[TestInline([1, 1], 2)]
97
#[TestInline([40, 2], 42)]
108
#[TestInline([-5, 5], 0)]
@@ -80,8 +78,6 @@ private function calculateFinalPrice(
8078
For complex checks, pass a closure as the second parameter:
8179

8280
```php
83-
use Testo\Assert;
84-
8581
#[TestInline([10, 3], fn($r) => Assert::greaterThan(3, $r))]
8682
public function divide(int $a, int $b): float
8783
{
@@ -109,8 +105,6 @@ public function createUser(string $email): User
109105
In PHP 8.6 this becomes even more elegant with [partial application](https://wiki.php.net/rfc/partial_function_application_v2):
110106

111107
```php
112-
use Testo\Assert;
113-
114108
#[TestInline([10, 3], Assert::greaterThan(3, ?))]
115109
public function divide(int $a, int $b): float
116110
{

docs/lifecycle.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ AfterAll (once)
6767
## Basic Example
6868

6969
```php
70-
use Testo\Attribute\Test;
71-
use Testo\Attribute\BeforeEach;
72-
use Testo\Attribute\AfterEach;
73-
use Testo\Attribute\BeforeAll;
74-
use Testo\Attribute\AfterAll;
75-
7670
final class DatabaseTest
7771
{
7872
private static Connection $connection;

ru/docs/data-providers.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
Самый простой способ — указать данные прямо над методом:
88

99
```php
10-
use Testo\Attribute\Test;
11-
use Testo\Attribute\DataSet;
12-
1310
#[Test]
1411
#[DataSet([1, 1, 2])]
1512
#[DataSet([2, 3, 5])]
@@ -38,9 +35,6 @@ public function testSum(int $a, int $b, int $expected): void { ... }
3835
Для большого количества данных или динамической генерации используйте `DataProvider`. Он принимает метод или вызываемый объект, который возвращает тестовые данные:
3936

4037
```php
41-
use Testo\Attribute\Test;
42-
use Testo\Sample\DataProvider;
43-
4438
#[Test]
4539
#[DataProvider('userDataProvider')]
4640
public function testUserValidation(string $email, bool $expected): void

ru/docs/events.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ Testo генерирует события на протяжении всего
1717
Регистрируйте слушателей через интерфейс `EventListenerCollector` в ваших плагинах. См. [плагины](./plugins.md) для разработки плагинов.
1818

1919
```php
20-
use Testo\Config\EventListenerCollector;
21-
use Testo\Test\Event\Test\TestFinished;
22-
2320
class MyPlugin
2421
{
2522
public function configure(EventListenerCollector $events): void
@@ -133,8 +130,6 @@ TestPipelineFinished # После перехватчиков тест
133130
### Слушать все события теста
134131

135132
```php
136-
use Testo\Test\Event\Test\TestEvent;
137-
138133
$events->addListener(TestEvent::class, function (TestEvent $event) {
139134
// Срабатывает для: TestStarting, TestFinished, TestRetrying, TestBatchStarting, и т.д.
140135
$this->logger->debug("Test event: " . get_class($event));
@@ -144,8 +139,6 @@ $events->addListener(TestEvent::class, function (TestEvent $event) {
144139
### Слушать все события с результатами
145140

146141
```php
147-
use Testo\Test\Event\Test\TestResultEvent;
148-
149142
$events->addListener(TestResultEvent::class, function (TestResultEvent $event) {
150143
// Срабатывает для: TestFinished, TestBatchFinished, TestPipelineFinished
151144
if ($event->testResult->isFailed()) {
@@ -157,8 +150,6 @@ $events->addListener(TestResultEvent::class, function (TestResultEvent $event) {
157150
### Слушать все события Test Case
158151

159152
```php
160-
use Testo\Test\Event\TestCase\TestCaseEvent;
161-
162153
$events->addListener(TestCaseEvent::class, function (TestCaseEvent $event) {
163154
// Срабатывает для всех событий TestCase* (уровень Test Case)
164155
$this->trackCase($event->caseInfo);

ru/docs/filtering.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Testo предоставляет гибкую систему фильтраци
1111
Класс `Testo\Common\Filter` представляет собой неизменяемый DTO, содержащий критерии фильтрации тестов:
1212

1313
```php
14-
use Testo\Common\Filter;
15-
1614
$filter = new Filter(
1715
suites: ['Unit', 'Integration'],
1816
names: ['UserTest::testLogin', 'testAuthentication'],
@@ -47,9 +45,6 @@ $filter = new Filter(
4745
Объект `Filter` может быть передан в `Application::run()`:
4846

4947
```php
50-
use Testo\Application;
51-
use Testo\Common\Filter;
52-
5348
$app = Application::createFromInput(/* ... */);
5449

5550
$filter = new Filter(

ru/docs/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ composer require --dev testo/testo
2626

2727
declare(strict_types=1);
2828

29-
use Testo\Config\ApplicationConfig;
30-
use Testo\Config\SuiteConfig;
31-
use Testo\Config\FinderConfig;
29+
use Testo\Application\Config\ApplicationConfig;
30+
use Testo\Application\Config\SuiteConfig;
31+
use Testo\Application\Config\FinderConfig;
3232

3333
return new ApplicationConfig(
3434
suites: [
@@ -54,9 +54,9 @@ declare(strict_types=1);
5454
namespace Tests;
5555

5656
use Testo\Assert;
57-
use Testo\Attribute\Test;
58-
use Testo\Attribute\RetryPolicy;
59-
use Testo\Attribute\ExpectException;
57+
use Testo\Assert\ExpectException;
58+
use Testo\Application\Attribute\Test;
59+
use Testo\Retry\RetryPolicy;
6060

6161
final class CalculatorTest
6262
{

0 commit comments

Comments
 (0)