Adds assignees

This commit is contained in:
Nuno Maduro
2024-08-03 17:05:34 +01:00
parent 6fb1133d52
commit 41e50cac05
10 changed files with 124 additions and 8 deletions

View File

@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace Pest\TestCaseMethodFilters;
use Pest\Contracts\TestCaseMethodFilter;
use Pest\Factories\TestCaseMethodFactory;
final readonly class AssigneeTestCaseFilter implements TestCaseMethodFilter
{
/**
* Create a new filter instance.
*/
public function __construct(private string $assignee)
{
//
}
/**
* Filter the test case methods.
*/
public function accept(TestCaseMethodFactory $factory): bool
{
return array_filter($factory->assignees, fn ($assignee): bool => str_starts_with($assignee, $this->assignee)) !== [];
}
}