symfony API

sfBrowserBase Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

You are currently browsing the symfony API for the 1.4 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

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

    Go back in the browser history stack.

  • (sfBrowserBase) call ($uri, $method, $parameters, $changeStack)

    $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 ()

    Test for an uncaught exception.

  • (sfBrowserBase) clearCookies ()

    Clears all cookies.

    returns This sfBrowserBase instance

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

    $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)

    $name The checkbox or radiobutton id, name or text

    Simulates deselecting a checkbox or radiobutton.

  • doCall ()

    Calls a request to a uri.

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

    $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)

    $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)

    $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)

    $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)

    $uri The URI to fix

    Fixes uri removing # declarations and front controller.

    returns The fixed uri

  • (sfBrowserBase) followRedirect ()

    Follow redirects?

    throws sfException If request was not a redirect

  • (sfBrowserBase) forward ()

    Go forward in the browser history stack.

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

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

    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)

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

    Initializes sfBrowser - sets up environment

  • (void) newSession ()

    Creates a new session in the browser.

  • parseArgumentAsArray ($name, $value, $vars)

    $name The argument name
    $value The argument value

    Parses arguments as array

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

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

    Posts a uri.

  • (sfBrowserBase) reload ()

    Reload the current browser.

  • (sfBrowserBase) removeCookie ($name)

    $name The cookie name

    Removes a cookie by name.

    returns This sfBrowserBase instance

  • resetCurrentException ()

    Resets the current exception.

  • (sfBrowserBase) restart ()

    Reset browser to original state

  • (sfBrowserBase) select ($name)

    $name The checkbox or radiobutton id, name or text

    Simulates selecting a checkbox or radiobutton.

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

    $username The username
    $password The password

    Sets username and password for simulating http authentication.

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

    $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)

    $exception An Exception instance

    Sets the current exception.

  • (sfBrowserBase) setField ($name, $value)

    $name The field name
    $value The field value

    Sets a form field in the browser.

  • setHttpHeader ($header, $value)

    $header The header name
    $value The header value

    Sets a HTTP header for the very next request.

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

    $name The variable name
    $value The value

    Sets variable name

  • (void) shutdown ()

    Shutdown function to clean up and remove sessions

  • (void) __construct ($hostname, $remote, $options)

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

    Class constructor.