Skip to content

Commit 757aab7

Browse files
committed
Add 'Source' test suite configuration and update documentation
1 parent f892833 commit 757aab7

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

docs/getting-started.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,18 @@ return new ApplicationConfig(
4343
include: ['tests/Unit'],
4444
),
4545
),
46+
new SuiteConfig(
47+
name: 'Source',
48+
location: new FinderConfig(
49+
include: ['src'],
50+
),
51+
),
4652
],
4753
);
4854
```
4955

56+
In this example we defined two test suites: `Unit` for unit tests located in `tests/Unit`, and `Source` for [inline tests](inline-tests.md) and benchmarks right in the source code in the `src` folder.
57+
5058
## Writing Your First Test
5159

5260
Create a test class in the configured test directory (e.g., `tests/CalculatorTest.php`):

ru/docs/getting-started.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,18 @@ return new ApplicationConfig(
3838
include: ['tests/Unit'],
3939
),
4040
),
41+
new SuiteConfig(
42+
name: 'Source',
43+
location: new FinderConfig(
44+
include: ['src'],
45+
),
46+
),
4147
],
4248
);
4349
```
4450

51+
В этом примере мы определили два набора тестов: `Unit` для юнит-тестов, расположенных в `tests/Unit`, и `Source` для [встроенных тестов](inline-tests.md) и бенчмарков прямо в коде в папке `src`.
52+
4553
## Написание первого теста
4654

4755
Создайте тестовый класс в настроенной директории (например, `tests/CalculatorTest.php`):
@@ -90,7 +98,7 @@ final class CalculatorTest
9098

9199
### Ключевые моменты
92100

93-
- Атрибут `#[Test]` помечает тестовые методы, при этом классам не нужно наследовать базовый класс. Подробнее в разделе [Пишем тесты](./writing-tests).
101+
- Атрибут `#[Test]` помечает тестовые методы, при этом классам не нужно наследоваться от базового класса. Подробнее в разделе [Пишем тесты](./writing-tests).
94102
- Используйте фасад `Assert` для утверждений и `Expect` для ожиданий.
95103
- Testo предоставляет множество атрибутов для расширения возможностей тестирования (политики повторов, обработка исключений и другое).
96104

0 commit comments

Comments
 (0)