WithWorkbench
trait WithWorkbench
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
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.
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.
Get package bootstrapper.
Get package providers.
Resolve application Console Kernel implementation.
Get application HTTP Kernel implementation using Workbench.
Get application HTTP exception handler using Workbench.
Define or get the cached uses for test case.
Bootstrap with Workbench.
Bootstrap discover routes.
Details
in
InteractsWithTestCase at line 51
static bool
usesTestingConcern(string|null $trait = null)
Check if the test case uses a specific trait.
in
InteractsWithTestCase at line 59
static bool
usesRefreshDatabaseTestingConcern()
Determine if the test case uses refresh-database testing concerns.
in
InteractsWithTestCase at line 70
static array
cachedUsesForTestCase()
Cache and return traits used by test case.
in
InteractsWithTestCase at line 82
static void
usesTestingFeature(object $attribute, int $flag = Attribute::TARGET_CLASS)
Programmatically add a testing feature attribute.
in
InteractsWithTestCase at line 113
abstract static protected Collection
resolvePhpUnitAttributesForMethod(string $className, string|null $methodName = null)
Resolve PHPUnit method attributes for specific method.
in
InteractsWithTestCase at line 118
protected void
setUpTheTestEnvironmentUsingTestCase()
Execute BeforeEach lifecycle attributes.
in
InteractsWithTestCase at line 131
protected void
tearDownTheTestEnvironmentUsingTestCase()
Execute AfterEach lifecycle attributes.
in
InteractsWithTestCase at line 165
static void
setUpBeforeClassUsingTestCase()
Execute BeforeAll lifecycle attributes.
in
InteractsWithTestCase at line 176
static void
tearDownAfterClassUsingTestCase()
Execute AfterAll lifecycle attributes and clear caches.
in
InteractsWithPHPUnit at line 55
bool
isRunningTestCase()
Determine if the object is running as a PHPUnit test case.
in
InteractsWithPHPUnit at line 65
string|null
resolvePhpUnitTestClassName()
Resolve the PHPUnit test class name.
in
InteractsWithPHPUnit at line 79
string|null
resolvePhpUnitTestMethodName()
Resolve the PHPUnit test method name.
in
InteractsWithPHPUnit at line 93
protected Collection
resolvePhpUnitAttributes()
Resolve and cache PHPUnit attributes for current test.
in
InteractsWithPHPUnit at line 135
void
setUpTheEnvironmentUsing(Closure $setUp)
Define the setUp environment using callback.
in
InteractsWithPHPUnit at line 145
void
tearDownTheEnvironmentUsing(Closure $tearDown)
Define the tearDown environment using callback.
in
InteractsWithPHPUnit at line 153
static void
setUpBeforeClassUsingPHPUnit()
Cache uses for test case before class runs.
in
InteractsWithPHPUnit at line 161
static void
tearDownAfterClassUsingPHPUnit()
Clear PHPUnit caches after class teardown.
in
InteractsWithPest at line 17
bool
isRunningTestCaseUsingPest()
Determine if the trait is used within testing using Pest.
in
InteractsWithPest at line 25
static protected bool
isRunningViaPestPrinter(object|string $object)
Determine if the object implements Pest test runner.
in
InteractsWithWorkbench at line 26
static string|null
applicationBasePathUsingWorkbench()
| internal |
Get Application's base path.
in
InteractsWithWorkbench at line 38
array|null
ignorePackageDiscoveriesFromUsingWorkbench()
| internal |
Ignore package discovery from.
in
InteractsWithWorkbench at line 56
protected array|null
getPackageBootstrappersUsingWorkbench(object $app)
| internal |
Get package bootstrapper.
in
InteractsWithWorkbench at line 74
protected array|null
getPackageProvidersUsingWorkbench(object $app)
| internal |
Get package providers.
in
InteractsWithWorkbench at line 101
protected string
applicationConsoleKernelUsingWorkbench(object $app)
| internal |
Resolve application Console Kernel implementation.
in
InteractsWithWorkbench at line 115
protected string
applicationHttpKernelUsingWorkbench(object $app)
| internal |
Get application HTTP Kernel implementation using Workbench.
in
InteractsWithWorkbench at line 129
protected string
applicationExceptionHandlerUsingWorkbench(object $app)
| internal |
Get application HTTP exception handler using Workbench.
in
InteractsWithWorkbench at line 141
static Config|null
cachedConfigurationForWorkbench()
Define or get the cached uses for test case.
at line 22
protected void
setUpWithWorkbench()
| internal |
Bootstrap with Workbench.
at line 49
protected void
bootDiscoverRoutesForWorkbench(object $app)
| internal |
Bootstrap discover routes.
at line 63
protected array|false
mergeSeedersForWorkbench(Config $config)
Merge seeders for Workbench.