Symfony2 API
Class

Symfony\Bundle\FrameworkBundle\Client

class Client extends Client

Client simulates a browser and makes requests to a Kernel object.

Methods

__construct(KernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)

Request|null getRequest()

Returns the current origin Request instance.

from Client
Response|null getResponse()

Returns the current origin response instance.

from Client
ContainerInterface getContainer()

Returns the container.

KernelInterface getKernel()

Returns the kernel.

Profile getProfile()

Gets the profile associated with the current Response.

enableProfiler()

Enables the profiler for the very next request.

Details

at line 36
public __construct(KernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)

Parameters

KernelInterface $kernel An HttpKernel instance
array $server The server parameters (equivalent of $_SERVER)
History $history A History instance to store the browser history
CookieJar $cookieJar A CookieJar instance to store the cookies

in Client at line 58
public Request|null getRequest()

Returns the current origin Request instance.

The origin request is the request instance that is sent to the code that handles requests.

Return Value

Request|null A Request instance

in Client at line 68
public Response|null getResponse()

Returns the current origin response instance.

The origin response is the response instance that is returned by the code that handles requests.

Return Value

Response|null A Response instance

at line 46
public ContainerInterface getContainer()

Returns the container.

Return Value

ContainerInterface

at line 56
public KernelInterface getKernel()

Returns the kernel.

Return Value

KernelInterface

at line 66
public Profile getProfile()

Gets the profile associated with the current Response.

Return Value

Profile A Profile instance

at line 80
public enableProfiler()

Enables the profiler for the very next request.

If the profiler is not enabled, the call to this method does nothing.