mirror of
https://github.com/pestphp/pest.git
synced 2026-03-08 08:47:22 +01:00
feat: pr and issue
This commit is contained in:
27
src/TestCaseMethodFilters/IssueTestCaseFilter.php
Normal file
27
src/TestCaseMethodFilters/IssueTestCaseFilter.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\TestCaseMethodFilters;
|
||||
|
||||
use Pest\Contracts\TestCaseMethodFilter;
|
||||
use Pest\Factories\TestCaseMethodFactory;
|
||||
|
||||
final readonly class IssueTestCaseFilter implements TestCaseMethodFilter
|
||||
{
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*/
|
||||
public function __construct(private int $number)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the test case methods.
|
||||
*/
|
||||
public function accept(TestCaseMethodFactory $factory): bool
|
||||
{
|
||||
return in_array($this->number, $factory->issues, true);
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ namespace Pest\TestCaseMethodFilters;
|
||||
use Pest\Contracts\TestCaseMethodFilter;
|
||||
use Pest\Factories\TestCaseMethodFactory;
|
||||
|
||||
final class NotesTestCaseFilter implements TestCaseMethodFilter
|
||||
final readonly class NotesTestCaseFilter implements TestCaseMethodFilter
|
||||
{
|
||||
public function accept(TestCaseMethodFactory $factory): bool
|
||||
{
|
||||
|
||||
27
src/TestCaseMethodFilters/PrTestCaseFilter.php
Normal file
27
src/TestCaseMethodFilters/PrTestCaseFilter.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\TestCaseMethodFilters;
|
||||
|
||||
use Pest\Contracts\TestCaseMethodFilter;
|
||||
use Pest\Factories\TestCaseMethodFactory;
|
||||
|
||||
final readonly class PrTestCaseFilter implements TestCaseMethodFilter
|
||||
{
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*/
|
||||
public function __construct(private int $number)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the test case methods.
|
||||
*/
|
||||
public function accept(TestCaseMethodFactory $factory): bool
|
||||
{
|
||||
return in_array($this->number, $factory->prs, true);
|
||||
}
|
||||
}
|
||||
@ -7,8 +7,11 @@ namespace Pest\TestCaseMethodFilters;
|
||||
use Pest\Contracts\TestCaseMethodFilter;
|
||||
use Pest\Factories\TestCaseMethodFactory;
|
||||
|
||||
final class TodoTestCaseFilter implements TestCaseMethodFilter
|
||||
final readonly class TodoTestCaseFilter implements TestCaseMethodFilter
|
||||
{
|
||||
/**
|
||||
* Filter the test case methods.
|
||||
*/
|
||||
public function accept(TestCaseMethodFactory $factory): bool
|
||||
{
|
||||
return $factory->todo;
|
||||
|
||||
Reference in New Issue
Block a user