Class ParametersExpectation

Description

Parameter comparison assertion.

Located in /libraries/pear/simpletest/mock_objects.php (line 65)

SimpleExpectation
   |
   --ParametersExpectation
Variable Summary
 mixed $_expected
Method Summary
 ParametersExpectation ParametersExpectation ([mixed $expected = false], array $parameters, mixed $wildcard)
 boolean test (array $parameters)
 string testMessage (mixed $parameters, array $comparison)
 SimpleExpectation _coerceToExpectation (mixed $expected)
 string _describeDifference (array $expected, array $parameters)
 string _renderArguments (array $args)
 boolean _testParameter (mixed $parameter, mixed $expected)
Variables
mixed $_expected (line 66)

Inherited Variables

Inherited from SimpleExpectation

SimpleExpectation::$_dumper
Methods
Constructor ParametersExpectation (line 78)

Sets the expected parameter list.

  • access: public
ParametersExpectation ParametersExpectation ([mixed $expected = false], array $parameters, mixed $wildcard)
  • array $parameters: Array of parameters including those that are wildcarded. If the value is not an array then it is considered to match any.
  • mixed $wildcard: Any parameter matching this will always match.
test (line 89)

Tests the assertion. True if correct.

  • return: True if correct.
  • access: public
boolean test (array $parameters)
  • array $parameters: Comparison values.

Redefinition of:
SimpleExpectation::test()
Tests the expectation. True if correct.
testMessage (line 124)

Returns a human readable test message.

  • return: Description of success or failure.
  • access: public
string testMessage (mixed $parameters, array $comparison)
  • array $comparison: Incoming parameter list.

Redefinition of:
SimpleExpectation::testMessage()
Returns a human readable test message.
_coerceToExpectation (line 168)

Creates an identical expectation if the object/value is not already some type of expectation.

  • return: Expectation object.
  • access: private
SimpleExpectation _coerceToExpectation (mixed $expected)
  • mixed $expected: Expected value.
_describeDifference (line 142)

Message to display if expectation differs from the parameters actually received.

  • return: Description of difference.
  • access: private
string _describeDifference (array $expected, array $parameters)
  • array $expected: Expected parameters as list.
  • array $parameters: Actual parameters received.
_renderArguments (line 182)

Renders the argument list as a string for messages.

  • return: Simple description of type and value.
  • access: private
string _renderArguments (array $args)
  • array $args: Incoming arguments.
_testParameter (line 112)

Tests an individual parameter.

  • return: True if expectation fulfilled.
  • access: private
boolean _testParameter (mixed $parameter, mixed $expected)
  • mixed $parameter: Value to test.
  • mixed $expected: Comparison value.

Inherited Methods

Inherited From SimpleExpectation

 SimpleExpectation::SimpleExpectation()
 SimpleExpectation::test()
 SimpleExpectation::testMessage()
 SimpleExpectation::_getDumper()

Documentation generated on Thu, 20 Jan 2005 17:10:16 +0000 by phpDocumentor 1.3.0RC3