Skip to content

Commit 409dca1

Browse files
committed
Update testing docs based on review
1 parent 9f89dfb commit 409dca1

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

docs/DEVELOPER_GUIDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Follow the steps in [Creating a New Experiment](#creating-a-new-experiment) abov
302302

303303
### 3. Write Tests
304304

305-
Add or update tests for your experiment in the existing integration suite under `tests/Integration/`:
305+
Add or update tests for your code in the existing test suite under `tests/Integration/`:
306306

307307
```php
308308
<?php
@@ -326,7 +326,8 @@ class My_Experiment_Test extends WP_UnitTestCase {
326326
Before submitting, ensure all quality checks pass. See [CONTRIBUTING.md](../CONTRIBUTING.md) for the complete list of required checks including:
327327
- Coding standards validation
328328
- Static analysis
329-
- Integration tests
329+
- Unit tests
330+
- E2E tests
330331

331332
### 5. Submit Pull Request
332333

docs/TESTING.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,27 @@ This document outlines the testing philosophy and strategy for the AI plugin, ad
1717

1818
## Test Categories
1919

20-
### 1. Unit Tests (Logic Layer)
21-
22-
**Purpose**: Test pure functions and business logic in isolation, without loading the WordPress environment.
23-
24-
### 2. Integration Tests (WordPress + Plugin Interactions)
20+
### 1. Unit Tests (WordPress + Plugin Interactions)
2521

2622
**Purpose**: Test interactions between different parts of the plugin, and between the plugin and WordPress core, database, or other plugin components. These tests run within a WordPress test environment.
2723

2824
**Location**: `tests/Integration/`
2925

30-
**Example Test Suite**: `tests/Integration/Includes/BootstrapTest.php`
26+
**Example Test Suite**: `tests/Integration/Includes/MainTest.php`
3127

3228
```php
33-
class BootstrapTest extends WP_UnitTestCase {
29+
class MainTest extends WP_UnitTestCase {
3430

3531
/**
36-
* Test that the plugin bootstrap file exists.
32+
* Test that the plugin main file exists.
3733
*/
38-
public function test_bootstrap_file_exists() {
39-
$this->assertFileExists( dirname( __DIR__, 3 ) . '/includes/bootstrap.php' );
34+
public function test_main_file_exists() {
35+
$this->assertFileExists( dirname( __DIR__, 3 ) . '/includes/Main.php' );
4036
}
4137
}
4238
```
4339

44-
### 3. Edge Cases and Error Scenarios
40+
### 2. Edge Cases and Error Scenarios
4541

4642
While specific examples are provided in the "Post Duplication Feature" strategy, for our plugin, we would focus on:
4743

@@ -67,13 +63,11 @@ composer phpstan
6763
# Run the current PHPUnit suite defined in phpunit.xml.dist
6864
vendor/bin/phpunit -c phpunit.xml.dist
6965

70-
# Run the current integration suite directly
71-
vendor/bin/phpunit -c phpunit.xml.dist --testsuite integration
7266
```
7367

7468
### CI/CD Pipeline
7569

76-
Automated testing in CI should run the currently configured integration and end-to-end suites on every push and pull request. If a dedicated unit test suite is introduced later, it should be added to the pipeline as well.
70+
Automated testing in CI should run the currently configured unit and end-to-end suites on every push and pull request.
7771

7872
---
7973

0 commit comments

Comments
 (0)