Client
class Client extends Client
Client simulates a browser and makes requests to a Kernel object.
Properties
protected | $history | from Client | |
protected | $cookieJar | from Client | |
protected | $server | from Client | |
protected | $internalRequest | from Client | |
protected | $request | from Client | |
protected | $internalResponse | from Client | |
protected | $response | from Client | |
protected | $crawler | from Client | |
protected | $insulated | from Client | |
protected | $redirect | from Client | |
protected | $followRedirects | from Client | |
protected | $followMetaRefresh | from Client | |
protected | $kernel |
Methods
No description
Sets whether to automatically follow redirects or not.
Sets whether to automatically follow meta refresh redirects or not.
Returns whether client automatically follows redirects or not.
Sets the maximum number of redirects that crawler can follow.
Gets single server parameter for specified key.
No description
A Response instance
A Request instance
Clicks the first link (or clickable image) that contains the given text.
Finds the first form that contains a button with the given content and uses it to submit the given form field values.
Calls a URI.
Makes a request.
Returns the script to execute when the request must be insulated.
Converts the HttpKernel response to a BrowserKit response.
Creates a crawler.
Takes a URI and converts it to absolute if it is not already absolute.
Makes a request from a Request object directly.
Sets whether to catch exceptions when the kernel is handling a request.
No description
Filters an array of files.
Details
__construct(HttpKernelInterface $kernel, array $server = array(), History $history = null, CookieJar $cookieJar = null)
followMetaRefresh(bool $followMetaRefresh = true)
Sets whether to automatically follow meta refresh redirects or not.
string
getServerParameter(string $key, string $default = '')
Gets single server parameter for specified key.
Crawler
xmlHttpRequest(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)
Crawler
clickLink(string $linkText)
Clicks the first link (or clickable image) that contains the given text.
Crawler
submitForm(string $button, array $fieldValues = array(), string $method = 'POST', array $serverParameters = array())
Finds the first form that contains a button with the given content and uses it to submit the given form field values.
Crawler
request(string $method, string $uri, array $parameters = array(), array $files = array(), array $server = array(), string $content = null, bool $changeHistory = true)
Calls a URI.
protected
getScript(object $request)
Returns the script to execute when the request must be insulated.
protected object
filterRequest(Request $request)
Converts the BrowserKit request to a HttpKernel request.
protected Response
filterResponse(object $response)
Converts the HttpKernel response to a BrowserKit response.
protected Crawler|null
createCrawlerFromContent(string $uri, string $content, string $type)
Creates a crawler.
This method returns null if the DomCrawler component is not available.
protected string
getAbsoluteUri(string $uri)
Takes a URI and converts it to absolute if it is not already absolute.
protected Crawler
requestFromRequest(Request $request, bool $changeHistory = true)
Makes a request from a Request object directly.
catchExceptions(bool $catchExceptions)
Sets whether to catch exceptions when the kernel is handling a request.
protected array
filterFiles(array $files)
Filters an array of files.
This method created test instances of UploadedFile so that the move() method can be called on those instances.
If the size of a file is greater than the allowed size (from php.ini) then an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE.