TestCase
abstract class TestCase extends PHPUnit_Framework_TestCase (View source)
Traits
Properties
protected Application | $app | The Illuminate application instance. |
from ApplicationTrait |
protected Client | $client | The HttpKernel client instance. |
from ApplicationTrait |
Methods
Call the given URI and return the Response.
Call the given HTTPS URI and return the Response.
Call a controller action and return the Response.
Call a named route and return the Response.
Set the currently logged in user for the application.
Create a new HttpKernel client instance.
Assert that the client response has a given code.
Assert that the response view has a given piece of bound data.
Assert that the view has a given list of bound data.
Assert that the response view is missing a piece of bound data.
Assert whether the client was redirected to a given URI.
Assert whether the client was redirected to a given route.
Assert whether the client was redirected to a given action.
Assert that the session has a given list of values.
Assert that the session has a given list of values.
Assert that the session has errors bound.
Setup the test environment.
Creates the application.
Details
protected 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.
protected 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.
protected Client
createClient(array $server = array())
Create a new HttpKernel client instance.
void
assertResponseOk()
Assert that the client response has an OK status code.
void
assertResponseStatus(int $code)
Assert that the client response has a given code.
void
assertViewHas(string|array $key, mixed $value = null)
Assert that the response view has a given piece of bound data.
void
assertViewHasAll(array $bindings)
Assert that the view has a given list of bound data.
void
assertViewMissing(string $key)
Assert that the response view is missing a piece of bound data.
void
assertRedirectedTo(string $uri, array $with = array())
Assert whether the client was redirected to a given URI.
void
assertRedirectedToRoute(string $name, array $parameters = array(), array $with = array())
Assert whether the client was redirected to a given route.
void
assertRedirectedToAction(string $name, array $parameters = array(), array $with = array())
Assert whether the client was redirected to a given action.
void
assertSessionHas(string|array $key, mixed $value = null)
Assert that the session has a given list of values.
void
assertSessionHasAll(array $bindings)
Assert that the session has a given list of values.
void
assertSessionHasErrors(string|array $bindings = array(), mixed $format = null)
Assert that the session has errors bound.
void
assertHasOldInput()
Assert that the session has old input.
void
setUp()
Setup the test environment.
abstract HttpKernelInterface
createApplication()
Creates the application.
Needs to be implemented by subclasses.