HandlesRoutes
trait HandlesRoutes
Traits
Properties
| static protected string|bool|null | $cacheApplicationBootstrapFile | Cached application bootstrap file path. |
from InteractsWithTestCase |
| static protected null|array<class-string, class-string> | $cachedTestCaseUses | Cached traits used by test case. |
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 | |
| protected bool | $requireApplicationCachedRoutesHasRun | Whether cached routes have been loaded for this test. |
|
| protected bool | $testbenchRouteCleanupRegistered | Whether route file cleanup has been registered for this test. |
|
| protected bool | $reloadingApplicationForCachedRoutes | Whether defineCacheRoutes() is reloading the application to load cached routes. |
|
| protected array<int, string> | $testbenchRouteFiles | Route files written by this test instance. |
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.
Register cleanup for route files and route cache written by this test.
Get a route file path owned by this test instance.
Details
in
InteractsWithTestCase at line 54
static bool
usesTestingConcern(string|null $trait = null)
Check if the test case uses a specific trait.
in
InteractsWithTestCase at line 62
static bool
usesRefreshDatabaseTestingConcern()
Determine if the test case uses refresh-database testing concerns.
in
InteractsWithTestCase at line 73
static array
cachedUsesForTestCase()
Cache and return traits used by test case.
in
InteractsWithTestCase at line 87
static void
usesTestingFeature(object $attribute, int $flag = Attribute::TARGET_CLASS)
Programmatically add a testing feature attribute.
in
InteractsWithTestCase at line 118
abstract static protected Collection
resolvePhpUnitAttributesForMethod(string $className, string|null $methodName = null)
Resolve PHPUnit method attributes for specific method.
in
InteractsWithTestCase at line 123
protected void
setUpTheTestEnvironmentUsingTestCase()
Execute BeforeEach lifecycle attributes.
in
InteractsWithTestCase at line 136
protected void
tearDownTheTestEnvironmentUsingTestCase()
Execute AfterEach lifecycle attributes.
in
InteractsWithTestCase at line 167
static void
setUpBeforeClassUsingTestCase()
Execute BeforeAll lifecycle attributes.
in
InteractsWithTestCase at line 178
static void
tearDownAfterClassUsingTestCase()
Execute AfterAll lifecycle attributes and clear caches.
in
InteractsWithPHPUnit at line 54
bool
isRunningTestCase()
Determine if the object is running as a PHPUnit test case.
in
InteractsWithPHPUnit at line 64
string|null
resolvePhpUnitTestClassName()
Resolve the PHPUnit test class name.
in
InteractsWithPHPUnit at line 78
string|null
resolvePhpUnitTestMethodName()
Resolve the PHPUnit test method name.
in
InteractsWithPHPUnit at line 92
protected Collection
resolvePhpUnitAttributes()
Resolve and cache PHPUnit attributes for current test.
in
InteractsWithPHPUnit at line 142
void
setUpTheEnvironmentUsing(Closure $setUp)
Define the setUp environment using callback.
in
InteractsWithPHPUnit at line 152
void
tearDownTheEnvironmentUsing(Closure $tearDown)
Define the tearDown environment using callback.
in
InteractsWithPHPUnit at line 160
static void
setUpBeforeClassUsingPHPUnit()
Cache uses for test case before class runs.
in
InteractsWithPHPUnit at line 168
static void
tearDownAfterClassUsingPHPUnit()
Clear PHPUnit caches after class teardown.
at line 56
protected void
setUpApplicationRoutes(Application $app)
Setup application routes.
at line 88
protected void
defineRoutes(Router $router)
Define routes setup.
at line 96
protected void
defineWebRoutes(Router $router)
Define web routes setup.
at line 104
protected void
defineStashRoutes(Closure|string $route)
Define stash routes setup.
at line 112
protected void
defineCacheRoutes(Closure|string $route, bool $cached = true)
Define cache routes setup.
at line 184
protected void
requireApplicationCachedRoutes(Filesystem $files, bool $cached)
| internal |
Require application cached routes.
at line 208
protected void
registerTestbenchRouteCleanup(Filesystem $files)
Register cleanup for route files and route cache written by this test.
at line 234
protected string
testbenchRouteFilePath(string $basePath)
Get a route file path owned by this test instance.