class TestCase extends PHPUnit_Framework_TestCase (View source)
ApplicationTrait |
AssertionsTrait |
CrawlerTrait |
InteractsWithPages |
$this | expectsEvents( array|mixed $events) Specify a list of events that should be fired for the given operation. | from ApplicationTrait |
$this | withSession( array $data) Set the session to the given array. | from ApplicationTrait |
void | session( array $data) Set the session to the given array. | from ApplicationTrait |
void | flushSession() Flush all of the current session data. | from ApplicationTrait |
$this | withoutMiddleware() Disable middleware for the test. | from ApplicationTrait |
$this | actingAs( Authenticatable $user, string|null $driver = null) Set the currently logged in user for the application. | from ApplicationTrait |
void | be( Authenticatable $user, string|null $driver = null) Set the currently logged in user for the application. | from ApplicationTrait |
void | seed( string $class = 'DatabaseSeeder') Seed a given database connection. | from ApplicationTrait |
int | artisan( string $command, array $parameters = array()) Call artisan command and return code. | from ApplicationTrait |
void | assertResponseOk() Assert that the client response has an OK status code. | from AssertionsTrait |
void | assertResponseStatus( int $code) Assert that the client response has a given code. | from AssertionsTrait |
void | assertViewHas( string|array $key, mixed $value = null) Assert that the response view has a given piece of bound data. | from AssertionsTrait |
void | assertViewHasAll( array $bindings) Assert that the view has a given list of bound data. | from AssertionsTrait |
void | assertViewMissing( string $key) Assert that the response view is missing a piece of bound data. | from AssertionsTrait |
void | assertRedirectedTo( string $uri, array $with = array()) Assert whether the client was redirected to a given URI. | from AssertionsTrait |
void | assertRedirectedToRoute( string $name, array $parameters = array(), array $with = array()) Assert whether the client was redirected to a given route. | from AssertionsTrait |
void | assertRedirectedToAction( string $name, array $parameters = array(), array $with = array()) Assert whether the client was redirected to a given action. | from AssertionsTrait |
void | assertSessionHas( string|array $key, mixed $value = null) Assert that the session has a given value. | from AssertionsTrait |
void | assertSessionHasAll( array $bindings) Assert that the session has a given list of values. | from AssertionsTrait |
void | assertSessionHasErrors( string|array $bindings = array(), mixed $format = null) Assert that the session has errors bound. | from AssertionsTrait |
void | assertHasOldInput() Assert that the session has old input. | from AssertionsTrait |
$this | visit( string $uri) Visit the given URI with a GET request. | from InteractsWithPages |
$this | seeInElement( string $element, string $text, bool $negate = false) Assert that a given string is seen inside an element. | from InteractsWithPages |
$this | dontSeeInElement( string $element, string $text) Assert that a given string is not seen inside an element. | from InteractsWithPages |
$this | seeLink( string $text, string|null $url = null) Assert that a given link is seen on the page. | from InteractsWithPages |
$this | dontSeeLink( string $text, string|null $url = null) Assert that a given link is not seen on the page. | from InteractsWithPages |
$this | seeInField( string $selector, string $expected) Assert that an input field contains the given value. | from InteractsWithPages |
$this | dontSeeInField( string $selector, string $value) Assert that an input field does not contain the given value. | from InteractsWithPages |
$this | seeIsChecked( string $selector) Assert that the given checkbox is selected. | from InteractsWithPages |
$this | dontSeeIsChecked( string $selector) Assert that the given checkbox is not selected. | from InteractsWithPages |
$this | seeIsSelected( string $selector, string $expected) Assert that the expected value is selected. | from InteractsWithPages |
$this | dontSeeIsSelected( string $selector, string $value) Assert that the given value is not selected. | from InteractsWithPages |
$this | json( string $method, string $uri, array $data = array(), array $headers = array()) Visit the given URI with a JSON request. | from CrawlerTrait |
$this | get( string $uri, array $headers = array()) Visit the given URI with a GET request. | from CrawlerTrait |
$this | post( string $uri, array $data = array(), array $headers = array()) Visit the given URI with a POST request. | from CrawlerTrait |
$this | put( string $uri, array $data = array(), array $headers = array()) Visit the given URI with a PUT request. | from CrawlerTrait |
$this | patch( string $uri, array $data = array(), array $headers = array()) Visit the given URI with a PATCH request. | from CrawlerTrait |
$this | delete( string $uri, array $data = array(), array $headers = array()) Visit the given URI with a DELETE request. | from CrawlerTrait |
$this | handle( Request $request) Send the given request through the application. | from CrawlerTrait |
$this | seeJsonEquals( array $data) Assert that the response contains an exact JSON array. | from CrawlerTrait |
$this | seeJson( array $data = null, bool $negate = false) Assert that the response contains JSON. | from CrawlerTrait |
$this | dontSeeJson( array $data = null) Assert that the response doesn't contain JSON. | from CrawlerTrait |
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. | from CrawlerTrait |
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. | from CrawlerTrait |
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. | from CrawlerTrait |
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. | from CrawlerTrait |
void | dump() Dump the content from the last response. | from CrawlerTrait |
HttpKernelInterface | createApplication() Creates the application. | |
void | setUp() Setup the test environment. | |
void | tearDown() Clean up the testing environment before the next test. |
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.
Set the session to the given array.
Set the session to the given array.
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.
Seed a given database connection.
Call artisan command and return code.
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.
Assert that the session has a given value.
Assert that the session has a given list of values.
Assert that the session has errors bound.
Assert that the session has old input.
Visit the given URI with a GET request.
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 given checkbox is selected.
Assert that the given checkbox is not selected.
Assert that the expected value is selected.
Assert that the given value 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.
Send the given request through the application.
This method allows you to fully customize the entire Request object.
Assert that the response contains an exact JSON array.
Assert that the response contains JSON.
Assert that the response doesn't contain JSON.
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.
Dump the content from the last response.
Creates the application.
Needs to be implemented by subclasses.
Setup the test environment.
Clean up the testing environment before the next test.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Foundation/Testing/TestCase.html