ParallelTesting
class ParallelTesting
Properties
| protected Closure|null | $optionsResolver | The options resolver callback. |
|
| protected Closure|null | $tokenResolver | The token resolver callback. |
|
| protected list<callable> | $setUpProcessCallbacks | All of the registered "setUp" process callbacks. |
|
| protected list<callable> | $setUpTestCaseCallbacks | All of the registered "setUp" test case callbacks. |
|
| protected list<callable> | $setUpTestDatabaseBeforeMigratingCallbacks | All of the registered "setUp" test database callbacks prior to migrations. |
|
| protected list<callable> | $setUpTestDatabaseCallbacks | All of the registered "setUp" test database callbacks. |
|
| protected list<callable> | $tearDownProcessCallbacks | All of the registered "tearDown" process callbacks. |
|
| protected list<callable> | $tearDownTestCaseCallbacks | All of the registered "tearDown" test case callbacks. |
Methods
Set a callback that should be used when resolving options.
Set a callback that should be used when resolving the unique process token.
Register a "setUp" process callback.
Register a "setUp" test case callback.
Register a "setUp" test database callback that runs prior to migrations.
Register a "setUp" test database callback.
Register a "tearDown" process callback.
Register a "tearDown" test case callback.
Call all of the "setUp" process callbacks.
Call all of the "setUp" test case callbacks.
Call all of the "setUp" test database callbacks that run prior to migrations.
Call all of the "setUp" test database callbacks.
Call all of the "tearDown" process callbacks.
Call all of the "tearDown" test case callbacks.
Get a parallel testing option.
Get the unique test token.
Check if tests are running in parallel.
Get the filesystem-safe test process token.
Get a unique temporary directory path for the current test process.
Apply the callback if tests are running in parallel.
Details
at line 69
__construct(Container $container)
Create a new parallel testing instance.
at line 77
void
resolveOptionsUsing(Closure|null $resolver)
Set a callback that should be used when resolving options.
at line 85
void
resolveTokenUsing(Closure|null $resolver)
Set a callback that should be used when resolving the unique process token.
at line 93
void
setUpProcess(callable $callback)
Register a "setUp" process callback.
at line 101
void
setUpTestCase(callable $callback)
Register a "setUp" test case callback.
at line 109
void
setUpTestDatabaseBeforeMigrating(callable $callback)
Register a "setUp" test database callback that runs prior to migrations.
at line 117
void
setUpTestDatabase(callable $callback)
Register a "setUp" test database callback.
at line 125
void
tearDownProcess(callable $callback)
Register a "tearDown" process callback.
at line 133
void
tearDownTestCase(callable $callback)
Register a "tearDown" test case callback.
at line 141
void
callSetUpProcessCallbacks()
Call all of the "setUp" process callbacks.
at line 155
void
callSetUpTestCaseCallbacks(mixed $testCase)
Call all of the "setUp" test case callbacks.
at line 170
void
callSetUpTestDatabaseBeforeMigratingCallbacks(string $database)
Call all of the "setUp" test database callbacks that run prior to migrations.
at line 185
void
callSetUpTestDatabaseCallbacks(string $database)
Call all of the "setUp" test database callbacks.
at line 200
void
callTearDownProcessCallbacks()
Call all of the "tearDown" process callbacks.
at line 212
void
callTearDownTestCaseCallbacks(mixed $testCase)
Call all of the "tearDown" test case callbacks.
at line 248
mixed
option(string $option)
Get a parallel testing option.
at line 262
string|false
token()
Get the unique test token.
at line 276
bool
inParallel()
Check if tests are running in parallel.
at line 286
static string|null
processToken()
| internal |
Get the filesystem-safe test process token.
at line 307
static string
tempDir(string $suffix = '')
Get a unique temporary directory path for the current test process.
Incorporates TEST_TOKEN (parallel worker ID) and PID to prevent cross-worker filesystem collisions under ParaTest.
at line 320
protected void
whenRunningInParallel(callable $callback)
Apply the callback if tests are running in parallel.