Class SimplePage

Description

A wrapper for a web page.

Located in /libraries/pear/simpletest/page.php (line 239)


	
			
Variable Summary
 mixed $_frames
 mixed $_frameset
 mixed $_headers
 mixed $_links
 mixed $_method
 mixed $_open_forms
 mixed $_raw
 mixed $_sent
 mixed $_title
 mixed $_url
Method Summary
 SimplePage SimplePage ([SimpleHttpResponse $response = false])
 void acceptFormEnd ()
 void acceptFrame (SimpleFrameTag &$tag)
 void acceptFramesetStart (SimpleFramesetTag &$tag)
 void acceptTag (SimpleTag &$tag)
 void clearFrameFocus ()
 array getAbsoluteUrls ()
 string getAuthentication ()
 string/boolean getField (string $name)
 string/boolean getFieldById (string/integer $id)
 SimpleForm &getFormById (string $id)
 SimpleForm &getFormByImageLabel (string $label)
 boolean getFrameFocus ()
 boolean/array getFrames ()
 string getHeaders ()
 string getMimeType ()
 string getRaw ()
 string getRealm ()
 array getRelativeUrls ()
 mixed getRequest ()
 mixed getRequestData ()
 string getRequestMethod ()
 integer getResponseCode ()
 string getTitle ()
 string getTransportError ()
 string getUrlById (string $id)
 array getUrlsByLabel (string $label)
 boolean hasFrames ()
 boolean setField (string $name, string $value)
 boolean setFieldById (string/integer $id, string $value)
 boolean setFrameFocus (string $name)
 boolean setFrameFocusByIndex (integer $choice)
 void _addLink (SimpleAnchorTag $tag)
 boolean _isFormElement (string $name)
 boolean _isLoadingFrames ()
 boolean _isNormalMatch (string $first, string $second)
 boolean _linkIsAbsolute (string $url)
 void _noResponse ()
 string _normalise (string $html)
 void _setTitle (SimpleTitleTag &$tag)
Variables
mixed $_complete_forms (line 243)
mixed $_frames (line 245)
mixed $_frameset (line 244)
mixed $_frameset_nesting_level (line 246)
mixed $_headers (line 250)
mixed $_links (line 240)
mixed $_method (line 251)
mixed $_open_forms (line 242)
mixed $_raw (line 248)
mixed $_request_data (line 253)
mixed $_sent (line 249)
mixed $_title (line 241)
mixed $_transport_error (line 247)
mixed $_url (line 252)
Methods
Constructor SimplePage (line 260)

Parses a page ready to access it's contents.

  • access: public
SimplePage SimplePage ([SimpleHttpResponse $response = false])
acceptFormEnd (line 498)

Closes the most recently opened form.

  • access: public
void acceptFormEnd ()
acceptFormStart (line 490)

Opens a form. New widgets go here.

  • access: public
void acceptFormStart (SimpleFormTag &$tag)
acceptFrame (line 533)

Takes a single frame tag and stashes it in the current frame set.

  • access: public
void acceptFrame (SimpleFrameTag &$tag)
acceptFramesetEnd (line 521)

Closes the most recently opened frameset.

  • access: public
void acceptFramesetEnd ()
acceptFramesetStart (line 510)

Opens a frameset. A frameset may contain nested frameset tags.

  • access: public
void acceptFramesetStart (SimpleFramesetTag &$tag)
  • SimpleFramesetTag $tag: Tag to accept.
acceptTag (line 462)

Adds a tag to the page.

  • access: public
void acceptTag (SimpleTag &$tag)
clearFrameFocus (line 454)

Clears the frame focus.

  • access: public
void clearFrameFocus ()
getAbsoluteUrls (line 609)

Accessor for a list of all fixed links.

  • return: List of urls with scheme of http or https and hostname.
  • access: public
array getAbsoluteUrls ()
getAuthentication (line 400)

Accessor for last Authentication type. Only valid straight after a challenge (401).

  • return: Description of challenge type.
  • access: public
string getAuthentication ()
getField (line 867)

Accessor for a form element value within a page.

Finds the first match.

  • return: A string if the field is present, false if unchecked and null if missing.
  • access: public
string/boolean getField (string $name)
  • string $name: Field name.
getFieldById (line 886)

Accessor for a form element value within a page.

Finds the first match.

  • return: A string if the field is present, false if unchecked and null if missing.
  • access: public
string/boolean getFieldById (string/integer $id)
  • string/integer $id: Field ID attribute.
getFormById (line 814)

Finds a held form by the form ID. A way of identifying a specific form when we have control of the HTML code.

  • return: Form object containing the matching ID.
  • access: public
SimpleForm &getFormById (string $id)
  • string $id: Form label.
getFormByImageId (line 797)

Finds a held form by image button id. Will only search correctly built forms.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImageId (string $id)
  • string $id: Image ID attribute.
getFormByImageLabel (line 765)

Finds a held form by image label. Will only search correctly built forms.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImageLabel (string $label)
  • string $label: Usually the alt attribute.
getFormByImageName (line 781)

Finds a held form by image button id. Will only search correctly built forms.

  • return: Form object containing the image.
  • access: public
SimpleForm &getFormByImageName (string $name)
  • string $name: Image name.
getFormBySubmitId (line 749)

Finds a held form by button id. Will only search correctly built forms.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmitId (string $id)
  • string $id: Button ID attribute.
getFormBySubmitLabel (line 717)

Finds a held form by button label. Will only search correctly built forms.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmitLabel (string $label)
  • string $label: Button label, default 'Submit'.
getFormBySubmitName (line 733)

Finds a held form by button label. Will only search correctly built forms.

  • return: Form object containing the button.
  • access: public
SimpleForm &getFormBySubmitName (string $name)
  • string $name: Button name attribute.
getFrameFocus (line 426)

Accessor for current frame focus. Will be false as no frames.

  • return: Always false.
  • access: public
boolean getFrameFocus ()
getFrames (line 591)

Accessor for frame name and source URL.

  • return: False if no frameset or otherwise a hash of frame URLs. The key is either a numerical index or the name attribute.
  • access: public
boolean/array getFrames ()
getHeaders (line 327)

Accessor for raw headers of page.

  • return: Header block as text.
  • access: public
string getHeaders ()
getMimeType (line 375)

Accessor for current MIME type.

  • return: MIME type as string; e.g. 'text/html'
  • access: public
string getMimeType ()
getRaw (line 318)

Accessor for raw text of page.

  • return: Raw unparsed content.
  • access: public
string getRaw ()
getRealm (line 413)

Accessor for last Authentication realm. Only valid straight after a challenge (401).

  • return: Name of security realm.
  • access: public
string getRealm ()
getRelativeUrls (line 624)

Accessor for a list of all relative links.

  • return: List of urls without hostname.
  • access: public
array getRelativeUrls ()
getRequest (line 309)

Original request as bytes sent down the wire.

  • return: Sent content.
  • access: public
mixed getRequest ()
getRequestData (line 357)

Original request data.

  • return: Sent content.
  • access: public
mixed getRequestData ()
getRequestMethod (line 339)

Original request method.

  • return: GET, POST or HEAD.
  • access: public
string getRequestMethod ()
getRequestUrl (line 348)

Original resource name.

  • return: Current url.
  • access: public
SimpleUrl getRequestUrl ()
getResponseCode (line 387)

Accessor for HTTP response code.

  • return: HTTP response code received.
  • access: public
integer getResponseCode ()
getTitle (line 703)

Accessor for parsed title.

  • return: Title or false if no title is present.
  • access: public
string getTitle ()
getTransportError (line 366)

Accessor for last error.

  • return: Error from last response.
  • access: public
string getTransportError ()
getUrlById (line 680)

Accessor for a URL by the id attribute.

  • return: URL with that id.
  • access: public
string getUrlById (string $id)
  • string $id: Id attribute of link.
getUrlsByLabel (line 664)

Accessor for URLs by the link label. Label will match regardess of whitespace issues and case.

  • return: List of links with that label.
  • access: public
array getUrlsByLabel (string $label)
  • string $label: Text of link.
hasFrames (line 579)

Test for the presence of a frameset.

  • return: True if frameset.
  • access: public
boolean hasFrames ()
setField (line 831)

Sets a field on each form in which the field is available.

  • return: True if value is valid.
  • access: public
boolean setField (string $name, string $value)
  • string $name: Field name.
  • string $value: Value to set field to.
setFieldById (line 849)

Sets a field on the form in which the unique field is available.

  • return: True if value is valid.
  • access: public
boolean setFieldById (string/integer $id, string $value)
  • string/integer $id: Field ID attribute.
  • string $value: Value to set field to.
setFrameFocus (line 446)

Sets the focus by name.

  • return: False as no frames.
  • access: public
boolean setFrameFocus (string $name)
  • string $name: Chosen frame.
setFrameFocusByIndex (line 436)

Sets the focus by index. The integer index starts from 1.

  • return: Always false.
  • access: public
boolean setFrameFocusByIndex (integer $choice)
  • integer $choice: Chosen frame.
_addLink (line 570)

Adds a link to the page.

  • access: protected
void _addLink (SimpleAnchorTag $tag)
_extractResponse (line 280)

Extracts all of the response information.

  • access: private
void _extractResponse (SimpleHttpResponse $response)
_isFormElement (line 481)

Tests to see if a tag is a possible form element.

  • return: True if form element.
  • access: private
boolean _isFormElement (string $name)
  • string $name: HTML element name.
_isLoadingFrames (line 547)

Test to see if in the middle of reading a frameset.

  • return: True if inframeset.
  • access: private
boolean _isLoadingFrames ()
_isNormalMatch (line 653)

Matches strings regardles of varying whitespace.

  • return: True if matches even with whitespace differences.
  • access: private
boolean _isNormalMatch (string $first, string $second)
  • string $first: First to match with.
  • string $second: Second to match against.
_linkIsAbsolute (line 560)

Test to see if link is an absolute one.

  • return: True if absolute.
  • access: protected
boolean _linkIsAbsolute (string $url)
  • string $url: Url to test.
_noResponse (line 294)

Sets up a missng response.

  • access: private
void _noResponse ()
_normalise (line 641)

Space at the ends will be stripped and space in between is reduced to one space.

  • return: Content as big string.
  • access: private
string _normalise (string $html)
  • string $html: Typical HTML code.
_setTitle (line 694)

Sets the title tag contents.

  • access: protected
void _setTitle (SimpleTitleTag &$tag)

Documentation generated on Fri, 24 Dec 2004 13:02:54 +0000 by phpDocumentor 1.3.0RC3