Download the PHP package volt-test/laravel-performance-testing without Composer

On this page you can find all versions of the php package volt-test/laravel-performance-testing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-performance-testing

Laravel Performance Testing

A Laravel package for performance testing with the VoltTest PHP SDK. Easily create and run load tests for your Laravel applications with built-in route discovery, CSRF handling, and comprehensive reporting.

This package is built on top of the VoltTest PHP SDK and provides a seamless Laravel integration layer with additional Laravel-specific features like automatic route discovery, CSRF token handling, and Artisan commands.

For more information about the core VoltTest functionality, visit php.volt-test.com.

Latest Version on Packagist Total Downloads GitHub Tests Action Status

Table of Contents

About Laravel Performance Testing VoltTest

This Laravel package extends the VoltTest PHP SDK with Laravel-specific functionality. While the core VoltTest PHP SDK provides the foundation for performance testing, this package adds:

For comprehensive documentation about VoltTest core features, load testing concepts, and advanced configuration options, please visit php.volt-test.com.

Requirements

Features

Installation

You can install the package via Composer:

The package will automatically register its service provider.

Publish the configuration file:

Configuration

The configuration file config/volttest.php contains all the settings for your performance tests:

Quick Start

1. Create Your First Test

Generate a new performance test with route discovery:

This creates a test class at app/VoltTests/UserTest.php:

2. Run Your Test

Execute the performance test:

Or run all tests:

3. Direct URL Testing

Test any URL directly without creating a test class:

Creating Tests

Using Route Discovery

Generate tests with automatic route discovery:

Manual Test Creation

Create a test class manually:

API Testing

Create API-focused tests:

Available Methods

Scenario Methods

Headers Data

Assertions

Extracting Data

Running Tests

Command Syntax

Arguments

Available Options

Option Description Example
--path= Path to search for test classes --path=tests/Performance
--debug Enable HTTP debugging --debug
--users= Number of virtual users (default: 10) --users=50
--duration= Test duration (optional) --duration=2m
--stream Stream test output to console --stream
--url Treat the test argument as a URL for direct load testing --url
--method= HTTP method for URL testing (default: GET) --method=POST
--headers= JSON string of headers for URL testing --headers='{"Authorization":"Bearer token"}'
--body= Request body for URL testing (for POST/PUT) --body='{"name":"John"}'
--content-type= Content type for URL testing --content-type=application/json
--code-status= Expected HTTP status code for URL testing (default: 200) --code-status=201
--scenario-name= Custom scenario name for URL testing --scenario-name="API Load Test"

Basic Execution

Duration Formats

The --duration option accepts various time formats:

Header Formats

The --headers option accepts JSON format:

Body Formats

The --body option supports different formats depending on content type:

Advanced Options

Reports

Console Output

Test results are displayed in the console with metrics including:

Saved Reports

Reports are automatically saved as JSON files in storage/volttest/reports/:

CSV Data Sources

Load dynamic test data from CSV files for more realistic and scalable performance testing scenarios.

Quick Example

  1. Create a CSV file at storage/volttest/data/users.csv:

  2. Use the data in your test:

Distribution Modes

📖 Complete CSV Documentation

For detailed information including:

Read the complete CSV Data Source guide →

PHPUnit Integration

Run VoltTest performance tests within your PHPUnit test suite with automated server management and comprehensive performance assertions.

Configuration

To enable console reporting of performance metrics, you must register the VoltTest extension in your phpunit.xml file:

Quick Example

Key Features

Available Assertions

Quick Load Testing Helpers

Reusing Existing VoltTest Classes

You can reuse your existing VoltTest classes in PHPUnit tests for maximum code reuse:

VoltTest Class (app/VoltTests/RegistrationTest.php):

PHPUnit Test (tests/Performance/RegistrationPerformanceTest.php):

Benefits: Define scenarios once, run via Artisan (php artisan volttest:run RegistrationTest) or PHPUnit with assertions.

Running PHPUnit Tests

📖 Complete PHPUnit Documentation

For detailed information including:

Read the complete PHPUnit Integration guide →

Testing Tips

Best Practices

  1. Start Small: Begin with a few virtual users and gradually increase
  2. Watch Server Resources: Monitor CPU, memory, and database connections
  3. Use Realistic Data: Incorporate CSV data sources for authentic testing
  4. Extract and Reuse: Extract tokens and IDs for multi-step scenarios
  5. Separate Concerns: Create multiple test classes for different features
  6. Include Think Time: Add realistic pauses between user actions
  7. Test API and UI: Cover both API endpoints and web interfaces

Optimizing Tests

  1. Increase Virtual Users Gradually: Start with 10-20 users and double until performance degrades
  2. Add Ramp-up Time: Allow virtual users to start gradually with --ramp-up=30s
  3. Use CSV Data Sources: Avoid hard-coding test data by using CSV files
  4. Cache CSRF Tokens: Extract tokens once and reuse where possible
  5. Focus on Critical Paths: Test your most important user journeys first

Troubleshooting

Common Issues

Connection Errors

Authentication Failures

CSRF Token Issues

Content Type Problems

Incorrect Parsing of Response Data

Rate Limiting

Debug Commands

Learn More

For more information about VoltTest and performance testing with Laravel, check out:

If you have questions, suggestions, or need help, please open an issue on our GitHub repository.

License

This Laravel package is open-sourced software licensed under the MIT license.

Changelog

Please see CHANGELOG for more information on what has changed recently.


All versions of laravel-performance-testing with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0|^13.0
volt-test/php-sdk Version ^1.2
ext-pcntl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package volt-test/laravel-performance-testing contains the following files

Loading the files please wait ...