mirror of
https://github.com/pestphp/pest.git
synced 2026-03-09 01:07:23 +01:00
Adds a new method, isInParallel, to the Testable trait to allow a test to determine its parallel status.
This commit is contained in:
@ -304,4 +304,12 @@ trait Testable
|
||||
{
|
||||
return ltrim(self::class, 'P\\');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether this test case is being executed in a parallel environment.
|
||||
*/
|
||||
public function isInParallel(): bool
|
||||
{
|
||||
return TestSuite::getInstance()->isInParallel;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Pest\Concerns\Testable;
|
||||
use Pest\Datasets;
|
||||
use Pest\Expectation;
|
||||
use Pest\PendingObjects\AfterEachCall;
|
||||
@ -85,7 +86,7 @@ if (!function_exists('test')) {
|
||||
* is the test description; the second argument is
|
||||
* a closure that contains the test expectations.
|
||||
*
|
||||
* @return TestCall|TestCase|mixed
|
||||
* @return TestCall|TestCase|Testable|mixed
|
||||
*/
|
||||
function test(string $description = null, Closure $closure = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user