PHP Interface Eloquent\Phony\Mock\Handle\Handle

Afficher le fichier Open project: eloquent/phony Interface Usage Examples

Méthodes publiques

Méthode Description
__get ( string $name ) : StubVerifier Get a stub verifier.
checkNoInteraction ( ) : Eloquent\Phony\Event\EventCollection | null Checks if there was no interaction with the mock.
className ( ) : string Get the class name.
clazz ( ) : ReflectionClass Get the class.
defaultAnswerCallback ( ) : callable Get the default answer callback.
full ( ) Turn the mock into a full mock.
noInteraction ( ) : Eloquent\Phony\Event\EventCollection Throws an exception unless there was no interaction with the mock.
partial ( ) Turn the mock into a partial mock.
proxy ( object $object ) Use the supplied object as the implementation for all methods of the mock.
setDefaultAnswerCallback ( callable $defaultAnswerCallback ) Set the callback to use when creating a default answer.
spy ( string $name ) : Eloquent\Phony\Spy\Spy Get a spy.
startRecording ( ) Start recording calls.
state ( ) : stdClass Get the handle state.
stopRecording ( ) Stop recording calls.
stub ( string $name, boolean $isNewRule = true ) : StubVerifier Get a stub verifier.

Method Details

__get() public méthode

Using this method will always start a new rule.
public __get ( string $name ) : StubVerifier
$name string The method name.
Résultat Eloquent\Phony\Stub\StubVerifier The stub verifier.

checkNoInteraction() public méthode

Checks if there was no interaction with the mock.
public checkNoInteraction ( ) : Eloquent\Phony\Event\EventCollection | null
Résultat Eloquent\Phony\Event\EventCollection | null The result.

className() public méthode

Get the class name.
public className ( ) : string
Résultat string The class name.

clazz() public méthode

Get the class.
public clazz ( ) : ReflectionClass
Résultat ReflectionClass The class.

defaultAnswerCallback() public méthode

Get the default answer callback.
public defaultAnswerCallback ( ) : callable
Résultat callable The default answer callback.

full() public méthode

Turn the mock into a full mock.
public full ( )

noInteraction() public méthode

Throws an exception unless there was no interaction with the mock.
public noInteraction ( ) : Eloquent\Phony\Event\EventCollection
Résultat Eloquent\Phony\Event\EventCollection The result.

partial() public méthode

Turn the mock into a partial mock.
public partial ( )

proxy() public méthode

This method may help when partial mocking of a particular implementation is not possible; as in the case of a final class.
public proxy ( object $object )
$object object The object to use.

setDefaultAnswerCallback() public méthode

Set the callback to use when creating a default answer.
public setDefaultAnswerCallback ( callable $defaultAnswerCallback )
$defaultAnswerCallback callable The default answer callback.

spy() public méthode

Get a spy.
public spy ( string $name ) : Eloquent\Phony\Spy\Spy
$name string The method name.
Résultat Eloquent\Phony\Spy\Spy The spy.

startRecording() public méthode

Start recording calls.
public startRecording ( )

state() public méthode

Get the handle state.
public state ( ) : stdClass
Résultat stdClass The state.

stopRecording() public méthode

Stop recording calls.
public stopRecording ( )

stub() public méthode

Get a stub verifier.
public stub ( string $name, boolean $isNewRule = true ) : StubVerifier
$name string The method name.
$isNewRule boolean True if a new rule should be started.
Résultat Eloquent\Phony\Stub\StubVerifier The stub verifier.