TestCase
class TestCase extends PHPUnit_Framework_TestCase (View source)
Traits
Methods
Assert that a given string is seen on the current HTML.
Assert that a given string is not seen on the current HTML.
Assert that an element is present on the page.
Assert that an element is not present on the page.
Assert that a given string is seen on the current text.
Assert that a given string is not seen on the current text.
Assert that a given string is seen inside an element.
Assert that a given string is not seen inside an element.
Assert that a given link is seen on the page.
Assert that a given link is not seen on the page.
Assert that an input field contains the given value.
Assert that an input field does not contain the given value.
Assert that the expected value is selected.
Assert that the given value is not selected.
Assert that the given checkbox is selected.
Assert that the given checkbox is not selected.
Visit the given URI with a JSON request.
Visit the given URI with a GET request.
Visit the given URI with a POST request.
Visit the given URI with a PUT request.
Visit the given URI with a PATCH request.
Visit the given URI with a DELETE request.
Assert that the response contains an exact JSON array.
Assert that the response contains JSON.
Assert that the response doesn't contain JSON.
Assert that the JSON response has a given structure.
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.
Assert that the client response has an OK status code.
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.
Set the currently logged in user for the application.
Set the currently logged in user for the application.
Assert that the user is authenticated.
Assert that the user is not authenticated.
Assert that the user is authenticated as the given user.
Assert that the given credentials are valid.
Assert that the given credentials are invalid.
Call artisan command and return code.
Seed a given database connection.
Assert that the session has a given value.
Assert that the session has a given value.
Assert that the session has a given list of values.
Assert that the session does not have a given key.
Assert that the session has errors bound.
Specify a list of events that should be fired for the given operation.
Specify a list of events that should not be fired for the given operation.
Specify a list of observers that will not run for the given operation.
Creates the application.
Details
in InteractsWithPages at line line 59
$this
visit(
string $uri)
Visit the given URI with a GET request.
in InteractsWithPages at line line 207
$this
within(
string $element,
Closure $callback)
Narrow the test content to a specific area of the page.
in InteractsWithPages at line line 261
$this
see(
string $text,
bool $negate = false)
Assert that a given string is seen on the current HTML.
in InteractsWithPages at line line 272
$this
dontSee(
string $text)
Assert that a given string is not seen on the current HTML.
in InteractsWithPages at line line 285
$this
seeElement(
string $selector,
array $attributes = array(),
bool $negate = false)
Assert that an element is present on the page.
in InteractsWithPages at line line 297
$this
dontSeeElement(
string $selector,
array $attributes = array())
Assert that an element is not present on the page.
in InteractsWithPages at line line 309
$this
seeText(
string $text,
bool $negate = false)
Assert that a given string is seen on the current text.
in InteractsWithPages at line line 320
$this
dontSeeText(
string $text)
Assert that a given string is not seen on the current text.
in InteractsWithPages at line line 333
$this
seeInElement(
string $element,
string $text,
bool $negate = false)
Assert that a given string is seen inside an element.
in InteractsWithPages at line line 345
$this
dontSeeInElement(
string $element,
string $text)
Assert that a given string is not seen inside an element.
in InteractsWithPages at line line 358
$this
seeLink(
string $text,
string|null $url = null,
bool $negate = false)
Assert that a given link is seen on the page.
in InteractsWithPages at line line 370
$this
dontSeeLink(
string $text,
string|null $url = null)
Assert that a given link is not seen on the page.
in InteractsWithPages at line line 383
$this
seeInField(
string $selector,
string $expected,
bool $negate = false)
Assert that an input field contains the given value.
in InteractsWithPages at line line 395
$this
dontSeeInField(
string $selector,
string $value)
Assert that an input field does not contain the given value.
in InteractsWithPages at line line 408
$this
seeIsSelected(
string $selector,
string $value,
bool $negate = false)
Assert that the expected value is selected.
in InteractsWithPages at line line 420
$this
dontSeeIsSelected(
string $selector,
string $value)
Assert that the given value is not selected.
in InteractsWithPages at line line 432
$this
seeIsChecked(
string $selector,
bool $negate = false)
Assert that the given checkbox is selected.
in InteractsWithPages at line line 443
$this
dontSeeIsChecked(
string $selector)
Assert that the given checkbox is not selected.
in MakesHttpRequests at line line 58
$this
json(
string $method,
string $uri,
array $data = array(),
array $headers = array())
Visit the given URI with a JSON request.
in MakesHttpRequests at line line 105
$this
get(
string $uri,
array $headers = array())
Visit the given URI with a GET request.
in MakesHttpRequests at line line 122
$this
post(
string $uri,
array $data = array(),
array $headers = array())
Visit the given URI with a POST request.
in MakesHttpRequests at line line 139
$this
put(
string $uri,
array $data = array(),
array $headers = array())
Visit the given URI with a PUT request.
in MakesHttpRequests at line line 156
$this
patch(
string $uri,
array $data = array(),
array $headers = array())
Visit the given URI with a PATCH request.
in MakesHttpRequests at line line 173
$this
delete(
string $uri,
array $data = array(),
array $headers = array())
Visit the given URI with a DELETE request.
in MakesHttpRequests at line line 190
$this
handle(
Request $request)
Send the given request through the application.
This method allows you to fully customize the entire Request object.
in MakesHttpRequests at line line 227
$this
seeJsonEquals(
array $data)
Assert that the response contains an exact JSON array.
in MakesHttpRequests at line line 245
$this
seeJson(
array $data = null,
bool $negate = false)
Assert that the response contains JSON.
in MakesHttpRequests at line line 264
$this
dontSeeJson(
array $data = null)
Assert that the response doesn't contain JSON.
in MakesHttpRequests at line line 276
$this
seeJsonStructure(
array $structure = null,
array|null $responseData = null)
Assert that the JSON response has a given structure.
in MakesHttpRequests at line line 493
Response
call(
string $method,
string $uri,
array $parameters = array(),
array $cookies = array(),
array $files = array(),
array $server = array(),
string $content = null)
Call the given URI and return the Response.
in MakesHttpRequests at line line 525
Response
callSecure(
string $method,
string $uri,
array $parameters = array(),
array $cookies = array(),
array $files = array(),
array $server = array(),
string $content = null)
Call the given HTTPS URI and return the Response.
in MakesHttpRequests at line line 545
Response
action(
string $method,
string $action,
array $wildcards = array(),
array $parameters = array(),
array $cookies = array(),
array $files = array(),
array $server = array(),
string $content = null)
Call a controller action and return the Response.
in MakesHttpRequests at line line 565
Response
route(
string $method,
string $name,
array $routeParameters = array(),
array $parameters = array(),
array $cookies = array(),
array $files = array(),
array $server = array(),
string $content = null)
Call a named route and return the Response.
in MakesHttpRequests at line line 620
void
assertResponseOk()
Assert that the client response has an OK status code.
in MakesHttpRequests at line line 633
void
assertResponseStatus(
int $code)
Assert that the client response has a given code.
in MakesHttpRequests at line line 647
void
assertViewHas(
string|array $key,
mixed $value = null)
Assert that the response view has a given piece of bound data.
in MakesHttpRequests at line line 670
void
assertViewHasAll(
array $bindings)
Assert that the view has a given list of bound data.
in MakesHttpRequests at line line 687
void
assertViewMissing(
string $key)
Assert that the response view is missing a piece of bound data.
in MakesHttpRequests at line line 703
void
assertRedirectedTo(
string $uri,
array $with = array())
Assert whether the client was redirected to a given URI.
in MakesHttpRequests at line line 720
void
assertRedirectedToRoute(
string $name,
array $parameters = array(),
array $with = array())
Assert whether the client was redirected to a given route.
in MakesHttpRequests at line line 733
void
assertRedirectedToAction(
string $name,
array $parameters = array(),
array $with = array())
Assert whether the client was redirected to a given action.
in ImpersonatesUsers at line line 16
$this
actingAs(
Authenticatable $user,
string|null $driver = null)
Set the currently logged in user for the application.
in ImpersonatesUsers at line line 30
void
be(
Authenticatable $user,
string|null $driver = null)
Set the currently logged in user for the application.
in InteractsWithAuthentication at line line 13
$this
seeIsAuthenticated(
string|null $guard = null)
Assert that the user is authenticated.
in InteractsWithAuthentication at line line 26
$this
dontSeeIsAuthenticated(
string|null $guard = null)
Assert that the user is not authenticated.
in InteractsWithAuthentication at line line 51
$this
seeIsAuthenticatedAs($user,
string|null $guard = null)
Assert that the user is authenticated as the given user.
in InteractsWithAuthentication at line line 68
$this
seeCredentials(
array $credentials,
string|null $guard = null)
Assert that the given credentials are valid.
in InteractsWithAuthentication at line line 84
$this
dontSeeCredentials(
array $credentials,
string|null $guard = null)
Assert that the given credentials are invalid.
in InteractsWithConsole at line line 23
int
artisan(
string $command,
array $parameters = array())
Call artisan command and return code.
in InteractsWithDatabase at line line 85
void
seed(
string $class = 'DatabaseSeeder')
Seed a given database connection.
in InteractsWithSession at line line 15
$this
withSession(
array $data)
Set the session to the given array.
in InteractsWithSession at line line 28
void
session(
array $data)
Set the session to the given array.
in InteractsWithSession at line line 68
void
seeInSession(
string|array $key,
mixed $value = null)
Assert that the session has a given value.
in InteractsWithSession at line line 82
void
assertSessionHas(
string|array $key,
mixed $value = null)
Assert that the session has a given value.
in InteractsWithSession at line line 101
void
assertSessionHasAll(
array $bindings)
Assert that the session has a given list of values.
in InteractsWithSession at line line 118
void
assertSessionMissing(
string|array $key)
Assert that the session does not have a given key.
in InteractsWithSession at line line 136
void
assertSessionHasErrors(
string|array $bindings = array(),
mixed $format = null)
Assert that the session has errors bound.
in InteractsWithSession at line line 158
void
assertHasOldInput()
Assert that the session has old input.
in MocksApplicationServices at line line 35
$this
expectsEvents(
array|string $events)
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.
in MocksApplicationServices at line line 62
$this
doesntExpectEvents(
array|string $events)
Specify a list of events that should not be fired for the given operation.
These events will be mocked, so that handlers will not actually be executed.
in MocksApplicationServices at line line 111
$this
withoutObservers(
array|string $observers)
Specify a list of observers that will not run for the given operation.
at line line 55
abstract
HttpKernelInterface
createApplication()
Creates the application.
Needs to be implemented by subclasses.