mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Merge pull request #1598 from Willem-Jaap/willem-jaap/pest-only-file-level
feat: add pest only function to mark each test in a file as only
This commit is contained in:
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Pest;
|
namespace Pest;
|
||||||
|
|
||||||
|
use Pest\PendingCalls\BeforeEachCall;
|
||||||
use Pest\PendingCalls\UsesCall;
|
use Pest\PendingCalls\UsesCall;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,6 +63,14 @@ final readonly class Configuration
|
|||||||
return (new UsesCall($this->filename, []))->group(...$groups);
|
return (new UsesCall($this->filename, []))->group(...$groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks all tests in the current file to be run exclusively.
|
||||||
|
*/
|
||||||
|
public function only(): void
|
||||||
|
{
|
||||||
|
(new BeforeEachCall(TestSuite::getInstance(), $this->filename))->only();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Depending on where is called, it will extend the given classes and traits globally or locally.
|
* Depending on where is called, it will extend the given classes and traits globally or locally.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user