sfBrowser simulates a fake browser which can surf a symfony application.
Method Summary
-
sfBrowser
back()
Go back in the browser history stack.
-
sfBrowser
call($uri, $method, $parameters, $changeStack)
Calls a request to a uri.
-
boolean
checkCurrentExceptionIsEmpty()
Test for an uncaught exception.
-
sfBrowser
click($name, $arguments)
Simulates a click on a link or button.
-
string
fixUri($uri)
Fixes uri removing # declarations and front controller.
-
sfBrowser
followRedirect()
Follow redirects?
-
sfBrowser
forward()
Go forward in the browser history stack.
-
sfBrowser
get($uri, $parameters)
Gets a uri.
-
sfContext
getContext($forceReload)
Returns the current application context.
-
sfException
getCurrentException()
Gets current exception.
-
sfWebRequest
getRequest()
Gets request.
-
sfWebResponse
getResponse()
Gets response.
-
sfDomCssSelector
getResponseDom()
Get response dom.
-
sfDomCssSelector
getResponseDomCssSelector()
Get response dom css selector.
-
void
initialize($hostname, $remote, $options)
Initializes sfBrowser - sets up environment
-
void
listenToException($event)
Listener for exceptions
-
void
newSession()
Creates a new session in the browser.
-
parseArgumentAsArray($name, $value, $vars)
Parses arguments as array
-
sfBrowser
post($uri, $parameters)
Posts a uri.
-
sfBrowser
reload()
Reload the current browser.
-
resetCurrentException()
Resets the current exception.
-
sfBrowser
restart()
Reset browser to original state
-
sfBrowser
setAuth($username, $password)
Sets username and password for simulating http authentication.
-
sfBrowser
setField($name, $value)
Sets a form field in the browser.
-
setHttpHeader($header, $value)
Sets a HTTP header for the very next request.
-
sfBrowser
setVar($name, $value)
Sets variable name
-
void
shutdown()
Shutdown function to clean up and remove sessions
-
void
__construct($hostname, $remote, $options)
Class constructor.
Method Details
-
Go back in the browser history stack.
-
(sfBrowser) call ($uri, $method, $parameters, $changeStack)
Browse code
| $uri |
The URI to fetch |
| $method |
The request method |
| $parameters |
The Request parameters |
| $changeStack |
Change the browser history stack? |
Calls a request to a uri.
-
(boolean) checkCurrentExceptionIsEmpty ()
Browse code
Test for an uncaught exception.
-
(sfBrowser) click ($name, $arguments)
Browse code
| $name |
The link or button text |
Simulates a click on a link or button.
-
(string) fixUri ($uri)
Browse code
Fixes uri removing # declarations and front controller.
returns The fixed uri
-
(sfBrowser) followRedirect ()
Browse code
Follow redirects?
throws sfException If request was not a redirect
-
(sfBrowser) forward ()
Browse code
Go forward in the browser history stack.
-
(sfBrowser) get ($uri, $parameters)
Browse code
| $uri |
The URI to fetch |
| $parameters |
The Request parameters |
Gets a uri.
-
(sfContext) getContext ($forceReload)
Browse code
| $forceReload |
true to force context reload, false otherwise |
Returns the current application context.
-
(sfException) getCurrentException ()
Browse code
Gets current exception.
-
(sfWebRequest) getRequest ()
Browse code
Gets request.
-
(sfWebResponse) getResponse ()
Browse code
Gets response.
-
(sfDomCssSelector) getResponseDom ()
Browse code
Get response dom.
-
(sfDomCssSelector) getResponseDomCssSelector ()
Browse code
Get response dom css selector.
-
(void) initialize ($hostname, $remote, $options)
Browse code
| $hostname |
Hostname to browse |
| $remote |
Remote address to spook |
| $options |
Options for sfBrowser |
Initializes sfBrowser - sets up environment
-
(void) listenToException ($event)
Browse code
| $event |
The event to handle |
Listener for exceptions
-
Creates a new session in the browser.
-
parseArgumentAsArray ($name, $value, $vars)
Browse code
| $name |
The argument name |
| $value |
The argument value |
Parses arguments as array
-
(sfBrowser) post ($uri, $parameters)
Browse code
| $uri |
The URI to fetch |
| $parameters |
The Request parameters |
Posts a uri.
-
Reload the current browser.
-
resetCurrentException ()
Browse code
Resets the current exception.
-
(sfBrowser) restart ()
Browse code
Reset browser to original state
-
(sfBrowser) setAuth ($username, $password)
Browse code
| $username |
The username |
| $password |
The password |
Sets username and password for simulating http authentication.
-
(sfBrowser) setField ($name, $value)
Browse code
| $name |
The field name |
| $value |
The field value |
Sets a form field in the browser.
-
setHttpHeader ($header, $value)
Browse code
| $header |
The header name |
| $value |
The header value |
Sets a HTTP header for the very next request.
-
(sfBrowser) setVar ($name, $value)
Browse code
| $name |
The variable name |
| $value |
The value |
Sets variable name
-
Shutdown function to clean up and remove sessions
-
(void) __construct ($hostname, $remote, $options)
Browse code
| $hostname |
Hostname to browse |
| $remote |
Remote address to spook |
| $options |
Options for sfBrowser |
Class constructor.
|