• internal This class is not covered by the backward compatibility promise for PHPUnit
public abstract PHPUnit\Framework\MockObject\Builder\Match::after( $id)
Defines the expectation which must occur before the current is valid.

public abstract PHPUnit\Framework\MockObject\Builder\Identity::id( $id)
Sets the identification of the expectation to $id.

  • note The identifier is unique per mock object.
public abstract method( $name)
Adds a new method name match and returns the parameter match object for further matching possibilities.

public abstract PHPUnit\Framework\MockObject\Builder\Stub::will(PHPUnit\Framework\MockObject\Stub\Stub $stub) : PHPUnit\Framework\MockObject\Builder\Identity
Stubs the matching method with the stub object $stub. Any invocations of the matched method will now be handled by the stub instead.

public abstract PHPUnit\Framework\MockObject\Builder\ParametersMatch::with( $arguments)
Sets the parameters to match for, each parameter to this function will be part of match. To perform specific matches or constraints create a new PHPUnit\Framework\Constraint\Constraint and use it for the parameter.

If the parameter value is not a constraint it will use the
PHPUnit\Framework\Constraint\IsEqual for the value.

Some examples:

// match first parameter with value 2
// match first parameter with value 'smock' and second identical to 42
$b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42));

public abstract PHPUnit\Framework\MockObject\Builder\ParametersMatch::withAnyParameters()
Sets a rule which allows any kind of parameters.

Some examples:

// match any number of parameters

  • return AnyParameters
© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only