pest icon indicating copy to clipboard operation
pest copied to clipboard

[Bug]: --testdox flag throws error when running with --parallel due to type error

Open Admiral-Enigma opened this issue 1 year ago • 1 comments

What Happened

When I run php artisan test --parallel --testdox --stop-on-failure on pest v4 I get a type exception from paratest

ERROR Fatal error: Uncaught TypeError: ParaTest\WrapperRunner\ApplicationForWrapperWorker::__construct(): Argument #9 ($testdoxColumns) must be of type ?int, string given

This is with "brianium/paratest": "^7.8.3" in my composer json.

How to Reproduce

Upgrade to pest v4 and upgrade brianium/paratest. Then run php artisan test --parallel --testdox --stop-on-failure

Sample Repository

No response

Pest Version

4.0

PHP Version

8.3

Operation System

macOS

Notes

This seems to be "easily" fixable by casting $getopt['testdox-columns'] to an int inside worker.php

So line 89 in worker.php goes from $getopt['testdox-columns'] ?? null, to (int) $getopt['testdox-columns'] ?? null,

When I do this fix locally it fixes it and outputs the testdox format correctly

Admiral-Enigma avatar Aug 22 '25 07:08 Admiral-Enigma

fixed.

nunomaduro avatar Aug 22 '25 08:08 nunomaduro