From 8ab759c0812f4097da74349aebe83e710f031d59 Mon Sep 17 00:00:00 2001 From: elwafa Date: Fri, 11 Sep 2026 15:55:28 +0300 Subject: [PATCH 1/4] Release 1.2.2: engine v1.2.2, PHP 8.5 compatibility - Pin engine binary to v1.2.2, which raises the cloud API response cap from 1 MB to 32 MB so large embedded CSV data sources no longer fail with "unexpected end of JSON input" when creating or looking up tests - ErrorHandler: ignore E_DEPRECATED/E_USER_DEPRECATED and respect error_reporting(), so deprecations no longer abort a test run - Platform: drop curl_close() calls (no-op since PHP 8.0, deprecated in 8.5); the first engine download crashed on PHP 8.5 because of them - Bump package version to 1.2.2 --- README.md | 2 +- composer.json | 2 +- src/Exceptions/ErrorHandler.php | 6 ++++++ src/Platform.php | 7 +++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9859219..5666b07 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It combines PHP’s simplicity with Go’s speed and concurrency, allowing you t - [x] **Think Time & Ramp-Up Configuration** – Simulate real-user behavior. - [x] **Detailed Reports & Distributed Execution** – Scale tests and analyze results. - [x] **Debug Requests** - Inspect and troubleshoot request/response payloads easily. -- [ ] **Cloud Execution** – Seamless cloud-based testing in progress. +- [x] **Cloud Execution** – Seamless cloud-based testing in progress. ## Architecture diff --git a/composer.json b/composer.json index b947f28..9538760 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "volt-test/php-sdk", "description": "Volt Test PHP SDK - A performance testing tool for PHP Developers", "type": "library", - "version": "1.2.1", + "version": "1.2.2", "keywords": [ "volt-test", "php-sdk", diff --git a/src/Exceptions/ErrorHandler.php b/src/Exceptions/ErrorHandler.php index 29b0beb..302acc4 100644 --- a/src/Exceptions/ErrorHandler.php +++ b/src/Exceptions/ErrorHandler.php @@ -19,6 +19,12 @@ public static function register(): void public static function handleError(int $errno, string $errstr, string $errfile, int $errline): bool { + // Deprecations (e.g. curl_close() on PHP 8.5) and errors silenced with @ + // or excluded by error_reporting() must not abort a test run. + if (($errno & (E_DEPRECATED | E_USER_DEPRECATED)) !== 0 || (error_reporting() & $errno) === 0) { + return false; + } + throw new \ErrorException( $errstr, $errno, diff --git a/src/Platform.php b/src/Platform.php index 6e00dd9..621e3a1 100644 --- a/src/Platform.php +++ b/src/Platform.php @@ -6,7 +6,7 @@ class Platform { private const BINARY_NAME = 'volt-test'; - private const ENGINE_CURRENT_VERSION = 'v1.2.1'; + private const ENGINE_CURRENT_VERSION = 'v1.2.2'; private const BASE_DOWNLOAD_URL = 'https://github.com/volt-test/binaries/releases/download'; private const SUPPORTED_PLATFORMS = [ 'linux-amd64' => 'volt-test-linux-amd64', @@ -133,8 +133,6 @@ public static function installBinary($testing = false): void $fp = fopen($tempFile, 'w'); if ($fp === false) { - curl_close($ch); - throw new \RuntimeException("Failed to open temporary file for writing"); } @@ -157,7 +155,8 @@ public static function installBinary($testing = false): void throw new \RuntimeException("HTTP request failed with status $httpCode"); } - curl_close($ch); + // curl_close() is a no-op since PHP 8.0 and deprecated in 8.5; the + // handle is released when $ch goes out of scope. fclose($fp); if (! file_exists($tempFile) || filesize($tempFile) === 0) { From c1e0fe937f03469b5f16080ae0d54f53586a3676 Mon Sep 17 00:00:00 2001 From: elwafa Date: Fri, 11 Sep 2026 16:12:57 +0300 Subject: [PATCH 2/4] =?UTF-8?q?Require=20PHP=208.2+,=20test=20on=208.2?= =?UTF-8?q?=E2=80=938.5=20in=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - composer.json: php ^8.0 -> ^8.2; PHP 8.0 and 8.1 are end-of-life and PHPUnit 11 cannot run on them. README requirement updated. - CI: install PHP from the matrix via setup-php (the previous apt/brew steps always installed 8.2, so the listed versions were never exercised) and add 8.5; drop the unused Composer bootstrap step. --- .github/workflows/ci.yml | 42 +++++++++++----------------------------- README.md | 2 +- composer.json | 2 +- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42a6558..4e3afb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,27 +17,20 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - php: [8.0 ,8.1 ,8.2, 8.3, 8.4] + php: ['8.2', '8.3', '8.4', '8.5'] steps: - uses: actions/checkout@v4 - # PHP installation and setup using built-in tools - - name: Setup PHP (Ubuntu) - if: matrix.os == 'ubuntu-latest' - run: | - sudo add-apt-repository ppa:ondrej/php - sudo apt-get update - sudo apt-get install -y php8.2 php8.2-cli php8.2-xml php8.2-curl php8.2-mbstring - php -v - shell: bash - - - name: Setup PHP (macOS) - if: matrix.os == 'macos-latest' - run: | - brew install php@8.2 - brew link php@8.2 --force - php -v - shell: bash + # PHP from the matrix (the previous hand-rolled apt/brew steps always installed 8.2, + # so the matrix versions were never actually exercised). + - name: Setup PHP ${{ matrix.php }} + if: matrix.os != 'windows-latest' + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, curl, xml, openssl + tools: composer:v2 + coverage: none - name: Setup PHP (Windows) if: matrix.os == 'windows-latest' @@ -63,19 +56,6 @@ jobs: echo "C:\tools\composer" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append shell: pwsh - - name: Install Composer (Unix) - if: matrix.os != 'windows-latest' - run: | - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer - php -r "unlink('composer-setup.php');" - sudo chmod +x /usr/local/bin/composer - mkdir -p ~/.composer - if [ "$RUNNER_OS" == "Linux" ]; then - sudo chown -R $USER:$USER ~/.composer - fi - shell: bash - - name: Get Composer Cache Directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT diff --git a/README.md b/README.md index 5666b07..b5bf5d6 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ For detailed documentation, visit [https://php.volt-test.com](https://php.volt-t ## Requirements -- PHP 8.0 or higher +- PHP 8.2 or higher - ext-json - ext-pcntl - ext-curl diff --git a/composer.json b/composer.json index 9538760..0fa2d53 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ } ], "require": { - "php": "^8.0", + "php": "^8.2", "ext-json": "*", "ext-curl": "*", "ext-pcntl": "*" From 0eef56faa3b9f6417981edcfa30b35d1c1218355 Mon Sep 17 00:00:00 2001 From: elwafa Date: Fri, 11 Sep 2026 16:18:01 +0300 Subject: [PATCH 3/4] Tests: drop no-op ReflectionMethod::setAccessible() calls Deprecated in PHP 8.5 and without effect since 8.1, which is below the SDK's new minimum. Removes the four deprecation notices in the CI run. --- tests/Units/PlatformTest.php | 4 ---- tests/Units/VoltTestCloudTest.php | 2 -- tests/Units/VoltTestStagesTest.php | 1 - tests/Units/VoltTestTest.php | 2 -- 4 files changed, 9 deletions(-) diff --git a/tests/Units/PlatformTest.php b/tests/Units/PlatformTest.php index 07b5558..e7a7bcb 100644 --- a/tests/Units/PlatformTest.php +++ b/tests/Units/PlatformTest.php @@ -12,7 +12,6 @@ private function cleanupTestEnvironment() // Use the actual Platform logic to get vendor directories $reflection = new \ReflectionClass(Platform::class); $getVendorDirMethod = $reflection->getMethod('getVendorDir'); - $getVendorDirMethod->setAccessible(true); $platform = new Platform(); $vendorDir = $getVendorDirMethod->invoke($platform); @@ -41,7 +40,6 @@ public function testDetectPlatform() { $reflection = new \ReflectionClass(Platform::class); $method = $reflection->getMethod('detectPlatform'); - $method->setAccessible(true); $platform = new Platform(); $result = $method->invoke($platform); @@ -88,7 +86,6 @@ public function testInstallBinary() // Get vendor directory $reflection = new \ReflectionClass(Platform::class); $getVendorDirMethod = $reflection->getMethod('getVendorDir'); - $getVendorDirMethod->setAccessible(true); $platform = new Platform(); $vendorDir = $getVendorDirMethod->invoke($platform); @@ -130,7 +127,6 @@ public function testVendorDirectoryLocation() { $reflection = new \ReflectionClass(Platform::class); $vendorMethod = $reflection->getMethod('getVendorDir'); - $vendorMethod->setAccessible(true); $platform = new Platform(); $vendorDir = $vendorMethod->invoke($platform); diff --git a/tests/Units/VoltTestCloudTest.php b/tests/Units/VoltTestCloudTest.php index a1b508a..62caab1 100644 --- a/tests/Units/VoltTestCloudTest.php +++ b/tests/Units/VoltTestCloudTest.php @@ -591,7 +591,6 @@ private function setPrivateProperty(object $object, string $propertyName, mixed { $reflection = new \ReflectionClass(get_class($object)); $property = $reflection->getProperty($propertyName); - $property->setAccessible(true); $property->setValue($object, $value); } @@ -599,7 +598,6 @@ private function getPrivateProperty(object $object, string $propertyName): mixed { $reflection = new \ReflectionClass(get_class($object)); $property = $reflection->getProperty($propertyName); - $property->setAccessible(true); return $property->getValue($object); } diff --git a/tests/Units/VoltTestStagesTest.php b/tests/Units/VoltTestStagesTest.php index 0d82adf..41e5433 100644 --- a/tests/Units/VoltTestStagesTest.php +++ b/tests/Units/VoltTestStagesTest.php @@ -286,7 +286,6 @@ private function getPrivateProperty(object $object, string $propertyName): mixed { $reflection = new \ReflectionClass(get_class($object)); $property = $reflection->getProperty($propertyName); - $property->setAccessible(true); return $property->getValue($object); } diff --git a/tests/Units/VoltTestTest.php b/tests/Units/VoltTestTest.php index 90c609e..cb9a1b9 100644 --- a/tests/Units/VoltTestTest.php +++ b/tests/Units/VoltTestTest.php @@ -181,7 +181,6 @@ private function setPrivateProperty($object, string $propertyName, $value): void { $reflection = new \ReflectionClass(get_class($object)); $property = $reflection->getProperty($propertyName); - $property->setAccessible(true); $property->setValue($object, $value); } @@ -189,7 +188,6 @@ private function getPrivateProperty($object, string $propertyName) { $reflection = new \ReflectionClass(get_class($object)); $property = $reflection->getProperty($propertyName); - $property->setAccessible(true); return $property->getValue($object); } From fafa22340487fc70d6accf619f9298eb8df997d5 Mon Sep 17 00:00:00 2001 From: elwafa Date: Fri, 11 Sep 2026 16:19:52 +0300 Subject: [PATCH 4/4] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5bf5d6..ccf7aad 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It combines PHP’s simplicity with Go’s speed and concurrency, allowing you t - [x] **Think Time & Ramp-Up Configuration** – Simulate real-user behavior. - [x] **Detailed Reports & Distributed Execution** – Scale tests and analyze results. - [x] **Debug Requests** - Inspect and troubleshoot request/response payloads easily. -- [x] **Cloud Execution** – Seamless cloud-based testing in progress. +- [x] **Cloud Execution** – Seamless cloud-based testing. ## Architecture