PHP Class SimpleSignatureMap, simpletest

ファイルを表示 Open project: simpletest/simpletest Class Usage Examples

Public Methods

Method Description
__construct ( ) Creates an empty call map.
add ( array $parameters, mixed $action ) Stashes a reference against a method call.
findFirstAction ( array $parameters ) : object Searches the call list for a matching parameter set. Returned by reference.
findFirstSlot ( array $parameters ) : array Searches the map for a matching item.
isMatch ( array $parameters ) : boolean Searches the call list for a matching parameter set. True if successful.
test ( SimpleTestCase $test, array $parameters, string $message ) Compares the incoming parameters with the internal expectation.

Method Details

__construct() public method

Creates an empty call map.
public __construct ( )

add() public method

Stashes a reference against a method call.
public add ( array $parameters, mixed $action )
$parameters array Array of arguments (including wildcards).
$action mixed Reference placed in the map.

findFirstAction() public method

Searches the call list for a matching parameter set. Returned by reference.
public findFirstAction ( array $parameters ) : object
$parameters array Parameters to search by without wildcards.
return object Object held in the first matching slot, otherwise null.

findFirstSlot() public method

Searches the map for a matching item.
public findFirstSlot ( array $parameters ) : array
$parameters array Parameters to search by without wildcards.
return array Reference to slot or null.

isMatch() public method

Searches the call list for a matching parameter set. True if successful.
public isMatch ( array $parameters ) : boolean
$parameters array Parameters to search by without wildcards.
return boolean True if a match is present.

test() public method

Uses the incoming $test to dispatch the test message.
public test ( SimpleTestCase $test, array $parameters, string $message )
$test SimpleTestCase Test to dispatch to.
$parameters array The actual calling arguments.
$message string The message to overlay.