symfony API

sfBrowserBase Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.2 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfBrowserBase is the base class for sfBrowser.

Inheritence

sfBrowser  <  sfBrowserBase

Method Summary

  • back()
    Go back in the browser history stack.
  • call($uri, $method = &apos;get&apos;, $parameters = array(), $changeStack = true)
    Calls a request to a uri.
  • boolean checkCurrentExceptionIsEmpty()
    Test for an uncaught exception.
  • clearCookies()
    Clears all cookies.
  • click($name, $arguments = array(), $options = array())
    Simulates a click on a link or button.
  • deselect($name)
    Simulates deselecting a checkbox or radiobutton.
  • doCall()
    Calls a request to a uri.
  • array doClick($name, $arguments = array(), $options = array())
    Simulates a click on a link or button.
  • doSelect($name, $selected)
    Simulates selecting a checkbox or radiobutton.
  • string fixUri($uri)
    Fixes uri removing # declarations and front controller.
  • followRedirect()
    Follow redirects?
  • forward()
    Go forward in the browser history stack.
  • get($uri, $parameters = array(), $changeStack = true)
    Gets a uri.
  • Exception getCurrentException()
    Gets the current exception.
  • getRequest()
    Gets request.
  • getResponse()
    Gets response.
  • getResponseDom()
    Get response dom.
  • getResponseDomCssSelector()
    Get response dom css selector.
  • getUser()
    Gets user.
  • initialize($hostname = null, $remote = null, $options = array())
    Initializes sfBrowser - sets up environment
  • newSession()
    Creates a new session in the browser.
  • parseArgumentAsArray($name, $value, &amp;$vars, $vars)
    Parses arguments as array
  • post($uri, $parameters = array(), $changeStack = true)
    Posts a uri.
  • reload()
    Reload the current browser.
  • removeCookie($name)
    Removes a cookie by name.
  • resetCurrentException()
    Resets the current exception.
  • restart()
    Reset browser to original state
  • select($name)
    Simulates selecting a checkbox or radiobutton.
  • setAuth($username, $password)
    Sets username and password for simulating http authentication.
  • setCookie($name, $value, $expire = null, $path = &apos;/&apos;, $domain = &apos;&apos;, $secure = false, $httpOnly = false)
    Sets a cookie.
  • setCurrentException($exception)
    Sets the current exception.
  • setField($name, $value)
    Sets a form field in the browser.
  • setHttpHeader($header, $value)
    Sets a HTTP header for the very next request.
  • setVar($name, $value)
    Sets variable name
  • shutdown()
    Shutdown function to clean up and remove sessions
  • __construct($hostname = null, $remote = null, $options = array())
    Class constructor.

Method Details

  • back () Browse code

    Go back in the browser history stack.

  • call ($uri, $method = 'get', $parameters = array(), $changeStack = true) 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.

  • clearCookies () Browse code

    Clears all cookies.

    returns This sfBrowserBase instance

  • click ($name, $arguments = array(), $options = array()) 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.

  • 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 = array(), $options = array()) 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 click() method.

    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)

    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

  • followRedirect () Browse code

    Follow redirects?

    throws sfException If request was not a redirect

  • forward () Browse code

    Go forward in the browser history stack.

  • get ($uri, $parameters = array(), $changeStack = true) 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.

  • getRequest () Browse code

    Gets request.

  • getResponse () Browse code

    Gets response.

  • getResponseDom () Browse code

    Get response dom.

  • getResponseDomCssSelector () Browse code

    Get response dom css selector.

  • getUser () Browse code

    Gets user.

  • initialize ($hostname = null, $remote = null, $options = array()) Browse code

    $hostname Hostname to browse
    $remote Remote address to spook
    $options Options for sfBrowser

    Initializes sfBrowser - sets up environment

  • newSession () Browse code

    Creates a new session in the browser.

  • parseArgumentAsArray ($name, $value, &$vars, $vars) Browse code

    $name The argument name
    $value The argument value
    &$vars
    $vars

    Parses arguments as array

  • post ($uri, $parameters = array(), $changeStack = true) Browse code

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

    Posts a uri.

  • reload () Browse code

    Reload the current browser.

  • removeCookie ($name) Browse code

    $name The cookie name

    Removes a cookie by name.

    returns This sfBrowserBase instance

  • resetCurrentException () Browse code

    Resets the current exception.

  • restart () Browse code

    Reset browser to original state

  • select ($name) Browse code

    $name The checkbox or radiobutton id, name or text

    Simulates selecting a checkbox or radiobutton.

  • setAuth ($username, $password) Browse code

    $username The username
    $password The password

    Sets username and password for simulating http authentication.

  • setCookie ($name, $value, $expire = null, $path = '/', $domain = '', $secure = false, $httpOnly = false) 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.

  • 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.

  • setVar ($name, $value) Browse code

    $name The variable name
    $value The value

    Sets variable name

  • shutdown () Browse code

    Shutdown function to clean up and remove sessions

  • __construct ($hostname = null, $remote = null, $options = array()) Browse code

    $hostname Hostname to browse
    $remote Remote address to spook
    $options Options for sfBrowser

    Class constructor.