Skip to content

Commit 24bd325

Browse files
committed
Start with VitePress
0 parents  commit 24bd325

13 files changed

Lines changed: 2936 additions & 0 deletions

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/.*/
2+
!/.github/
3+
4+
# Dependencies
5+
/node_modules
6+
7+
# VitePress build output
8+
.vitepress/dist
9+
.vitepress/cache
10+
11+
# Misc
12+
.DS_Store
13+
*.local
14+
15+
# Logs
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Testo Documentation
2+
3+
Documentation site for [Testo](https://github.com/php-testo/testo) - Modern PHP Testing Framework.
4+
5+
Built with [VitePress](https://vitepress.dev/).
6+
7+
## Quick Start
8+
9+
```bash
10+
# Install dependencies
11+
npm install
12+
13+
# Start dev server
14+
npm run dev
15+
16+
# Build for production
17+
npm run build
18+
19+
# Preview production build
20+
npm run preview
21+
```
22+
23+
Dev server runs at `http://localhost:5173/`
24+
25+
## Project Structure
26+
27+
```
28+
docs/
29+
├── .vitepress/
30+
│ └── config.mts # VitePress configuration
31+
├── pages/
32+
│ ├── en/ # Landing page (English) -> /
33+
│ └── ru/ # Landing page (Russian) -> /ru/
34+
├── docs/
35+
│ ├── en/ # Documentation (English)
36+
│ └── ru/ # Documentation (Russian)
37+
├── blog/
38+
│ ├── en/ # Blog articles (English)
39+
│ └── ru/ # Blog articles (Russian)
40+
└── public/ # Static assets (logo, images)
41+
```
42+
43+
## Adding Content
44+
45+
### New documentation page
46+
47+
1. Create `docs/en/my-page.md` and `docs/ru/my-page.md`
48+
2. Add to sidebar in `.vitepress/config.mts`
49+
50+
### New blog post
51+
52+
1. Create `blog/en/my-post.md` and `blog/ru/my-post.md`
53+
2. Add link to `blog/en/index.md` and `blog/ru/index.md`
54+
55+
## Deployment
56+
57+
```bash
58+
npm run build
59+
```
60+
61+
Output is in `.vitepress/dist/` - deploy to any static hosting.

blog/en/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Blog
2+
3+
Latest news and articles about Testo.
4+
5+
## Articles
6+
7+
- [Introducing Testo 1.0](./introducing-testo-1-0) - The first stable release of Testo

blog/en/introducing-testo-1-0.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Introducing Testo 1.0
2+
3+
We are excited to announce the first stable release of Testo - a modern PHP testing framework designed for simplicity and speed.
4+
5+
## Why Testo?
6+
7+
PHP testing has come a long way, but we felt there was room for something new. Testo was built with these goals in mind:
8+
9+
- **Developer Experience First** - Writing tests should feel natural and enjoyable
10+
- **Speed** - Parallel execution out of the box for faster feedback loops
11+
- **Modern PHP** - Built for PHP 8.1+ with full support for attributes and fibers
12+
13+
## Key Features
14+
15+
### Simple Test Syntax
16+
17+
```php
18+
test('user can be created', function () {
19+
$user = new User('John');
20+
21+
expect($user->name)->toBe('John');
22+
expect($user->isActive())->toBeTrue();
23+
});
24+
```
25+
26+
### Rich Assertions
27+
28+
Testo comes with a comprehensive assertion library:
29+
30+
```php
31+
expect($value)->toBe(42);
32+
expect($array)->toContain('item');
33+
expect($string)->toMatch('/pattern/');
34+
expect($callable)->toThrow(Exception::class);
35+
```
36+
37+
### Parallel Execution
38+
39+
Run tests in parallel to speed up your test suite:
40+
41+
```bash
42+
vendor/bin/testo --parallel
43+
```
44+
45+
## Getting Started
46+
47+
Install Testo via Composer:
48+
49+
```bash
50+
composer require --dev php-testo/testo
51+
```
52+
53+
Check out the [Getting Started](/docs/en/getting-started) guide for more details.
54+
55+
## What's Next?
56+
57+
This is just the beginning. We have exciting features planned:
58+
59+
- IDE plugins for PHPStorm and VS Code
60+
- Code coverage reporting
61+
- Snapshot testing
62+
- And much more!
63+
64+
Join us on [GitHub](https://github.com/php-testo/testo) and be part of the journey.

blog/ru/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Блог
2+
3+
Новости и статьи о Testo.
4+
5+
## Статьи
6+
7+
- [Представляем Testo 1.0](./introducing-testo-1-0) - Первый стабильный релиз Testo

blog/ru/introducing-testo-1-0.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Представляем Testo 1.0
2+
3+
Мы рады объявить о выходе первого стабильного релиза Testo - современного фреймворка для тестирования PHP, созданного для простоты и скорости.
4+
5+
## Почему Testo?
6+
7+
Тестирование в PHP прошло долгий путь, но мы почувствовали, что есть место для чего-то нового. Testo был создан с этими целями:
8+
9+
- **Опыт разработчика на первом месте** - Написание тестов должно быть естественным и приятным
10+
- **Скорость** - Параллельное выполнение из коробки для быстрой обратной связи
11+
- **Современный PHP** - Создан для PHP 8.1+ с полной поддержкой атрибутов и файберов
12+
13+
## Ключевые возможности
14+
15+
### Простой синтаксис тестов
16+
17+
```php
18+
test('пользователь может быть создан', function () {
19+
$user = new User('Иван');
20+
21+
expect($user->name)->toBe('Иван');
22+
expect($user->isActive())->toBeTrue();
23+
});
24+
```
25+
26+
### Богатые утверждения
27+
28+
Testo поставляется с полной библиотекой утверждений:
29+
30+
```php
31+
expect($value)->toBe(42);
32+
expect($array)->toContain('item');
33+
expect($string)->toMatch('/pattern/');
34+
expect($callable)->toThrow(Exception::class);
35+
```
36+
37+
### Параллельное выполнение
38+
39+
Запускайте тесты параллельно для ускорения:
40+
41+
```bash
42+
vendor/bin/testo --parallel
43+
```
44+
45+
## Начало работы
46+
47+
Установите Testo через Composer:
48+
49+
```bash
50+
composer require --dev php-testo/testo
51+
```
52+
53+
Смотрите руководство [Начало работы](/docs/ru/getting-started) для подробностей.
54+
55+
## Что дальше?
56+
57+
Это только начало. У нас запланированы интересные возможности:
58+
59+
- Плагины для PHPStorm и VS Code
60+
- Отчёты о покрытии кода
61+
- Snapshot-тестирование
62+
- И многое другое!
63+
64+
Присоединяйтесь к нам на [GitHub](https://github.com/php-testo/testo) и станьте частью путешествия.

docs/en/getting-started.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Getting Started
2+
3+
This guide will help you get started with Testo in your PHP project.
4+
5+
## Installation
6+
7+
Install Testo via Composer:
8+
9+
```bash
10+
composer require --dev php-testo/testo
11+
```
12+
13+
## Writing Your First Test
14+
15+
Create a test file in your `tests` directory:
16+
17+
```php
18+
<?php
19+
20+
use function Testo\{test, expect};
21+
22+
test('basic math works', function () {
23+
expect(1 + 1)->toBe(2);
24+
});
25+
26+
test('strings can be concatenated', function () {
27+
$greeting = 'Hello, ' . 'World!';
28+
expect($greeting)->toBe('Hello, World!');
29+
});
30+
```
31+
32+
## Running Tests
33+
34+
Run your tests using the Testo CLI:
35+
36+
```bash
37+
vendor/bin/testo
38+
```
39+
40+
You should see output like:
41+
42+
```
43+
PASS tests/ExampleTest.php
44+
✓ basic math works
45+
✓ strings can be concatenated
46+
47+
Tests: 2 passed
48+
Time: 0.05s
49+
```
50+
51+
## Next Steps
52+
53+
- Learn about [Assertions](/docs/en/assertions)
54+
- Explore [Test Organization](/docs/en/organizing-tests)
55+
- Configure [Parallel Execution](/docs/en/parallel)

docs/ru/getting-started.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Начало работы
2+
3+
Это руководство поможет вам начать работу с Testo в вашем PHP проекте.
4+
5+
## Установка
6+
7+
Установите Testo через Composer:
8+
9+
```bash
10+
composer require --dev php-testo/testo
11+
```
12+
13+
## Написание первого теста
14+
15+
Создайте файл теста в директории `tests`:
16+
17+
```php
18+
<?php
19+
20+
use function Testo\{test, expect};
21+
22+
test('базовая математика работает', function () {
23+
expect(1 + 1)->toBe(2);
24+
});
25+
26+
test('строки можно объединять', function () {
27+
$greeting = 'Привет, ' . 'Мир!';
28+
expect($greeting)->toBe('Привет, Мир!');
29+
});
30+
```
31+
32+
## Запуск тестов
33+
34+
Запустите тесты с помощью CLI Testo:
35+
36+
```bash
37+
vendor/bin/testo
38+
```
39+
40+
Вы увидите вывод:
41+
42+
```
43+
PASS tests/ExampleTest.php
44+
✓ базовая математика работает
45+
✓ строки можно объединять
46+
47+
Tests: 2 passed
48+
Time: 0.05s
49+
```
50+
51+
## Следующие шаги
52+
53+
- Изучите [Утверждения](/docs/ru/assertions)
54+
- Узнайте про [Организацию тестов](/docs/ru/organizing-tests)
55+
- Настройте [Параллельное выполнение](/docs/ru/parallel)

0 commit comments

Comments
 (0)