You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/1-essentials/07-testing.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ composer phpunit
22
22
23
23
## Test-specific discovery locations
24
24
25
-
Tempest will only discover non-dev namespaces defined in composer.json automatically. That means that `{:hl-keyword:require-dev:}` namespaces aren't discovered automatically. Whenever you need Tempest to discover test-specific locations, you may specify them within the `discoverTestLocations()` method of the provided `IntegrationTestCase` class.
25
+
Tempest will only discover non-dev namespaces defined in composer.json automatically. That means that `{:hl-keyword:require-dev:}` namespaces aren't discovered automatically. Whenever you need Tempest to discover test-specific locations, you may specify them within the `discoverTestLocations()` method of the provided `IntegrationTest` class.
26
26
27
27
On top of that, Tempest _will_ look for files in the `tests/Fixtures` directory and discover them by default. You can override this behavior by providing your own implementation of `discoverTestLocations()`, where you can return an array of `DiscoveryLocation` objects (or nothing).
28
28
@@ -46,7 +46,7 @@ final class HomeControllerTest extends IntegrationTest
46
46
If you want to test code that interacts with the database, your test class can call the `setupDatabase()` method. This method will create and migrate a clean database for you on the fly.
47
47
48
48
```php
49
-
class TodoControllerTest extends IntegrationTestCase
49
+
class TodoControllerTest extends IntegrationTest
50
50
{
51
51
protected function setUp(): void
52
52
{
@@ -72,7 +72,7 @@ return new SQLiteConfig(
72
72
By default, no tables will be migrated. You can choose to provide a list of migrations that will be run for every test that calls `setupDatabase()`, or you can run specific migrations on a per-test basis.
73
73
74
74
```php
75
-
class TodoControllerTest extends IntegrationTestCase
75
+
class TodoControllerTest extends IntegrationTest
76
76
{
77
77
protected function migrateDatabase(): void
78
78
{
@@ -85,7 +85,7 @@ class TodoControllerTest extends IntegrationTestCase
85
85
```
86
86
87
87
```php
88
-
class TodoControllerTest extends IntegrationTestCase
88
+
class TodoControllerTest extends IntegrationTest
89
89
{
90
90
public function test_create_todo(): void
91
91
{
@@ -101,7 +101,7 @@ class TodoControllerTest extends IntegrationTestCase
101
101
102
102
## Tester utilities
103
103
104
-
The `IntegrationTestCase` provides several utilities to make testing easier. You can read the details about each tester utility on the documentation page of its respective component. For example, there's the [http tester](../1-essentials/01-routing.md#testing) that helps you test HTTP requests:
104
+
The `IntegrationTest` provides several utilities to make testing easier. You can read the details about each tester utility on the documentation page of its respective component. For example, there's the [http tester](../1-essentials/01-routing.md#testing) that helps you test HTTP requests:
105
105
106
106
```php
107
107
$this->http
@@ -157,7 +157,7 @@ The next step is to create a `tests/Pest.php` file, which will instruct Pest how
0 commit comments