PHPUnit2
[ class tree: PHPUnit2 ] [ index: PHPUnit2 ] [ all elements ]

Class: PHPUnit2_Extensions_MockObject_Builder_ParametersMatch

Source Location: /PHPUnit2-3.0.0alpha11/Extensions/MockObject/Builder/ParametersMatch.php

Class Overview

PHPUnit2_Extensions_MockObject_Builder_Identity
   |
   --PHPUnit2_Extensions_MockObject_Builder_Stub
      |
      --PHPUnit2_Extensions_MockObject_Builder_Match
         |
         --PHPUnit2_Extensions_MockObject_Builder_ParametersMatch

Builder interface for parameter matchers.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de>

Methods


Child classes:

PHPUnit2_Extensions_MockObject_Builder_MethodNameMatch
Builder interface for matcher of method names.

Inherited Variables

Inherited Methods

Class: PHPUnit2_Extensions_MockObject_Builder_Match

PHPUnit2_Extensions_MockObject_Builder_Match::after()
Defines the expectation which must occur before the current is valid.

Class: PHPUnit2_Extensions_MockObject_Builder_Stub

PHPUnit2_Extensions_MockObject_Builder_Stub::will()
Stubs the matching method with the stub object $stub. Any invocations of the matched method will now be handled by the stub instead.

Class: PHPUnit2_Extensions_MockObject_Builder_Identity

PHPUnit2_Extensions_MockObject_Builder_Identity::id()
Sets the identification of the expectation to $id.

Class Details

[line 68]
Builder interface for parameter matchers.


[ Top ]


Method Detail

with   [line 87]

PHPUnit2_Extensions_MockObject_Builder_ParametersMatch with( )

Sets the parameters to match for, each parameter to this funtion will be part of match. To perform specific matches or constraints create a new PHPUnit2_Framework_Constraint and use it for the parameter.

If the parameter value is not a constraint it will use the PHPUnit2_Framework_Constraint_IsEqual for the value.

Some examples:

  1.  // match first parameter with value 2
  2.  $b->with(2);
  3.  // match first parameter with value 'smock' and second identical to 42
  4.  $b->with('smock'new PHPUnit2_Framework_Constraint_IsEqual(42));

  • Access: public

[ Top ]

withAnyParameters   [line 100]

PHPUnit2_Extensions_MockObject_Matcher_AnyParameters withAnyParameters( )

Sets a matcher which allows any kind of parameters.

Some examples:

  1.  // match any number of parameters
  2.  $b->withAnyParamers();

  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:40:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.