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)


	
			
Direct descendents
Class Description
 class SimpleTestOptions
Method Summary
 static string getVersion ()
 static void ignore (string $class)
 static void ignoreParentsIfIgnored (array $classes)
 static boolean isIgnored (string $class)
 static void prefer ( &$object, object $object)
 static array|object|null &preferred (array|string $classes)
 string getDefaultProxy ()
 void setMockBaseClass ( $mock_base)
 void useProxy (string $proxy, [string $username = false], [string $password = false])
Methods
static getContext (line 220)

Accessor for the context of the current test run.

  • return: Current test run.
  • access: public
static SimpleTestContext &getContext ()
static getVersion (line 35)

Reads the SimpleTest version from the release file.

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

Redefined in descendants as:
static ignore (line 49)

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.

Redefined in descendants as:
static ignoreParentsIfIgnored (line 69)

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 131)

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.

Redefined in descendants as:
static prefer (line 90)

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 $object: Preferred object
  • &$object
static preferred (line 105)

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.
getDefaultProxy (line 174)

Accessor for default proxy host.

  • return: Proxy URL.
  • access: public
string getDefaultProxy ()

Redefined in descendants as:
getDefaultProxyPassword (line 194)

Accessor for default proxy password.

  • return: Proxy password for authentication.
  • access: public
string getDefaultProxyPassword ()

Redefined in descendants as:
getDefaultProxyUsername (line 184)

Accessor for default proxy username.

  • return: Proxy username for authentication.
  • access: public
string getDefaultProxyUsername ()

Redefined in descendants as:
getMockBaseClass (line 147)
  • deprecated:
void getMockBaseClass ()

Redefined in descendants as:
setMockBaseClass (line 139)
  • deprecated:
void setMockBaseClass ( $mock_base)
  • $mock_base

Redefined in descendants as:
useProxy (line 162)

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
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.

Redefined in descendants as:

Documentation generated on Sun, 04 May 2008 09:22:09 -0500 by phpDocumentor 1.3.0