[ Index ] |
|
Code source de PRADO 3.0.6 |
[Code source] [Imprimer] [Statistiques]
Base include file for SimpleTest
Version: | $Id: browser.php 1397 2006-09-07 07:55:53Z wei $ |
Poids: | 1057 lignes (40 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
SimpleBrowserHistory:: (10 méthodes):
SimpleBrowserHistory()
_isEmpty()
_atBeginning()
_atEnd()
recordEntry()
getUrl()
getParameters()
back()
forward()
_dropFuture()
SimpleBrowser:: (66 méthodes):
SimpleBrowser()
_createUserAgent()
_createHistory()
ignoreFrames()
useFrames()
ignoreCookies()
useCookies()
_parse()
_buildPage()
_fetch()
_load()
_loadPage()
_loadFrame()
restart()
addHeader()
ageCookies()
setCookie()
getCookieValue()
getCurrentCookieValue()
setMaximumRedirects()
setMaximumNestedFrames()
setConnectionTimeout()
useProxy()
head()
get()
post()
retry()
back()
forward()
authenticate()
getFrames()
getFrameFocus()
setFrameFocusByIndex()
setFrameFocus()
clearFrameFocus()
getTransportError()
getMimeType()
getResponseCode()
getAuthentication()
getRealm()
getUrl()
getRequest()
getHeaders()
getContent()
getContentAsText()
getTitle()
getAbsoluteUrls()
getRelativeUrls()
setField()
setFieldByName()
setFieldById()
getField()
getFieldByName()
getFieldById()
clickSubmit()
clickSubmitByName()
clickSubmitById()
clickImage()
clickImageByName()
clickImageById()
submitFormById()
clickLink()
isLink()
clickLinkById()
isLinkById()
click()
Classe: SimpleBrowserHistory - X-Ref
Browser history list.SimpleBrowserHistory() X-Ref |
Starts empty. |
_isEmpty() X-Ref |
Test for no entries yet. return: boolean True if empty. |
_atBeginning() X-Ref |
Test for being at the beginning. return: boolean True if first. |
_atEnd() X-Ref |
Test for being at the last entry. return: boolean True if last. |
recordEntry($url, $parameters) X-Ref |
Adds a successfully fetched page to the history. param: SimpleUrl $url URL of fetch. param: SimpleEncoding $parameters Any post data with the fetch. |
getUrl() X-Ref |
Last fully qualified URL for current history position. return: SimpleUrl URL for this position. |
getParameters() X-Ref |
Parameters of last fetch from current history position. return: SimpleFormEncoding Post parameters. |
back() X-Ref |
Step back one place in the history. Stops at the first page. return: boolean True if any previous entries. |
forward() X-Ref |
Step forward one place. If already at the latest entry then nothing will happen. return: boolean True if any future entries. |
_dropFuture() X-Ref |
Ditches all future entries beyond the current point. |
Classe: SimpleBrowser - X-Ref
Simulated web browser. This is an aggregate ofSimpleBrowser() X-Ref |
Starts with a fresh browser with no cookie or any other state information. The exception is that a default proxy will be set up if specified in the options. |
_createUserAgent() X-Ref |
Creates the underlying user agent. return: SimpleFetcher Content fetcher. |
_createHistory() X-Ref |
Creates a new empty history list. return: SimpleBrowserHistory New list. |
ignoreFrames() X-Ref |
Disables frames support. Frames will not be fetched and the frameset page will be used instead. |
useFrames() X-Ref |
Enables frames support. Frames will be fetched from now on. |
ignoreCookies() X-Ref |
Switches off cookie sending and recieving. |
useCookies() X-Ref |
Switches back on the cookie sending and recieving. |
_parse($response, $depth = 0) X-Ref |
Parses the raw content into a page. Will load further frame pages unless frames are disabled. param: SimpleHttpResponse $response Response from fetch. param: integer $depth Nested frameset depth. return: SimplePage Parsed HTML. |
_buildPage($response) X-Ref |
Assembles the parsing machinery and actually parses a single page. Frees all of the builder memory and so unjams the PHP memory management. param: SimpleHttpResponse $response Response from fetch. return: SimplePage Parsed top level page. |
_fetch($url, $encoding, $depth = 0) X-Ref |
Fetches a page. Jointly recursive with the _parse() method as it descends a frameset. param: string/SimpleUrl $url Target to fetch. param: SimpleEncoding $encoding GET/POST parameters. param: integer $depth Nested frameset depth protection. return: SimplePage Parsed page. |
_load($url, $parameters) X-Ref |
Fetches a page or a single frame if that is the current focus. param: SimpleUrl $url Target to fetch. param: SimpleEncoding $parameters GET/POST parameters. return: string Raw content of page. |
_loadPage($url, $parameters) X-Ref |
Fetches a page and makes it the current page/frame. param: string/SimpleUrl $url Target to fetch as string. param: SimplePostEncoding $parameters POST parameters. return: string Raw content of page. |
_loadFrame($frames, $url, $parameters) X-Ref |
Fetches a frame into the existing frameset replacing the original. param: array $frames List of names to drill down. param: string/SimpleUrl $url Target to fetch as string. param: SimpleFormEncoding $parameters POST parameters. return: string Raw content of page. |
restart($date = false) X-Ref |
Removes expired and temporary cookies as if the browser was closed and re-opened. param: string/integer $date Time when session restarted. |
addHeader($header) X-Ref |
Adds a header to every fetch. param: string $header Header line to add to every |
ageCookies($interval) X-Ref |
Ages the cookies by the specified time. param: integer $interval Amount in seconds. |
setCookie($name, $value, $host = false, $path = '/', $expiry = false) X-Ref |
Sets an additional cookie. If a cookie has the same name and path it is replaced. param: string $name Cookie key. param: string $value Value of cookie. param: string $host Host upon which the cookie is valid. param: string $path Cookie path if not host wide. param: string $expiry Expiry date. |
getCookieValue($host, $path, $name) X-Ref |
Reads the most specific cookie value from the browser cookies. param: string $host Host to search. param: string $path Applicable path. param: string $name Name of cookie to read. return: string False if not present, else the |
getCurrentCookieValue($name) X-Ref |
Reads the current cookies for the current URL. param: string $name Key of cookie to find. return: string Null if there is no current URL, false |
setMaximumRedirects($max) X-Ref |
Sets the maximum number of redirects before a page will be loaded anyway. param: integer $max Most hops allowed. |
setMaximumNestedFrames($max) X-Ref |
Sets the maximum number of nesting of framed pages within a framed page to prevent loops. param: integer $max Highest depth allowed. |
setConnectionTimeout($timeout) X-Ref |
Sets the socket timeout for opening a connection. param: integer $timeout Maximum time in seconds. |
useProxy($proxy, $username = false, $password = false) X-Ref |
Sets proxy to use on all requests for when testing from behind a firewall. Set URL to false to disable. param: string $proxy Proxy URL. param: string $username Proxy username for authentication. param: string $password Proxy password for authentication. |
head($url, $parameters = false) X-Ref |
Fetches the page content with a HEAD request. Will affect cookies, but will not change the base URL. param: string/SimpleUrl $url Target to fetch as string. param: hash/SimpleHeadEncoding $parameters Additional parameters for return: boolean True if successful. |
get($url, $parameters = false) X-Ref |
Fetches the page content with a simple GET request. param: string/SimpleUrl $url Target to fetch. param: hash/SimpleFormEncoding $parameters Additional parameters for return: string Content of page or false. |
post($url, $parameters = false) X-Ref |
Fetches the page content with a POST request. param: string/SimpleUrl $url Target to fetch as string. param: hash/SimpleFormEncoding $parameters POST parameters. return: string Content of page. |
retry() X-Ref |
Equivalent to hitting the retry button on the browser. Will attempt to repeat the page fetch. If there is no history to repeat it will give false. return: string/boolean Content if fetch succeeded |
back() X-Ref |
Equivalent to hitting the back button on the browser. The browser history is unchanged on failure. The page content is refetched as there is no concept of content caching in SimpleTest. return: boolean True if history entry and |
forward() X-Ref |
Equivalent to hitting the forward button on the browser. The browser history is unchanged on failure. The page content is refetched as there is no concept of content caching in SimpleTest. return: boolean True if history entry and |
authenticate($username, $password) X-Ref |
Retries a request after setting the authentication for the current realm. param: string $username Username for realm. param: string $password Password for realm. return: boolean True if successful fetch. Note |
getFrames() X-Ref |
Accessor for a breakdown of the frameset. return: array Hash tree of frames by name |
getFrameFocus() X-Ref |
Accessor for current frame focus. Will be false if no frame has focus. return: integer/string/boolean Label if any, otherwise |
setFrameFocusByIndex($choice) X-Ref |
Sets the focus by index. The integer index starts from 1. param: integer $choice Chosen frame. return: boolean True if frame exists. |
setFrameFocus($name) X-Ref |
Sets the focus by name. param: string $name Chosen frame. return: boolean True if frame exists. |
clearFrameFocus() X-Ref |
Clears the frame focus. All frames will be searched for content. |
getTransportError() X-Ref |
Accessor for last error. return: string Error from last response. |
getMimeType() X-Ref |
Accessor for current MIME type. return: string MIME type as string; e.g. 'text/html' |
getResponseCode() X-Ref |
Accessor for last response code. return: integer Last HTTP response code received. |
getAuthentication() X-Ref |
Accessor for last Authentication type. Only valid straight after a challenge (401). return: string Description of challenge type. |
getRealm() X-Ref |
Accessor for last Authentication realm. Only valid straight after a challenge (401). return: string Name of security realm. |
getUrl() X-Ref |
Accessor for current URL of page or frame if focused. return: string Location of current page or frame as |
getRequest() X-Ref |
Accessor for raw bytes sent down the wire. return: string Original text sent. |
getHeaders() X-Ref |
Accessor for raw header information. return: string Header block. |
getContent() X-Ref |
Accessor for raw page information. return: string Original text content of web page. |
getContentAsText() X-Ref |
Accessor for plain text version of the page. return: string Normalised text representation. |
getTitle() X-Ref |
Accessor for parsed title. return: string Title or false if no title is present. |
getAbsoluteUrls() X-Ref |
Accessor for a list of all fixed links in current page. return: array List of urls with scheme of |
getRelativeUrls() X-Ref |
Accessor for a list of all relative links. return: array List of urls without hostname. |
setField($label, $value) X-Ref |
Sets all form fields with that name. param: string $label Name or label of field in forms. param: string $value New value of field. return: boolean True if field exists, otherwise false. |
setFieldByName($name, $value) X-Ref |
Sets all form fields with that name. Will use label if one is available (not yet implemented). param: string $name Name of field in forms. param: string $value New value of field. return: boolean True if field exists, otherwise false. |
setFieldById($id, $value) X-Ref |
Sets all form fields with that id attribute. param: string/integer $id Id of field in forms. param: string $value New value of field. return: boolean True if field exists, otherwise false. |
getField($label) X-Ref |
Accessor for a form element value within the page. Finds the first match. param: string $label Field label. return: string/boolean A value if the field is |
getFieldByName($name) X-Ref |
Accessor for a form element value within the page. Finds the first match. param: string $name Field name. return: string/boolean A string if the field is |
getFieldById($id) X-Ref |
Accessor for a form element value within the page. param: string/integer $id Id of field in forms. return: string/boolean A string if the field is |
clickSubmit($label = 'Submit', $additional = false) X-Ref |
Clicks the submit button by label. The owning form will be submitted by this. param: string $label Button label. An unlabeled param: hash $additional Additional form data. return: string/boolean Page on success. |
clickSubmitByName($name, $additional = false) X-Ref |
Clicks the submit button by name attribute. The owning form will be submitted by this. param: string $name Button name. param: hash $additional Additional form data. return: string/boolean Page on success. |
clickSubmitById($id, $additional = false) X-Ref |
Clicks the submit button by ID attribute of the button itself. The owning form will be submitted by this. param: string $id Button ID. param: hash $additional Additional form data. return: string/boolean Page on success. |
clickImage($label, $x = 1, $y = 1, $additional = false) X-Ref |
Clicks the submit image by some kind of label. Usually the alt tag or the nearest equivalent. The owning form will be submitted by this. Clicking outside of the boundary of the coordinates will result in a failure. param: string $label ID attribute of button. param: integer $x X-coordinate of imaginary click. param: integer $y Y-coordinate of imaginary click. param: hash $additional Additional form data. return: string/boolean Page on success. |
clickImageByName($name, $x = 1, $y = 1, $additional = false) X-Ref |
Clicks the submit image by the name. Usually the alt tag or the nearest equivalent. The owning form will be submitted by this. Clicking outside of the boundary of the coordinates will result in a failure. param: string $name Name attribute of button. param: integer $x X-coordinate of imaginary click. param: integer $y Y-coordinate of imaginary click. param: hash $additional Additional form data. return: string/boolean Page on success. |
clickImageById($id, $x = 1, $y = 1, $additional = false) X-Ref |
Clicks the submit image by ID attribute. The owning form will be submitted by this. Clicking outside of the boundary of the coordinates will result in a failure. param: integer/string $id ID attribute of button. param: integer $x X-coordinate of imaginary click. param: integer $y Y-coordinate of imaginary click. param: hash $additional Additional form data. return: string/boolean Page on success. |
submitFormById($id) X-Ref |
Submits a form by the ID. param: string $id The form ID. No submit button value return: string/boolean Page on success. |
clickLink($label, $index = 0) X-Ref |
Follows a link by label. Will click the first link found with this link text by default, or a later one if an index is given. The match ignores case and white space issues. param: string $label Text between the anchor tags. param: integer $index Link position counting from zero. return: string/boolean Page on success. |
isLink($label) X-Ref |
Tests to see if a link is present by label. param: string $label Text of value attribute. return: boolean True if link present. |
clickLinkById($id) X-Ref |
Follows a link by id attribute. param: string $id ID attribute value. return: string/boolean Page on success. |
isLinkById($id) X-Ref |
Tests to see if a link is present by ID attribute. param: string $id Text of id attribute. return: boolean True if link present. |
click($label) X-Ref |
Clicks a visible text item. Will first try buttons, then links and then images. param: string $label Visible text or alt text. return: string/boolean Raw page or false. |
Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |