symfony API

sfBrowserBase Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

sfBrowserBase is the base class for sfBrowser.

Inheritence

sfBrowser  <  sfBrowserBase

Method Summary

  • sfBrowserBase back()
    Go back in the browser history stack.
  • sfBrowserBase call($uri, $method, $parameters, $changeStack)
    Calls a request to a uri.
  • boolean checkCurrentExceptionIsEmpty()
    Test for an uncaught exception.
  • sfBrowserBase clearCookies()
    Clears all cookies.
  • sfBrowserBase click($name, $arguments, $options)
    Simulates a click on a link or button.
  • sfBrowserBase deselect($name)
    Simulates deselecting a checkbox or radiobutton.
  • doCall()
    Calls a request to a uri.
  • array doClick($name, $arguments, $options)
    Simulates a click on a link or button.
  • array doClickCssSelector($selector, $arguments, $options)
    Simulates a click on an element indicated by CSS selector.
  • array doClickElement($item, $arguments, $options)
    Simulates a click on the supplied DOM element.
  • doSelect($name, $selected)
    Simulates selecting a checkbox or radiobutton.
  • string fixUri($uri)
    Fixes uri removing # declarations and front controller.
  • sfBrowserBase followRedirect()
    Follow redirects?
  • sfBrowserBase forward()
    Go forward in the browser history stack.
  • sfBrowserBase get($uri, $parameters, $changeStack)
    Gets a uri.
  • Exception getCurrentException()
    Gets the current exception.
  • sfWebRequest getRequest()
    Gets request.
  • sfWebResponse getResponse()
    Gets response.
  • sfDomCssSelector getResponseDom()
    Get response DOM.
  • sfDomCssSelector getResponseDomCssSelector()
    Get response DOM CSS selector.
  • DOMXPath getResponseDomXpath()
    Get the response DOM XPath selector.
  • sfUser getUser()
    Gets user.
  • void initialize($hostname, $remote, $options)
    Initializes sfBrowser - sets up environment
  • void newSession()
    Creates a new session in the browser.
  • parseArgumentAsArray($name, $value, $vars)
    Parses arguments as array
  • sfBrowserBase post($uri, $parameters, $changeStack)
    Posts a uri.
  • sfBrowserBase reload()
    Reload the current browser.
  • sfBrowserBase removeCookie($name)
    Removes a cookie by name.
  • resetCurrentException()
    Resets the current exception.
  • sfBrowserBase restart()
    Reset browser to original state
  • sfBrowserBase select($name)
    Simulates selecting a checkbox or radiobutton.
  • sfBrowserBase setAuth($username, $password)
    Sets username and password for simulating http authentication.
  • sfBrowserBase setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly)
    Sets a cookie.
  • setCurrentException($exception)
    Sets the current exception.
  • sfBrowserBase setField($name, $value)
    Sets a form field in the browser.
  • setHttpHeader($header, $value)
    Sets a HTTP header for the very next request.
  • sfBrowserBase 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

  • (sfBrowserBase) back () Browse code

    Go back in the browser history stack.

  • (sfBrowserBase) 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.

  • (sfBrowserBase) clearCookies () Browse code

    Clears all cookies.

    returns This sfBrowserBase instance

  • (sfBrowserBase) click ($name, $arguments, $options) Browse code

    $name The link, button text, CSS selector or DOMElement
    $arguments The arguments to pass to the link
    $options An array of options

    Simulates a click on a link or button.


    Available options:

    * position: The position of the linked to link if several ones have the same name
    (the first one is 1, not 0)
    * method: The method to used instead of the form ones
    (useful when you need to click on a link that is converted to a form with JavaScript code)

  • (sfBrowserBase) deselect ($name) Browse code

    $name The checkbox or radiobutton id, name or text

    Simulates deselecting a checkbox or radiobutton.

  • doCall () Browse code

    Calls a request to a uri.

  • (array) doClick ($name, $arguments, $options) Browse code

    $name The link or button text
    $arguments The arguments to pass to the link
    $options An array of options

    Simulates a click on a link or button.


    This method is called internally by the {@link click()} method.

    returns An array composed of the URI, the method and the arguments to pass to the {@link call()} call

    throws InvalidArgumentException If a matching element cannot be found

  • (array) doClickCssSelector ($selector, $arguments, $options) Browse code

    $selector The CSS selector
    $arguments The arguments to pass to the link
    $options An array of options

    Simulates a click on an element indicated by CSS selector.


    This method is called internally by the {@link click()} method.

    returns An array composed of the URI, the method and the arguments to pass to the {@link call()} call

    throws InvalidArgumentException If a matching element cannot be found

  • (array) doClickElement ($item, $arguments, $options) Browse code

    $item The element being clicked
    $arguments The arguments to pass to the link
    $options An array of options

    Simulates a click on the supplied DOM element.


    This method is called internally by the {@link click()} method.

    returns An array composed of the URI, the method and the arguments to pass to the call() call

  • doSelect ($name, $selected) Browse code

    $name The checkbox or radiobutton id, name or text
    $selected If true the item will be selected

    Simulates selecting a checkbox or radiobutton.


    This method is called internally by the select() and deselect() methods.

  • (string) fixUri ($uri) Browse code

    $uri The URI to fix

    Fixes uri removing # declarations and front controller.

    returns The fixed uri

  • (sfBrowserBase) followRedirect () Browse code

    Follow redirects?

    throws sfException If request was not a redirect

  • (sfBrowserBase) forward () Browse code

    Go forward in the browser history stack.

  • (sfBrowserBase) get ($uri, $parameters, $changeStack) Browse code

    $uri The URI to fetch
    $parameters The Request parameters
    $changeStack Change the browser history stack?

    Gets a uri.

  • (Exception) getCurrentException () Browse code

    Gets the 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.

  • (DOMXPath) getResponseDomXpath () Browse code

    Get the response DOM XPath selector.

  • (sfUser) getUser () Browse code

    Gets user.

  • (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) newSession () Browse code

    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

  • (sfBrowserBase) post ($uri, $parameters, $changeStack) Browse code

    $uri The URI to fetch
    $parameters The Request parameters
    $changeStack Change the browser history stack?

    Posts a uri.

  • (sfBrowserBase) reload () Browse code

    Reload the current browser.

  • (sfBrowserBase) removeCookie ($name) Browse code

    $name The cookie name

    Removes a cookie by name.

    returns This sfBrowserBase instance

  • resetCurrentException () Browse code

    Resets the current exception.

  • (sfBrowserBase) restart () Browse code

    Reset browser to original state

  • (sfBrowserBase) select ($name) Browse code

    $name The checkbox or radiobutton id, name or text

    Simulates selecting a checkbox or radiobutton.

  • (sfBrowserBase) setAuth ($username, $password) Browse code

    $username The username
    $password The password

    Sets username and password for simulating http authentication.

  • (sfBrowserBase) setCookie ($name, $value, $expire, $path, $domain, $secure, $httpOnly) Browse code

    $name The cookie name
    $value Value for the cookie
    $expire Cookie expiration period
    $path Path
    $domain Domain name
    $secure If secure
    $httpOnly If uses only HTTP

    Sets a cookie.

    returns This sfBrowserBase instance

  • setCurrentException ($exception) Browse code

    $exception An Exception instance

    Sets the current exception.

  • (sfBrowserBase) 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.

  • (sfBrowserBase) setVar ($name, $value) Browse code

    $name The variable name
    $value The value

    Sets variable name

  • (void) shutdown () Browse code

    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.