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 70
__construct(Container $container)
Create a new parallel testing instance.
at line 78
void
resolveOptionsUsing(Closure|null $resolver)
Set a callback that should be used when resolving options.
at line 86
void
resolveTokenUsing(Closure|null $resolver)
Set a callback that should be used when resolving the unique process token.
at line 94
void
setUpProcess(callable $callback)
Register a "setUp" process callback.
at line 102
void
setUpTestCase(callable $callback)
Register a "setUp" test case callback.
at line 110
void
setUpTestDatabaseBeforeMigrating(callable $callback)
Register a "setUp" test database callback that runs prior to migrations.
at line 118
void
setUpTestDatabase(callable $callback)
Register a "setUp" test database callback.
at line 126
void
tearDownProcess(callable $callback)
Register a "tearDown" process callback.
at line 134
void
tearDownTestCase(callable $callback)
Register a "tearDown" test case callback.
at line 142
void
callSetUpProcessCallbacks()
Call all of the "setUp" process callbacks.
at line 156
void
callSetUpTestCaseCallbacks(mixed $testCase)
Call all of the "setUp" test case callbacks.
at line 171
void
callSetUpTestDatabaseBeforeMigratingCallbacks(string $database)
Call all of the "setUp" test database callbacks that run prior to migrations.
at line 186
void
callSetUpTestDatabaseCallbacks(string $database)
Call all of the "setUp" test database callbacks.
at line 201
void
callTearDownProcessCallbacks()
Call all of the "tearDown" process callbacks.
at line 213
void
callTearDownTestCaseCallbacks(mixed $testCase)
Call all of the "tearDown" test case callbacks.
at line 249
mixed
option(string $option)
Get a parallel testing option.
at line 263
string|false
token()
Get the unique test token.
at line 277
bool
inParallel()
Check if tests are running in parallel.
at line 287
static string|null
processToken()
| internal |
Get the filesystem-safe test process token.
at line 308
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 321
protected void
whenRunningInParallel(callable $callback)
Apply the callback if tests are running in parallel.