ApplicationTrait

trait ApplicationTrait (View source)

Properties

protected Application $app The Illuminate application instance.
protected Client $client The HttpKernel client instance.

Methods

void refreshApplication()

Refresh the application instance.

Response call(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true)

Call the given URI and return the Response.

Response callSecure(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true)

Call the given HTTPS URI and return the Response.

Response action(string $method, string $action, array $wildcards = array(), array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)

Call a controller action and return the Response.

Response route(string $method, string $name, array $routeParameters = array(), array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)

Call a named route and return the Response.

void session(array $data)

Set the session to the given array.

void flushSession()

Flush all of the current session data.

void startSession()

Start the session for the application.

void be(UserInterface $user, string $driver = null)

Set the currently logged in user for the application.

void seed(string $class = 'DatabaseSeeder')

Seed a given database connection.

Client createClient(array $server = array())

Create a new HttpKernel client instance.

Details

protected void refreshApplication()

Refresh the application instance.

Return Value

void

Response call(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true)

Call the given URI and return the Response.

Parameters

string $method
string $uri
array $parameters
array $files
array $server
string $content
bool $changeHistory

Return Value

Response

Response callSecure(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true)

Call the given HTTPS URI and return the Response.

Parameters

string $method
string $uri
array $parameters
array $files
array $server
string $content
bool $changeHistory

Return Value

Response

Response action(string $method, string $action, array $wildcards = array(), array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)

Call a controller action and return the Response.

Parameters

string $method
string $action
array $wildcards
array $parameters
array $files
array $server
string $content
bool $changeHistory

Return Value

Response

Response route(string $method, string $name, array $routeParameters = array(), array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)

Call a named route and return the Response.

Parameters

string $method
string $name
array $routeParameters
array $parameters
array $files
array $server
string $content
bool $changeHistory

Return Value

Response

void session(array $data)

Set the session to the given array.

Parameters

array $data

Return Value

void

void flushSession()

Flush all of the current session data.

Return Value

void

protected void startSession()

Start the session for the application.

Return Value

void

void be(UserInterface $user, string $driver = null)

Set the currently logged in user for the application.

Parameters

UserInterface $user
string $driver

Return Value

void

void seed(string $class = 'DatabaseSeeder')

Seed a given database connection.

Parameters

string $class

Return Value

void

protected Client createClient(array $server = array())

Create a new HttpKernel client instance.

Parameters

array $server

Return Value

Client

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Foundation/Testing/ApplicationTrait.html