InteractsWithWorkbench
trait InteractsWithWorkbench
| internal |
Traits
Properties
| static protected array<class-string, array<class-string, class-string>> | $cachedTestCaseUses | Cached traits used by each test case class. |
from InteractsWithTestCase |
| static protected array<int, array{key: class-string, instance: object}> | $testCaseTestingFeatures | Programmatically added class-level testing features. |
from InteractsWithTestCase |
| static protected array<int, array{key: class-string, instance: object}> | $testCaseMethodTestingFeatures | Programmatically added method-level testing features. |
from InteractsWithTestCase |
| protected null|Closure): void | $testCaseSetUpCallback | The cached test case setUp resolver. |
from InteractsWithPHPUnit |
| protected null|Closure): void | $testCaseTearDownCallback | The cached test case tearDown resolver. |
from InteractsWithPHPUnit |
| static protected array<string, array<int, array{key: class-string, instance: object}>> | $cachedTestCaseClassAttributes | Cached class attributes by class name. |
from InteractsWithPHPUnit |
| static protected array<string, array<int, array{key: class-string, instance: object}>> | $cachedTestCaseMethodAttributes | Cached method attributes by "class:method" key. |
from InteractsWithPHPUnit |
| null|Application | $app | from InteractsWithPHPUnit |
Methods
Determine if the test case uses the given trait, or the Testing trait by default.
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.
Load test fixtures and execute BeforeAll lifecycle attributes.
Execute AfterAll lifecycle attributes and clear caches.
Determine if the object is running as a PHPUnit test case.
Resolve the PHPUnit test class name.
Resolve the PHPUnit test method name.
Resolve and cache PHPUnit attributes for current test.
Cache uses for test case before class runs.
Clear PHPUnit caches after class teardown.
Determine if the trait is used within testing using Pest.
Determine if the object implements Pest test runner.
Get Application's base path.
Ignore package discovery from.
Resolve application Console Kernel implementation.
Get application HTTP Kernel implementation using Workbench.
Get application HTTP exception handler using Workbench.
Get the cached Workbench configuration.
Details
in
InteractsWithTestCase 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.
in
InteractsWithTestCase at line 62
static bool
usesRefreshDatabaseTestingConcern()
Determine if the test case uses refresh-database testing concerns.
in
InteractsWithTestCase at line 75
static array
cachedUsesForTestCase()
| internal |
Cache and return traits used by test case.
in
InteractsWithTestCase at line 89
static void
usesTestingFeature(object $attribute, int $flag = Attribute::TARGET_CLASS)
Programmatically add a testing feature attribute.
in
InteractsWithTestCase at line 120
abstract static protected Collection
resolvePhpUnitAttributesForMethod(string $className, string|null $methodName = null)
Resolve PHPUnit method attributes for specific method.
in
InteractsWithTestCase at line 127
protected void
setUpTheTestEnvironmentUsingTestCase()
| internal |
Execute BeforeEach lifecycle attributes.
in
InteractsWithTestCase at line 142
protected void
tearDownTheTestEnvironmentUsingTestCase()
| internal |
Execute AfterEach lifecycle attributes.
in
InteractsWithTestCase at line 178
static void
setUpBeforeClassUsingTestCase()
| internal |
Load test fixtures and execute BeforeAll lifecycle attributes.
in
InteractsWithTestCase at line 195
static void
tearDownAfterClassUsingTestCase()
| internal |
Execute AfterAll lifecycle attributes and clear caches.
in
InteractsWithPHPUnit at line 56
bool
isRunningTestCase()
Determine if the object is running as a PHPUnit test case.
in
InteractsWithPHPUnit at line 68
string|null
resolvePhpUnitTestClassName()
| internal |
Resolve the PHPUnit test class name.
in
InteractsWithPHPUnit at line 84
string|null
resolvePhpUnitTestMethodName()
| internal |
Resolve the PHPUnit test method name.
in
InteractsWithPHPUnit at line 100
protected Collection
resolvePhpUnitAttributes()
| internal |
Resolve and cache PHPUnit attributes for current test.
in
InteractsWithPHPUnit at line 146
void
setUpTheEnvironmentUsing(Closure $setUp)
| internal |
Define the setUp environment using callback.
in
InteractsWithPHPUnit at line 158
void
tearDownTheEnvironmentUsing(Closure $tearDown)
| internal |
Define the tearDown environment using callback.
in
InteractsWithPHPUnit at line 168
static void
setUpBeforeClassUsingPHPUnit()
| internal |
Cache uses for test case before class runs.
in
InteractsWithPHPUnit at line 178
static void
tearDownAfterClassUsingPHPUnit()
| internal |
Clear PHPUnit caches after class teardown.
in
InteractsWithPest at line 19
bool
isRunningTestCaseUsingPest()
Determine if the trait is used within testing using Pest.
in
InteractsWithPest at line 27
static protected bool
isRunningViaPestPrinter(object|string $object)
Determine if the object implements Pest test runner.
at line 29
static string|null
applicationBasePathUsingWorkbench()
| internal |
Get Application's base path.
at line 41
array|null
ignorePackageDiscoveriesFromUsingWorkbench()
| internal |
Ignore package discovery from.
at line 59
protected array|null
getPackageBootstrappersUsingWorkbench(Application $app)
| internal |
Get package bootstrapper.
at line 77
protected array|null
getPackageProvidersUsingWorkbench(Application $app)
| internal |
Get package providers.
at line 104
protected string
applicationConsoleKernelUsingWorkbench(Application $app)
| internal |
Resolve application Console Kernel implementation.
at line 118
protected string
applicationHttpKernelUsingWorkbench(Application $app)
| internal |
Get application HTTP Kernel implementation using Workbench.
at line 132
protected string
applicationExceptionHandlerUsingWorkbench(Application $app)
| internal |
Get application HTTP exception handler using Workbench.
at line 144
static Config|null
cachedConfigurationForWorkbench()
Get the cached Workbench configuration.