Skip to content

Commit

Permalink
Merge pull request #245 from nahime0/stress-methods
Browse files Browse the repository at this point in the history
feat(methods): Documented stressless new option to specify the http method
  • Loading branch information
nunomaduro authored Nov 27, 2023
2 parents 6e576d4 + f94664d commit e2e84b9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions stress-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ The concurrency value represents the number of concurrent requests that will be

You may want to be mindful of the number of concurrent requests you configure. If you configure too many concurrent requests, you may overwhelm your application, server or hit rate limits / firewalls.

If you want to specify the http method used for the stress test, you can use the provided `get` and `post` options. Using the `--post` option, you can specify as argument the payload to be used in the requests:

```bash
./vendor/bin/pest stress example --post='{"name": "Nuno"}'
```

Once the stress test is completed, Pest will display a summary of the stress test result.

<a name="the-stress-function"></a>
Expand Down Expand Up @@ -94,6 +100,15 @@ $result = stress('example.com')->dd();
//->verbosely();
```

If you want to specify the http method used for the stress test, you can use the provided `get` and `post` methods.

```php
$result = stress('example.com')->get();
// or
$result = stress('example.com')->post(['name' => 'Nuno']);
```

If you are using the POST http method, remember to pass to the `post` method the payload to be used in the requests.

The `stress()` function return the stress test result, which you can use to set expectations. Here is the list of available methods:

Expand Down

0 comments on commit e2e84b9

Please sign in to comment.