class
Illuminate
/
Foundation
/
Testing
/
TestCase
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
abstract
TestCase
Extends
-
PHPUnit\...\TestCase
Uses
- InteractsWithContainer
- MakesHttpRequests
- InteractsWithAuthentication
- InteractsWithConsole
- InteractsWithDatabase
- InteractsWithDeprecationHandling
- InteractsWithExceptionHandling
- InteractsWithSession
- InteractsWithTime
- InteractsWithViews
Properties
protected
$afterApplicationCreatedCallbacks array
The callbacks that should be run after the application is created.
Default: []
protected
$beforeApplicationDestroyedCallbacks array
The callbacks that should be run before the application is destroyed.
Default: []
protected
$callbackException Throwable
The exception thrown while running an application destruction callback.
Default: null
protected
$setUpHasRun bool
Indicates if we have made it through the base setUp function.
Default: false
Methods
public
abstract
createApplication ( ) : Symfony\...\HttpKernelInterface
Creates the application.
protected
setUp ( ) : void
Setup the test environment.
protected
refreshApplication ( ) : void
Refresh the application instance.
protected
setUpTraits ( ) : array
Boot the testing helper traits.
protected
runTest ( ) : void
{@inheritdoc}
protected
tearDown ( ) : void
Clean up the testing environment before the next test.
public
static
tearDownAfterClass ( ) : void
Clean up the testing environment before the next test case.
public
afterApplicationCreated ( callable $callback ) : void
Register a callback to be run after the application is created.
Parameters
- $callback callable
protected
beforeApplicationDestroyed ( callable $callback ) : void
Register a callback to be run before the application is destroyed.
Parameters
- $callback callable
protected
callBeforeApplicationDestroyedCallbacks ( ) : void
Execute the application's pre-destruction callbacks.