Class SimpleCallSchedule

Description

Allows setting of actions against call signatures either at a specific time, or always. Specific time settings trump lasting ones, otherwise the most recently added will mask an earlier match.

Located in /mock_objects.php (line 373)


	
			
Method Summary
 SimpleCallSchedule __construct ()
 void expectArguments (string $method, array $args, string $message)
 void register (string $method, array $args, SimpleAction $action)
 void registerAt (integer $step, string $method, array $args, SimpleAction $action)
 array replaceWildcards (array $args)
 mixed &respond (integer $step, string $method, array $args)
Methods
Constructor __construct (line 382)

Sets up an empty response schedule.

Creates an empty call map.

SimpleCallSchedule __construct ()
expectArguments (line 432)

Sets up an expectation on the argument list.

void expectArguments (string $method, array $args, string $message)
  • string $method: Method to test.
  • array $args: Bare arguments or list of expectation objects.
  • string $message: Failure message.
register (line 395)

Stores an action against a signature that will always fire unless masked by a time specific one.

void register (string $method, array $args, SimpleAction $action)
  • string $method: Method name.
  • array $args: Calling parameters.
  • SimpleAction $action: Actually simpleByValue, etc.
registerAt (line 413)

Stores an action against a signature that will fire at a specific time in the future.

void registerAt (integer $step, string $method, array $args, SimpleAction $action)
  • integer $step: delay of calls to this method,
    1. is next.
  • string $method: Method name.
  • array $args: Calling parameters.
  • SimpleAction $action: Actually SimpleByValue, etc.
replaceWildcards (line 476)

Replaces wildcard matches with wildcard expectations in the argument list.

  • return: Argument list with expectations.
  • access: protected
array replaceWildcards (array $args)
  • array $args: Raw argument list.
respond (line 449)

Actually carry out the action stored previously, if the parameters match.

  • return: The result of the action.
mixed &respond (integer $step, string $method, array $args)
  • integer $step: Time of call.
  • string $method: Method name.
  • array $args: The parameters making up the rest of the call.

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