• internal This class is not covered by the backward compatibility promise for PHPUnit
AbstractInterface
ImplementsPHPUnit\Framework\MockObject\Builder\Identity
PHPUnit\Framework\MockObject\Builder\Match
PHPUnit\Framework\MockObject\Builder\Stub
Methods
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 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 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
$b->with(2);
// match first parameter with value 'smock' and second identical to 42
$b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42));

public abstract withAnyParameters()
 

Sets a rule which allows any kind of parameters.

Some examples:

// match any number of parameters
$b->withAnyParameters();

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