PHP Класс Eloquent\Phony\Mock\MockFactory

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Sequencer $labelSequencer, MockGenerator $generator, HandleFactory $handleFactory, FeatureDetector $featureDetector ) Cosntruct a new mock factory.
createFullMock ( ReflectionClass $class ) : Mock Create a new full mock instance for the supplied class.
createMockClass ( MockDefinition $definition, boolean $createNew = false ) : ReflectionClass Create the mock class for the supplied definition.
createPartialMock ( ReflectionClass $class, Arguments | array | null $arguments = [] ) : Mock Create a new partial mock instance for the supplied definition.
instance ( ) : MockFactory Get the static instance of this factory.

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

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

Cosntruct a new mock factory.
public __construct ( Sequencer $labelSequencer, MockGenerator $generator, HandleFactory $handleFactory, FeatureDetector $featureDetector )
$labelSequencer Eloquent\Phony\Sequencer\Sequencer The label sequencer to use.
$generator MockGenerator The generator to use.
$handleFactory Eloquent\Phony\Mock\Handle\HandleFactory The handle factory to use.
$featureDetector Eloquent\Phony\Reflection\FeatureDetector The feature detector to use.

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

Create a new full mock instance for the supplied class.
public createFullMock ( ReflectionClass $class ) : Mock
$class ReflectionClass The class.
Результат Mock The newly created mock.

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

Create the mock class for the supplied definition.
public createMockClass ( MockDefinition $definition, boolean $createNew = false ) : ReflectionClass
$definition Eloquent\Phony\Mock\Builder\MockDefinition The definition.
$createNew boolean True if a new class should be created even when a compatible one exists.
Результат ReflectionClass The class.

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

Create a new partial mock instance for the supplied definition.
public createPartialMock ( ReflectionClass $class, Arguments | array | null $arguments = [] ) : Mock
$class ReflectionClass The class.
$arguments Eloquent\Phony\Call\Arguments | array | null The constructor arguments, or null to bypass the constructor.
Результат Mock The newly created mock.

instance() публичный статический Метод

Get the static instance of this factory.
public static instance ( ) : MockFactory
Результат MockFactory The static factory.