PHP 클래스 Eloquent\Phony\Mock\MockFactory

파일 보기 프로젝트 열기: eloquent/phony 1 사용 예제들

공개 메소드들

메소드 설명
__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.