Skip to content

Commit be50680

Browse files
committed
Remove example from readme file
1 parent 55a4bf4 commit be50680

File tree

1 file changed

+0
-87
lines changed

1 file changed

+0
-87
lines changed

README.md

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -25,93 +25,6 @@ Accurate timing and metrics collection
2525

2626
For detailed documentation, visit [https://php.volt-test.com](https://php.volt-test.com)
2727

28-
## Quick Start
29-
30-
### Installation
31-
32-
```bash
33-
git clone [email protected]:volt-test/php-sdk.git
34-
cd php-sdk
35-
composer install
36-
```
37-
38-
### Basic Usage
39-
```bash
40-
touch test.php
41-
```
42-
```php
43-
// test.php
44-
<?php
45-
require 'vendor/autoload.php';
46-
47-
use VoltTest\DataSourceConfiguration;
48-
use VoltTest\VoltTest;
49-
50-
// Create a new test
51-
$test = new VoltTest(
52-
'User Login Flow',
53-
'Tests user authentication process'
54-
);
55-
// Configure test parameters
56-
$test
57-
->setVirtualUsers(1) // number of VUs (Virtual Users)
58-
// ->setDuration('1s') // to run the test for 1 second
59-
->setHttpDebug(true); // to enable http debug mode remove it if you don't want to see the http debug
60-
61-
// Create login scenario
62-
$loginScenario = $test->scenario('User Login')
63-
->autoHandleCookies(); // this will save cookies with all requests in this scenario
64-
65-
66-
$loginScenario->step('Register')
67-
->get('http://localhost:8001/register')
68-
->extractFromRegex('csrf_token_register', 'name="_token" value="(.+?)"') // Extract the csrf token to submit a form
69-
->header('Accept', 'text/html');
70-
71-
$loginScenario->step('Submit Register')
72-
->post(
73-
'http://localhost:8001/register',
74-
'_token=${csrf_token_register}&name=Test-v&email=${email}&password=${password}&password_confirmation=${password}') // send data with extracted data and source file
75-
->header('Content-Type', 'application/x-www-form-urlencoded')
76-
->validateStatus('status validator from php',302);
77-
78-
79-
// Add first step - Get login page
80-
$loginScenario->step('get_login_page')
81-
->get('http://localhost:8001/login')
82-
->header('Accept', 'text/html')
83-
->extractFromRegex('csrf_token', 'name="_token" value="(.+?)"')
84-
->validateStatus('status validator from php',200);
85-
86-
// Add second step - Submit login
87-
$loginScenario->step('submit_login')
88-
->post(
89-
'http://localhost:8001/login',
90-
'_token=${csrf_token}&email=${email}&password=${password}')
91-
->header('Content-Type', 'application/x-www-form-urlencoded')
92-
->validateStatus('status validator from php',302);
93-
94-
95-
// Add third step - Visit dashboard
96-
$loginScenario->step('visit_dashboard')
97-
->get('http://localhost:8001/dashboard')
98-
->header('Accept', 'text/html')
99-
->validateStatus('status_code', 200);
100-
// Run the test
101-
// This will start the test and block until it completes
102-
// pass true to run() to run the test with progress and real time results
103-
$result = $test->run(true);
104-
// OR $test->run(true); to run the test with progress and real time results
105-
106-
// Access test results
107-
echo "Success Rate: " . $result->getSuccessRate() . "%\n";
108-
echo "Average Response Time: " . $result->getAvgResponseTime() . "\n";
109-
```
110-
111-
```bash
112-
php test.php
113-
```
114-
11528
## Features
11629

11730
- Cross-platform support (Windows, Linux, MacOS)

0 commit comments

Comments
 (0)