trait ApplicationTrait (View source)
protected Application | $app | The Illuminate application instance. | |
protected int | $code | The last code returned by Artisan CLI. |
void | refreshApplication() Refresh the application instance. | |
object | instance(string $abstract, object $instance) Register an instance of an object in the container. | |
$this | expectsEvents(array|mixed $events) Specify a list of events that should be fired for the given operation. | |
$this | withoutEvents() Mock the event dispatcher so all events are silenced. | |
$this | expectsJobs(array|mixed $jobs) Specify a list of jobs that should be dispatched for the given operation. | |
$this | withSession(array $data) Set the session to the given array. | |
void | session(array $data) Set the session to the given array. | |
void | startSession() Start the session for the application. | |
void | flushSession() Flush all of the current session data. | |
$this | withoutMiddleware() Disable middleware for the test. | |
$this | actingAs(Authenticatable $user, string|null $driver = null) Set the currently logged in user for the application. | |
void | be(Authenticatable $user, string|null $driver = null) Set the currently logged in user for the application. | |
$this | seeInDatabase(string $table, array $data, string $connection = null) Assert that a given where condition exists in the database. | |
$this | missingFromDatabase(string $table, array $data, string $connection = null) Assert that a given where condition does not exist in the database. | |
$this | dontSeeInDatabase(string $table, array $data, string $connection = null) Assert that a given where condition does not exist in the database. | |
$this | notSeeInDatabase(string $table, array $data, string $connection = null) Assert that a given where condition does not exist in the database. | |
void | seed(string $class = 'DatabaseSeeder') Seed a given database connection. | |
int | artisan(string $command, array $parameters = []) Call artisan command and return code. |
Refresh the application instance.
Register an instance of an object in the container.
Specify a list of events that should be fired for the given operation.
These events will be mocked, so that handlers will not actually be executed.
Mock the event dispatcher so all events are silenced.
Specify a list of jobs that should be dispatched for the given operation.
These jobs will be mocked, so that handlers will not actually be executed.
Set the session to the given array.
Set the session to the given array.
Start the session for the application.
Flush all of the current session data.
Disable middleware for the test.
Set the currently logged in user for the application.
Set the currently logged in user for the application.
Assert that a given where condition exists in the database.
Assert that a given where condition does not exist in the database.
Assert that a given where condition does not exist in the database.
Assert that a given where condition does not exist in the database.
Seed a given database connection.
Call artisan command and return code.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.5/Illuminate/Foundation/Testing/ApplicationTrait.html