trait InteractsWithTestCase

Properties

static protected array<class-string, array<class-string, class-string>> $cachedTestCaseUses

Cached traits used by each test case class.

static protected array<int, array{key: class-string, instance: object}> $testCaseTestingFeatures

Programmatically added class-level testing features.

static protected array<int, array{key: class-string, instance: object}> $testCaseMethodTestingFeatures

Programmatically added method-level testing features.

Methods

static bool
usesTestingConcern(string|null $trait = null)

Determine if the test case uses the given trait, or the Testing trait by default.

static bool
usesRefreshDatabaseTestingConcern()

Determine if the test case uses refresh-database testing concerns.

static array
cachedUsesForTestCase()

Cache and return traits used by test case.

static void
usesTestingFeature(object $attribute, int $flag = Attribute::TARGET_CLASS)

Programmatically add a testing feature attribute.

static Collection
resolvePhpUnitAttributesForMethod(string $className, string|null $methodName = null)

Resolve PHPUnit method attributes for specific method.

void
setUpTheTestEnvironmentUsingTestCase()

Execute BeforeEach lifecycle attributes.

void
tearDownTheTestEnvironmentUsingTestCase()

Execute AfterEach lifecycle attributes.

static void
setUpBeforeClassUsingTestCase()

Load test fixtures and execute BeforeAll lifecycle attributes.

static void
tearDownAfterClassUsingTestCase()

Execute AfterAll lifecycle attributes and clear caches.

Details

at line 54
static bool usesTestingConcern(string|null $trait = null)

Determine if the test case uses the given trait, or the Testing trait by default.

Parameters

string|null $trait

Return Value

bool

at line 62
static bool usesRefreshDatabaseTestingConcern()

Determine if the test case uses refresh-database testing concerns.

Return Value

bool

at line 75
static array cachedUsesForTestCase()

internal  
 

Cache and return traits used by test case.

Return Value

array

at line 89
static void usesTestingFeature(object $attribute, int $flag = Attribute::TARGET_CLASS)

Programmatically add a testing feature attribute.

Parameters

object $attribute
int $flag

Return Value

void

at line 120
abstract static protected Collection resolvePhpUnitAttributesForMethod(string $className, string|null $methodName = null)

Resolve PHPUnit method attributes for specific method.

Parameters

string $className
string|null $methodName

Return Value

Collection

at line 127
protected void setUpTheTestEnvironmentUsingTestCase()

internal  
 

Execute BeforeEach lifecycle attributes.

Return Value

void

at line 142
protected void tearDownTheTestEnvironmentUsingTestCase()

internal  
 

Execute AfterEach lifecycle attributes.

Return Value

void

at line 178
static void setUpBeforeClassUsingTestCase()

internal  
 

Load test fixtures and execute BeforeAll lifecycle attributes.

Return Value

void

at line 195
static void tearDownAfterClassUsingTestCase()

internal  
 

Execute AfterAll lifecycle attributes and clear caches.

Return Value

void