|
Moodle
2.2.1
http://www.collinsharper.com
|
Definition at line 160 of file browser.php.
| & _buildPage | ( | $ | response | ) |
Assembles the parsing machinery and actually parses a single page. Frees all of the builder memory and so unjams the PHP memory management.
| SimpleHttpResponse | $response | Response from fetch. |
Definition at line 269 of file browser.php.

| & _createHistory | ( | ) |
Creates a new empty history list.
Definition at line 201 of file browser.php.

| & _createUserAgent | ( | ) |
Creates the underlying user agent.
Definition at line 191 of file browser.php.

| & _fetch | ( | $ | url, |
| $ | encoding, | ||
| $ | depth = 0 |
||
| ) |
Fetches a page. Jointly recursive with the _parse() method as it descends a frameset.
| string/SimpleUrl | $url Target to fetch. | |
| SimpleEncoding | $encoding | GET/POST parameters. |
| integer | $depth | Nested frameset depth protection. |
Definition at line 286 of file browser.php.


| _load | ( | $ | url, |
| $ | parameters | ||
| ) |
Fetches a page or a single frame if that is the current focus.
| SimpleUrl | $url | Target to fetch. |
| SimpleEncoding | $parameters | GET/POST parameters. |
Definition at line 304 of file browser.php.


| _loadFrame | ( | $ | frames, |
| $ | url, | ||
| $ | parameters | ||
| ) |
Fetches a frame into the existing frameset replacing the original.
| array | $frames | List of names to drill down. |
| string/SimpleUrl | $url Target to fetch as string. | |
| SimpleFormEncoding | $parameters | POST parameters. |
Definition at line 336 of file browser.php.


| _loadPage | ( | $ | url, |
| $ | parameters | ||
| ) |
Fetches a page and makes it the current page/frame.
| string/SimpleUrl | $url Target to fetch as string. | |
| SimplePostEncoding | $parameters | POST parameters. |
Definition at line 319 of file browser.php.


| & _parse | ( | $ | response, |
| $ | depth = 0 |
||
| ) |
Parses the raw content into a page. Will load further frame pages unless frames are disabled.
| SimpleHttpResponse | $response | Response from fetch. |
| integer | $depth | Nested frameset depth. |
Definition at line 248 of file browser.php.


| addHeader | ( | $ | header | ) |
Adds a header to every fetch.
| string | $header | Header line to add to every request until cleared. public |
Definition at line 360 of file browser.php.
| ageCookies | ( | $ | interval | ) |
Ages the cookies by the specified time.
| integer | $interval | Amount in seconds. public |
Definition at line 369 of file browser.php.
| authenticate | ( | $ | username, |
| $ | password | ||
| ) |
Retries a request after setting the authentication for the current realm.
| string | $username | Username for realm. |
| string | $password | Password for realm. |
Definition at line 583 of file browser.php.

| back | ( | ) |
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.
Definition at line 542 of file browser.php.

| clearFrameFocus | ( | ) |
Clears the frame focus. All frames will be searched for content. public
Definition at line 646 of file browser.php.
| click | ( | $ | label | ) |
Clicks a visible text item. Will first try buttons, then links and then images.
| string | $label | Visible text or alt text. |
Definition at line 1077 of file browser.php.

| clickImage | ( | $ | label, |
| $ | x = 1, |
||
| $ | y = 1, |
||
| $ | additional = false |
||
| ) |
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.
| string | $label | ID attribute of button. |
| integer | $x | X-coordinate of imaginary click. |
| integer | $y | Y-coordinate of imaginary click. |
| hash | $additional | Additional form data. |
Definition at line 923 of file browser.php.


| clickImageById | ( | $ | id, |
| $ | x = 1, |
||
| $ | y = 1, |
||
| $ | additional = false |
||
| ) |
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.
| integer/string | $id ID attribute of button. | |
| integer | $x | X-coordinate of imaginary click. |
| integer | $y | Y-coordinate of imaginary click. |
| hash | $additional | Additional form data. |
Definition at line 968 of file browser.php.

| clickImageByName | ( | $ | name, |
| $ | x = 1, |
||
| $ | y = 1, |
||
| $ | additional = false |
||
| ) |
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.
| string | $name | Name attribute of button. |
| integer | $x | X-coordinate of imaginary click. |
| integer | $y | Y-coordinate of imaginary click. |
| hash | $additional | Additional form data. |
Definition at line 946 of file browser.php.

| clickLink | ( | $ | label, |
| $ | index = 0 |
||
| ) |
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.
| string | $label | Text between the anchor tags. |
| integer | $index | Link position counting from zero. |
Definition at line 1037 of file browser.php.


| clickLinkById | ( | $ | id | ) |
Follows a link by id attribute.
| string | $id | ID attribute value. |
Definition at line 1062 of file browser.php.

| clickSubmit | ( | $ | label = 'Submit', |
| $ | additional = false |
||
| ) |
Clicks the submit button by label. The owning form will be submitted by this.
| string | $label | Button label. An unlabeled button can be triggered by 'Submit'. |
| hash | $additional | Additional form data. |
Definition at line 853 of file browser.php.


| clickSubmitById | ( | $ | id, |
| $ | additional = false |
||
| ) |
Clicks the submit button by ID attribute of the button itself. The owning form will be submitted by this.
| string | $id | Button ID. |
| hash | $additional | Additional form data. |
Definition at line 889 of file browser.php.

| clickSubmitByName | ( | $ | name, |
| $ | additional = false |
||
| ) |
Clicks the submit button by name attribute. The owning form will be submitted by this.
| string | $name | Button name. |
| hash | $additional | Additional form data. |
Definition at line 871 of file browser.php.

| forward | ( | ) |
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.
Definition at line 562 of file browser.php.

| get | ( | $ | url, |
| $ | parameters = false |
||
| ) |
Fetches the page content with a simple GET request.
| string/SimpleUrl | $url Target to fetch. |
| hash/SimpleFormEncoding | $parameters Additional parameters for GET request. |
Definition at line 482 of file browser.php.

Accessor for last Authentication type. Only valid straight after a challenge (401).
Definition at line 683 of file browser.php.
| getBaseUrl | ( | ) |
Accessor for base URL of page if set via BASE tag
Definition at line 712 of file browser.php.
| getContent | ( | ) |
Accessor for raw page information.
Definition at line 740 of file browser.php.

| getContentAsText | ( | ) |
Accessor for plain text version of the page.
Definition at line 749 of file browser.php.
| getCookieValue | ( | $ | host, |
| $ | path, | ||
| $ | name | ||
| ) |
Reads the most specific cookie value from the browser cookies.
| string | $host | Host to search. |
| string | $path | Applicable path. |
| string | $name | Name of cookie to read. |
Definition at line 397 of file browser.php.
| getCurrentCookieValue | ( | $ | name | ) |
Reads the current cookies for the current URL.
| string | $name | Key of cookie to find. |
Definition at line 408 of file browser.php.
| getField | ( | $ | label | ) |
Accessor for a form element value within the page. Finds the first match.
| string | $label | Field label. |
Definition at line 815 of file browser.php.
| getFieldById | ( | $ | id | ) |
Accessor for a form element value within the page.
| string/integer | $id Id of field in forms. |
Definition at line 840 of file browser.php.
| getFieldByName | ( | $ | name | ) |
Accessor for a form element value within the page. Finds the first match.
| string | $name | Field name. |
Definition at line 828 of file browser.php.
| getFrameFocus | ( | ) |
Accessor for current frame focus. Will be false if no frame has focus.
Definition at line 617 of file browser.php.
| getFrames | ( | ) |
Accessor for a breakdown of the frameset.
Definition at line 605 of file browser.php.
| getHeaders | ( | ) |
Accessor for raw header information.
Definition at line 731 of file browser.php.
| getLink | ( | $ | label, |
| $ | index = 0 |
||
| ) |
Finds a URL by label. Will find 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.
| string | $label | Text between the anchor tags. |
| integer | $index | Link position counting from zero. |
Definition at line 1016 of file browser.php.

| getLinkById | ( | $ | id | ) |
Finds a link by id attribute.
| string | $id | ID attribute value. |
Definition at line 1052 of file browser.php.

| getMimeType | ( | ) |
Accessor for current MIME type.
Definition at line 664 of file browser.php.
| getRealm | ( | ) |
Accessor for last Authentication realm. Only valid straight after a challenge (401).
Definition at line 693 of file browser.php.
| getRequest | ( | ) |
Accessor for raw bytes sent down the wire.
Definition at line 722 of file browser.php.
| getResponseCode | ( | ) |
Accessor for last response code.
Definition at line 673 of file browser.php.
| getTitle | ( | ) |
Accessor for parsed title.
Definition at line 758 of file browser.php.
Accessor for last error.
Definition at line 655 of file browser.php.
| getUrl | ( | ) |
Accessor for current URL of page or frame if focused.
Definition at line 703 of file browser.php.

| getUrls | ( | ) |
Accessor for a list of all links in current page.
Definition at line 768 of file browser.php.
| head | ( | $ | url, |
| $ | parameters = false |
||
| ) |
Fetches the page content with a HEAD request. Will affect cookies, but will not change the base URL.
| string/SimpleUrl | $url Target to fetch as string. |
| hash/SimpleHeadEncoding | $parameters Additional parameters for HEAD request. |
Definition at line 463 of file browser.php.

| ignoreCookies | ( | ) |
Switches off cookie sending and recieving. public
Definition at line 228 of file browser.php.
| ignoreFrames | ( | ) |
Disables frames support. Frames will not be fetched and the frameset page will be used instead. public
Definition at line 211 of file browser.php.
| isClickable | ( | $ | label | ) |
Tests to see if a click target exists.
| string | $label | Visible text or alt text. |
Definition at line 1094 of file browser.php.

| isImage | ( | $ | label | ) |
Tests to see if an image exists with this title or alt text.
| string | $label | Image text. |
Definition at line 985 of file browser.php.

| isSubmit | ( | $ | label | ) |
Tests to see if a submit button exists with this label.
| string | $label | Button label. |
Definition at line 906 of file browser.php.

| post | ( | $ | url, |
| $ | parameters = false |
||
| ) |
Fetches the page content with a POST request.
| string/SimpleUrl | $url Target to fetch as string. |
| hash/SimpleFormEncoding | $parameters POST parameters. |
Definition at line 499 of file browser.php.

| restart | ( | $ | date = false | ) |
Removes expired and temporary cookies as if the browser was closed and re-opened.
| string/integer | $date Time when session restarted. If omitted then all persistent cookies are kept. public |
Definition at line 350 of file browser.php.
| retry | ( | ) |
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.
Definition at line 517 of file browser.php.


| setConnectionTimeout | ( | $ | timeout | ) |
Sets the socket timeout for opening a connection.
| integer | $timeout | Maximum time in seconds. public |
Definition at line 437 of file browser.php.
| setCookie | ( | $ | name, |
| $ | value, | ||
| $ | host = false, |
||
| $ | path = '/', |
||
| $ | expiry = false |
||
| ) |
Sets an additional cookie. If a cookie has the same name and path it is replaced.
| string | $name | Cookie key. |
| string | $value | Value of cookie. |
| string | $host | Host upon which the cookie is valid. |
| string | $path | Cookie path if not host wide. |
| string | $expiry | Expiry date. public |
Definition at line 383 of file browser.php.
| setField | ( | $ | label, |
| $ | value, | ||
| $ | position = false |
||
| ) |
Sets all form fields with that name.
| string | $label | Name or label of field in forms. |
| string | $value | New value of field. |
Definition at line 779 of file browser.php.
| setFieldById | ( | $ | id, |
| $ | value | ||
| ) |
Sets all form fields with that id attribute.
| string/integer | $id Id of field in forms. | |
| string | $value | New value of field. |
Definition at line 802 of file browser.php.
| setFieldByName | ( | $ | name, |
| $ | value, | ||
| $ | position = false |
||
| ) |
Sets all form fields with that name. Will use label if one is available (not yet implemented).
| string | $name | Name of field in forms. |
| string | $value | New value of field. |
Definition at line 791 of file browser.php.
| setFrameFocus | ( | $ | name | ) |
Sets the focus by name.
| string | $name | Chosen frame. |
Definition at line 637 of file browser.php.
| setFrameFocusByIndex | ( | $ | choice | ) |
Sets the focus by index. The integer index starts from 1.
| integer | $choice | Chosen frame. |
Definition at line 627 of file browser.php.
| setMaximumNestedFrames | ( | $ | max | ) |
Sets the maximum number of nesting of framed pages within a framed page to prevent loops.
| integer | $max | Highest depth allowed. public |
Definition at line 428 of file browser.php.
| setMaximumRedirects | ( | $ | max | ) |
Sets the maximum number of redirects before a page will be loaded anyway.
| integer | $max | Most hops allowed. public |
Definition at line 418 of file browser.php.
| SimpleBrowser | ( | ) |
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. public
Definition at line 174 of file browser.php.

| submitFormById | ( | $ | id | ) |
Submits a form by the ID.
| string | $id | The form ID. No submit button value will be sent. |
Definition at line 996 of file browser.php.

| useCookies | ( | ) |
Switches back on the cookie sending and recieving. public
Definition at line 236 of file browser.php.
| useFrames | ( | ) |
Enables frames support. Frames will be fetched from now on. public
Definition at line 220 of file browser.php.
| useProxy | ( | $ | proxy, |
| $ | username = false, |
||
| $ | password = false |
||
| ) |
Sets proxy to use on all requests for when testing from behind a firewall. Set URL to false to disable.
| string | $proxy | Proxy URL. |
| string | $username | Proxy username for authentication. |
| string | $password | Proxy password for authentication. public |
Definition at line 450 of file browser.php.
| $_history |
Definition at line 163 of file browser.php.
| $_ignore_frames |
Definition at line 164 of file browser.php.
| $_maximum_nested_frames |
Definition at line 165 of file browser.php.
| $_page |
Definition at line 162 of file browser.php.
| $_user_agent |
Definition at line 161 of file browser.php.