PHP Class ParametersExpectation, simpletest

@package SimpleTest
Inheritance: extends SimpleExpectation
Afficher le fichier Open project: simpletest/simpletest Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $expected = false, string $message = '%s' ) Sets the expected parameter list.
test ( array $parameters ) : boolean Tests the assertion. True if correct.
testMessage ( $parameters ) : string Returns a human readable test message.

Méthodes protégées

Méthode Description
coerceToExpectation ( mixed $expected ) : SimpleExpectation Creates an identical expectation if the object/value is not already some type of expectation.
describeDifference ( array $expected, array $parameters ) : string Message to display if expectation differs from the parameters actually received.
renderArguments ( array $args ) : string Renders the argument list as a string for messages.
testParameter ( mixed $parameter, mixed $expected ) : boolean Tests an individual parameter.

Method Details

__construct() public méthode

Sets the expected parameter list.
public __construct ( $expected = false, string $message = '%s' )
$message string Customised message on failure.

coerceToExpectation() protected méthode

Creates an identical expectation if the object/value is not already some type of expectation.
protected coerceToExpectation ( mixed $expected ) : SimpleExpectation
$expected mixed Expected value.
Résultat SimpleExpectation Expectation object.

describeDifference() protected méthode

Message to display if expectation differs from the parameters actually received.
protected describeDifference ( array $expected, array $parameters ) : string
$expected array Expected parameters as list.
$parameters array Actual parameters received.
Résultat string Description of difference.

renderArguments() protected méthode

Renders the argument list as a string for messages.
protected renderArguments ( array $args ) : string
$args array Incoming arguments.
Résultat string Simple description of type and value.

test() public méthode

Tests the assertion. True if correct.
public test ( array $parameters ) : boolean
$parameters array Comparison values.
Résultat boolean True if correct.

testMessage() public méthode

Returns a human readable test message.
public testMessage ( $parameters ) : string
Résultat string Description of success or failure.

testParameter() protected méthode

Tests an individual parameter.
protected testParameter ( mixed $parameter, mixed $expected ) : boolean
$parameter mixed Value to test.
$expected mixed Comparison value.
Résultat boolean True if expectation fulfilled.