Class SimpleTest


Registry and test context. Includes a few global options that I'm slowly getting rid of.

Located in /simpletest.php (line 23)

Method Summary
 static string getDefaultProxy ()
 static string getDefaultProxyPassword ()
 static string getDefaultProxyUsername ()
 static hash getDefaults ()
 static void getMockBaseClass ()
 static array getParsers ()
 static hash &getRegistry ()
 static string getVersion ()
 static void ignore (string $class)
 static void ignoreParentsIfIgnored (array $classes)
 static boolean isIgnored (string $class)
 static void prefer (object $object)
 static array|object|null preferred (array|string $classes)
 static void setMockBaseClass ( $mock_base)
 static void setParsers (array $parsers)
 static void useProxy (string $proxy, [string $username = false], [string $password = false])
static getContext (line 200)

Accessor for the context of the current test run.

  • return: Current test run.
SimpleTestContext getContext ()
static getDefaultProxy (line 138)

Accessor for default proxy host.

  • return: Proxy URL.
string getDefaultProxy ()
static getDefaultProxyPassword (line 156)

Accessor for default proxy password.

  • return: Proxy password for authentication.
string getDefaultProxyPassword ()
static getDefaultProxyUsername (line 147)

Accessor for default proxy username.

  • return: Proxy username for authentication.
string getDefaultProxyUsername ()
static getDefaults (line 212)

Constant default values.

  • return: All registry defaults.
  • access: protected
hash getDefaults ()
static getMockBaseClass (line 234)
  • deprecated:
void getMockBaseClass ()
static getParsers (line 167)

Accessor for default HTML parsers.

  • return: List of parsers to try in order until one responds true to can().
array getParsers ()
static getRegistry (line 187)

Accessor for global registry of options.

  • return: All stored values.
  • access: protected
hash &getRegistry ()
static getVersion (line 29)

Reads the SimpleTest version from the release file.

  • return: Version string.
string getVersion ()
static ignore (line 39)

Sets the name of a test case to ignore, usually

because the class is an abstract case that should

void ignore (string $class)
  • string $class: Add a class to ignore.
static ignoreParentsIfIgnored (line 57)

Scans the now complete ignore list, and adds

all parent classes to the list. If a class is not a runnable test case, then it's parents wouldn't be either. This is syntactic sugar to cut down on ommissions of ignore()'s or missing abstract declarations. This cannot be done whilst loading classes wiithout forcing a particular order on the class declarations and the ignore() calls. It's just nice to have the ignore() calls at the top of the file before the actual declarations.

void ignoreParentsIfIgnored (array $classes)
  • array $classes: Class names of interest.
static isIgnored (line 113)

Test to see if a test case is in the ignore list. Quite obviously the ignore list should be a separate object and will be one day.

This method is internal to SimpleTest. Don't use it.

  • return: True if should not be run.
boolean isIgnored (string $class)
  • string $class: Class name to test.
static prefer (line 76)

Puts the object to the global pool of 'preferred' objects which can be retrieved with SimpleTest :: preferred() method.

Instances of the same class are overwritten.

void prefer (object $object)
  • object $object: Preferred object
static preferred (line 89)

Retrieves 'preferred' objects from global pool. Class filter

can be applied in order to retrieve the object of the specific class

array|object|null preferred (array|string $classes)
  • array|string $classes: Allowed classes or interfaces.
static setMockBaseClass (line 226)
  • deprecated:
void setMockBaseClass ( $mock_base)
  • $mock_base
static setParsers (line 178)

Set the list of HTML parsers to attempt to use by default.

void setParsers (array $parsers)
  • array $parsers: List of parsers to try in order until one responds true to can().
static useProxy (line 127)

Sets proxy to use on all requests for when testing from behind a firewall. Set host to false to disable. This will take effect if there are no other proxy settings.

void useProxy (string $proxy, [string $username = false], [string $password = false])
  • string $proxy: Proxy host as URL.
  • string $username: Proxy username for authentication.
  • string $password: Proxy password for authentication.

Documentation generated on Sun, 31 Oct 2010 16:32:24 -0500 by phpDocumentor 1.4.3