Class SimpleTest

Description

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

Located in /simpletest.php (line 27)


	
			
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])
Methods
static getContext (line 218)

Accessor for the context of the current test run.

  • return: Current test run.
  • access: public
static SimpleTestContext getContext ()
static getDefaultProxy (line 152)

Accessor for default proxy host.

  • return: Proxy URL.
  • access: public
static string getDefaultProxy ()
static getDefaultProxyPassword (line 172)

Accessor for default proxy password.

  • return: Proxy password for authentication.
  • access: public
static string getDefaultProxyPassword ()
static getDefaultProxyUsername (line 162)

Accessor for default proxy username.

  • return: Proxy username for authentication.
  • access: public
static string getDefaultProxyUsername ()
static getDefaults (line 231)

Constant default values.

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

Accessor for default HTML parsers.

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

Accessor for global registry of options.

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

Reads the SimpleTest version from the release file.

  • return: Version string.
  • access: public
static string getVersion ()
static ignore (line 47)

Sets the name of a test case to ignore, usually because the class is an abstract case that should not be run. Once PHP4 is dropped this will disappear as a public method and "abstract" will rule.

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

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.

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

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.
  • access: public
static boolean isIgnored (string $class)
  • string $class: Class name to test.
static prefer (line 86)

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.

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

Retrieves 'preferred' objects from global pool. Class filter

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

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

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

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

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.

  • access: public
static 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 Thu, 01 Oct 2009 20:55:50 -0500 by phpDocumentor 1.4.2