PHP 클래스 Symfony\Component\BrowserKit\Client

To make the actual request, you need to implement the doRequest() method. If you want to be able to run requests in their own process (insulated flag), you need to also implement the getScript() method.
저자: Fabien Potencier ([email protected])
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cookieJar
$crawler
$followRedirects
$history
$insulated
$redirect
$request
$response
$server

공개 메소드들

메소드 설명
__construct ( array $server = [], Symfony\Component\BrowserKit\History $history = null, Symfony\Component\BrowserKit\CookieJar $cookieJar = null ) Constructor.
back ( ) : Crawler Goes back in the browser history.
click ( Symfony\Component\DomCrawler\Link $link ) Clicks on a given link.
click ( Symfony\Component\DomCrawler\Link $link ) : Crawler Clicks on a given link.
followRedirect ( ) : Crawler Follow redirects?
followRedirects ( boolean $followRedirect = true ) Sets whether to automatically follow redirects or not.
forward ( ) : Crawler Goes forward in the browser history.
getCookieJar ( ) : Symfony\Component\BrowserKit\CookieJar Returns the CookieJar instance.
getCrawler ( ) : Crawler Returns the current Crawler instance.
getHistory ( ) : Symfony\Component\BrowserKit\History Returns the History instance.
getRequest ( ) : Symfony\Component\BrowserKit\Request Returns the current Request instance.
getRequest ( ) : Symfony\Component\BrowserKit\Request Returns the current Request instance.
getResponse ( ) : Symfony\Component\BrowserKit\Response Returns the current Response instance.
getResponse ( ) : Symfony\Component\BrowserKit\Response Returns the current Response instance.
getServerParameter ( string $key, string $default = '' ) : string Gets single server parameter for specified key.
insulate ( boolean $insulated = true ) Sets the insulated flag.
reload ( ) : Crawler Reloads the current browser.
request ( string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, boolean $changeHistory = true ) : Crawler Calls a URI.
restart ( ) Restarts the client.
setServerParameter ( string $key, string $value ) Sets single server parameter.
setServerParameters ( array $server ) Sets server parameters.
submit ( Form $form, array $values = [] ) Submits a form.
submit ( Form $form, array $values = [] ) : Crawler Submits a form.

보호된 메소드들

메소드 설명
createCrawlerFromContent ( string $uri, string $content, string $type ) : Crawler Creates a crawler.
createCrawlerFromContent ( string $uri, string $content, string $type ) : Crawler | null Creates a crawler.
doRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response Makes a request.
doRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response Makes a request.
doRequestInProcess ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response Makes a request in another process.
doRequestInProcess ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response Makes a request in another process.
filterRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Request Filters the request.
filterRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Request Filters the request.
filterResponse ( Symfony\Component\BrowserKit\Response $response ) : Symfony\Component\BrowserKit\Response Filters the Response.
filterResponse ( Symfony\Component\BrowserKit\Response $response ) : Symfony\Component\BrowserKit\Response Filters the Response.
getAbsoluteUri ( string $uri ) : string Takes a URI and converts it to absolute if it is not already absolute.
getScript ( Symfony\Component\BrowserKit\Request $request ) Returns the script to execute when the request must be insulated.
getScript ( Symfony\Component\BrowserKit\Request $request ) Returns the script to execute when the request must be insulated.
requestFromRequest ( Symfony\Component\BrowserKit\Request $request, boolean $changeHistory = true ) : Crawler Makes a request from a Request object directly.
requestFromRequest ( Symfony\Component\BrowserKit\Request $request, boolean $changeHistory = true ) : Crawler Makes a request from a Request object directly.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $server = [], Symfony\Component\BrowserKit\History $history = null, Symfony\Component\BrowserKit\CookieJar $cookieJar = null )
$server array The server parameters (equivalent of $_SERVER)
$history Symfony\Component\BrowserKit\History A History instance to store the browser history
$cookieJar Symfony\Component\BrowserKit\CookieJar A CookieJar instance to store the cookies

back() 공개 메소드

Goes back in the browser history.
public back ( ) : Crawler
리턴 Symfony\Component\DomCrawler\Crawler

click() 공개 메소드

Clicks on a given link.
public click ( Symfony\Component\DomCrawler\Link $link )
$link Symfony\Component\DomCrawler\Link A Link instance

click() 공개 메소드

Clicks on a given link.
public click ( Symfony\Component\DomCrawler\Link $link ) : Crawler
$link Symfony\Component\DomCrawler\Link A Link instance
리턴 Symfony\Component\DomCrawler\Crawler

createCrawlerFromContent() 보호된 메소드

Creates a crawler.
protected createCrawlerFromContent ( string $uri, string $content, string $type ) : Crawler
$uri string A uri
$content string Content for the crawler to use
$type string Content type
리턴 Symfony\Component\DomCrawler\Crawler

createCrawlerFromContent() 보호된 메소드

This method returns null if the DomCrawler component is not available.
protected createCrawlerFromContent ( string $uri, string $content, string $type ) : Crawler | null
$uri string A uri
$content string Content for the crawler to use
$type string Content type
리턴 Symfony\Component\DomCrawler\Crawler | null

doRequest() 추상적인 보호된 메소드

Makes a request.
abstract protected doRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response
$request Symfony\Component\BrowserKit\Request A Request instance
리턴 Symfony\Component\BrowserKit\Response A Response instance

doRequest() 추상적인 보호된 메소드

Makes a request.
abstract protected doRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response
$request Symfony\Component\BrowserKit\Request A Request instance
리턴 Symfony\Component\BrowserKit\Response A Response instance

doRequestInProcess() 보호된 메소드

Makes a request in another process.
protected doRequestInProcess ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response
$request Symfony\Component\BrowserKit\Request A Request instance
리턴 Symfony\Component\BrowserKit\Response A Response instance

doRequestInProcess() 보호된 메소드

Makes a request in another process.
protected doRequestInProcess ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Response
$request Symfony\Component\BrowserKit\Request A Request instance
리턴 Symfony\Component\BrowserKit\Response A Response instance

filterRequest() 보호된 메소드

Filters the request.
protected filterRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Request
$request Symfony\Component\BrowserKit\Request The request to filter
리턴 Symfony\Component\BrowserKit\Request

filterRequest() 보호된 메소드

Filters the request.
protected filterRequest ( Symfony\Component\BrowserKit\Request $request ) : Symfony\Component\BrowserKit\Request
$request Symfony\Component\BrowserKit\Request The request to filter
리턴 Symfony\Component\BrowserKit\Request

filterResponse() 보호된 메소드

Filters the Response.
protected filterResponse ( Symfony\Component\BrowserKit\Response $response ) : Symfony\Component\BrowserKit\Response
$response Symfony\Component\BrowserKit\Response The Response to filter
리턴 Symfony\Component\BrowserKit\Response

filterResponse() 보호된 메소드

Filters the Response.
protected filterResponse ( Symfony\Component\BrowserKit\Response $response ) : Symfony\Component\BrowserKit\Response
$response Symfony\Component\BrowserKit\Response The Response to filter
리턴 Symfony\Component\BrowserKit\Response

followRedirect() 공개 메소드

Follow redirects?
public followRedirect ( ) : Crawler
리턴 Symfony\Component\DomCrawler\Crawler

followRedirects() 공개 메소드

Sets whether to automatically follow redirects or not.
public followRedirects ( boolean $followRedirect = true )
$followRedirect boolean Whether to follow redirects

forward() 공개 메소드

Goes forward in the browser history.
public forward ( ) : Crawler
리턴 Symfony\Component\DomCrawler\Crawler

getAbsoluteUri() 보호된 메소드

Takes a URI and converts it to absolute if it is not already absolute.
protected getAbsoluteUri ( string $uri ) : string
$uri string A uri
리턴 string An absolute uri

getCookieJar() 공개 메소드

Returns the CookieJar instance.
public getCookieJar ( ) : Symfony\Component\BrowserKit\CookieJar
리턴 Symfony\Component\BrowserKit\CookieJar A CookieJar instance

getCrawler() 공개 메소드

Returns the current Crawler instance.
public getCrawler ( ) : Crawler
리턴 Symfony\Component\DomCrawler\Crawler A Crawler instance

getHistory() 공개 메소드

Returns the History instance.
public getHistory ( ) : Symfony\Component\BrowserKit\History
리턴 Symfony\Component\BrowserKit\History A History instance

getRequest() 공개 메소드

Returns the current Request instance.
public getRequest ( ) : Symfony\Component\BrowserKit\Request
리턴 Symfony\Component\BrowserKit\Request A Request instance

getRequest() 공개 메소드

Returns the current Request instance.
public getRequest ( ) : Symfony\Component\BrowserKit\Request
리턴 Symfony\Component\BrowserKit\Request A Request instance

getResponse() 공개 메소드

Returns the current Response instance.
public getResponse ( ) : Symfony\Component\BrowserKit\Response
리턴 Symfony\Component\BrowserKit\Response A Response instance

getResponse() 공개 메소드

Returns the current Response instance.
public getResponse ( ) : Symfony\Component\BrowserKit\Response
리턴 Symfony\Component\BrowserKit\Response A Response instance

getScript() 보호된 메소드

Returns the script to execute when the request must be insulated.
protected getScript ( Symfony\Component\BrowserKit\Request $request )
$request Symfony\Component\BrowserKit\Request A Request instance

getScript() 보호된 메소드

Returns the script to execute when the request must be insulated.
protected getScript ( Symfony\Component\BrowserKit\Request $request )
$request Symfony\Component\BrowserKit\Request A Request instance

getServerParameter() 공개 메소드

Gets single server parameter for specified key.
public getServerParameter ( string $key, string $default = '' ) : string
$key string A key of the parameter to get
$default string A default value when key is undefined
리턴 string A value of the parameter

insulate() 공개 메소드

Sets the insulated flag.
public insulate ( boolean $insulated = true )
$insulated boolean Whether to insulate the requests or not

reload() 공개 메소드

Reloads the current browser.
public reload ( ) : Crawler
리턴 Symfony\Component\DomCrawler\Crawler

request() 공개 메소드

Calls a URI.
public request ( string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, boolean $changeHistory = true ) : Crawler
$method string The request method
$uri string The URI to fetch
$parameters array The Request parameters
$files array The files
$server array The server parameters (HTTP headers are referenced with a HTTP_ prefix as PHP does)
$content string The raw body data
$changeHistory boolean Whether to update the history or not (only used internally for back(), forward(), and reload())
리턴 Symfony\Component\DomCrawler\Crawler

requestFromRequest() 보호된 메소드

Makes a request from a Request object directly.
protected requestFromRequest ( Symfony\Component\BrowserKit\Request $request, boolean $changeHistory = true ) : Crawler
$request Symfony\Component\BrowserKit\Request A Request instance
$changeHistory boolean Whether to update the history or not (only used internally for back(), forward(), and reload())
리턴 Symfony\Component\DomCrawler\Crawler

requestFromRequest() 보호된 메소드

Makes a request from a Request object directly.
protected requestFromRequest ( Symfony\Component\BrowserKit\Request $request, boolean $changeHistory = true ) : Crawler
$request Symfony\Component\BrowserKit\Request A Request instance
$changeHistory boolean Whether to update the history or not (only used internally for back(), forward(), and reload())
리턴 Symfony\Component\DomCrawler\Crawler

restart() 공개 메소드

It flushes history and all cookies.
public restart ( )

setServerParameter() 공개 메소드

Sets single server parameter.
public setServerParameter ( string $key, string $value )
$key string A key of the parameter
$value string A value of the parameter

setServerParameters() 공개 메소드

Sets server parameters.
public setServerParameters ( array $server )
$server array An array of server parameters

submit() 공개 메소드

Submits a form.
public submit ( Form $form, array $values = [] )
$form Symfony\Component\DomCrawler\Form A Form instance
$values array An array of form field values

submit() 공개 메소드

Submits a form.
public submit ( Form $form, array $values = [] ) : Crawler
$form Symfony\Component\DomCrawler\Form A Form instance
$values array An array of form field values
리턴 Symfony\Component\DomCrawler\Crawler

프로퍼티 상세

$cookieJar 보호되어 있는 프로퍼티

protected $cookieJar

$crawler 보호되어 있는 프로퍼티

protected $crawler

$followRedirects 보호되어 있는 프로퍼티

protected $followRedirects

$history 보호되어 있는 프로퍼티

protected $history

$insulated 보호되어 있는 프로퍼티

protected $insulated

$redirect 보호되어 있는 프로퍼티

protected $redirect

$request 보호되어 있는 프로퍼티

protected $request

$response 보호되어 있는 프로퍼티

protected $response

$server 보호되어 있는 프로퍼티

protected $server