InteractsWithTestCase
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
Check if the test case uses a specific trait.
Determine if the test case uses refresh-database testing concerns.
Cache and return traits used by test case.
Programmatically add a testing feature attribute.
Resolve PHPUnit method attributes for specific method.
Execute BeforeEach lifecycle attributes.
Execute AfterEach lifecycle attributes.
Execute BeforeAll lifecycle attributes.
Execute AfterAll lifecycle attributes and clear caches.
Details
at line 51
static bool
usesTestingConcern(string|null $trait = null)
Check if the test case uses a specific trait.
at line 59
static bool
usesRefreshDatabaseTestingConcern()
Determine if the test case uses refresh-database testing concerns.
at line 70
static array
cachedUsesForTestCase()
Cache and return traits used by test case.
at line 82
static void
usesTestingFeature(object $attribute, int $flag = Attribute::TARGET_CLASS)
Programmatically add a testing feature attribute.
at line 113
abstract static protected Collection
resolvePhpUnitAttributesForMethod(string $className, string|null $methodName = null)
Resolve PHPUnit method attributes for specific method.
at line 118
protected void
setUpTheTestEnvironmentUsingTestCase()
Execute BeforeEach lifecycle attributes.
at line 131
protected void
tearDownTheTestEnvironmentUsingTestCase()
Execute AfterEach lifecycle attributes.
at line 165
static void
setUpBeforeClassUsingTestCase()
Execute BeforeAll lifecycle attributes.
at line 176
static void
tearDownAfterClassUsingTestCase()
Execute AfterAll lifecycle attributes and clear caches.