PHP Класс Eloquent\Phony\Mock\Handle\AbstractHandle

Наследование: implements Eloquent\Phony\Mock\Handle\Handle
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$class
$mock
$state

Открытые методы

Метод Описание
__construct ( ReflectionClass $class, stdClass $state, ReflectionMethod $callParentMethod = null, ReflectionMethod $callTraitMethod = null, ReflectionMethod $callMagicMethod = null, Eloquent\Phony\Mock\Mock $mock = null, StubFactory $stubFactory, StubVerifierFactory $stubVerifierFactory, AssertionRenderer $assertionRenderer, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, Invoker $invoker ) Construct a new handle.
__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.
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.

Защищенные методы

Метод Описание
createStub ( string $name ) : StubVerifier Create a new stub verifier.

Описание методов

__construct() публичный Метод

Construct a new handle.
public __construct ( ReflectionClass $class, stdClass $state, ReflectionMethod $callParentMethod = null, ReflectionMethod $callTraitMethod = null, ReflectionMethod $callMagicMethod = null, Eloquent\Phony\Mock\Mock $mock = null, StubFactory $stubFactory, StubVerifierFactory $stubVerifierFactory, AssertionRenderer $assertionRenderer, Eloquent\Phony\Assertion\AssertionRecorder $assertionRecorder, Invoker $invoker )
$class ReflectionClass The class.
$state stdClass The state.
$callParentMethod ReflectionMethod The call parent method, or null if no parent class exists.
$callTraitMethod ReflectionMethod The call trait method, or null if no trait methods are implemented.
$callMagicMethod ReflectionMethod The call magic method, or null if magic calls are not supported.
$mock Eloquent\Phony\Mock\Mock The mock, or null if this is a static handle.
$stubFactory Eloquent\Phony\Stub\StubFactory The stub factory to use.
$stubVerifierFactory Eloquent\Phony\Stub\StubVerifierFactory The stub verifier factory to use.
$assertionRenderer Eloquent\Phony\Assertion\AssertionRenderer The assertion renderer to use.
$assertionRecorder Eloquent\Phony\Assertion\AssertionRecorder The assertion recorder to use.
$invoker Eloquent\Phony\Invocation\Invoker The invoker to use.

__get() публичный Метод

Using this method will always start a new rule.
public __get ( string $name ) : StubVerifier
$name string The method name.
Результат Eloquent\Phony\Stub\StubVerifier The stub verifier.

checkNoInteraction() публичный Метод

Checks if there was no interaction with the mock.
public checkNoInteraction ( ) : Eloquent\Phony\Event\EventCollection | null
Результат Eloquent\Phony\Event\EventCollection | null The result.

className() публичный Метод

Get the class name.
public className ( ) : string
Результат string The class name.

clazz() публичный Метод

Get the class.
public clazz ( ) : ReflectionClass
Результат ReflectionClass The class.

createStub() защищенный Метод

Create a new stub verifier.
protected createStub ( string $name ) : StubVerifier
$name string The method name.
Результат Eloquent\Phony\Stub\StubVerifier The stub verifier.

defaultAnswerCallback() публичный Метод

Get the default answer callback.
public defaultAnswerCallback ( ) : callable
Результат callable The default answer callback.

full() публичный Метод

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

noInteraction() публичный Метод

Throws an exception unless there was no interaction with the mock.
public noInteraction ( ) : Eloquent\Phony\Event\EventCollection
Результат Eloquent\Phony\Event\EventCollection The result.

partial() публичный Метод

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

setDefaultAnswerCallback() публичный Метод

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

spy() публичный Метод

Get a spy.
public spy ( string $name ) : Eloquent\Phony\Spy\Spy
$name string The method name.
Результат Eloquent\Phony\Spy\Spy The spy.

startRecording() публичный Метод

Start recording calls.
public startRecording ( )

state() публичный Метод

Get the handle state.
public state ( ) : stdClass
Результат stdClass The state.

stopRecording() публичный Метод

Stop recording calls.
public stopRecording ( )

stub() публичный Метод

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.
Результат Eloquent\Phony\Stub\StubVerifier The stub verifier.

Описание свойств

$class защищенное свойство

protected $class

$mock защищенное свойство

protected $mock

$state защищенное свойство

protected $state