file-fetcher
Public Member Functions | List of all members
PHPUnit\Framework\MockObject\Generator Class Reference

Public Member Functions

 getMock ($type, $methods=[], array $arguments=[], string $mockClassName='', bool $callOriginalConstructor=true, bool $callOriginalClone=true, bool $callAutoload=true, bool $cloneArguments=true, bool $callOriginalMethods=false, object $proxyTarget=null, bool $allowMockingUnknownTypes=true, bool $returnValueGeneration=true)
 
 getMockForAbstractClass (string $originalClassName, array $arguments=[], string $mockClassName='', bool $callOriginalConstructor=true, bool $callOriginalClone=true, bool $callAutoload=true, array $mockedMethods=null, bool $cloneArguments=true)
 
 getMockForTrait (string $traitName, array $arguments=[], string $mockClassName='', bool $callOriginalConstructor=true, bool $callOriginalClone=true, bool $callAutoload=true, array $mockedMethods=null, bool $cloneArguments=true)
 
 getObjectForTrait (string $traitName, string $traitClassName='', bool $callAutoload=true, bool $callOriginalConstructor=false, array $arguments=[])
 
 generate ($type, array $methods=null, string $mockClassName='', bool $callOriginalClone=true, bool $callAutoload=true, bool $cloneArguments=true, bool $callOriginalMethods=false)
 
 generateClassFromWsdl (string $wsdlFile, string $className, array $methods=[], array $options=[])
 
 getClassMethods (string $className)
 
 mockClassMethods (string $className, bool $callOriginalMethods, bool $cloneArguments)
 
 mockInterfaceMethods (string $interfaceName, bool $cloneArguments)
 

Member Function Documentation

◆ generate()

PHPUnit\Framework\MockObject\Generator::generate (   $type,
array  $methods = null,
string  $mockClassName = '',
bool  $callOriginalClone = true,
bool  $callAutoload = true,
bool  $cloneArguments = true,
bool  $callOriginalMethods = false 
)

◆ generateClassFromWsdl()

PHPUnit\Framework\MockObject\Generator::generateClassFromWsdl ( string  $wsdlFile,
string  $className,
array  $methods = [],
array  $options = [] 
)
Exceptions
RuntimeException

◆ getClassMethods()

PHPUnit\Framework\MockObject\Generator::getClassMethods ( string  $className)
Exceptions
RuntimeException
Returns
string[]

◆ getMock()

PHPUnit\Framework\MockObject\Generator::getMock (   $type,
  $methods = [],
array  $arguments = [],
string  $mockClassName = '',
bool  $callOriginalConstructor = true,
bool  $callOriginalClone = true,
bool  $callAutoload = true,
bool  $cloneArguments = true,
bool  $callOriginalMethods = false,
object  $proxyTarget = null,
bool  $allowMockingUnknownTypes = true,
bool  $returnValueGeneration = true 
)

Returns a mock object for the specified class.

Parameters
string | string[]$type
null | array$methods
Exceptions
RuntimeException

◆ getMockForAbstractClass()

PHPUnit\Framework\MockObject\Generator::getMockForAbstractClass ( string  $originalClassName,
array  $arguments = [],
string  $mockClassName = '',
bool  $callOriginalConstructor = true,
bool  $callOriginalClone = true,
bool  $callAutoload = true,
array  $mockedMethods = null,
bool  $cloneArguments = true 
)

Returns a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods to mock can be specified with the $mockedMethods parameter

@psalm-template RealInstanceType of object @psalm-param class-string<RealInstanceType> $originalClassName @psalm-return MockObject&RealInstanceType

Exceptions
RuntimeException

◆ getMockForTrait()

PHPUnit\Framework\MockObject\Generator::getMockForTrait ( string  $traitName,
array  $arguments = [],
string  $mockClassName = '',
bool  $callOriginalConstructor = true,
bool  $callOriginalClone = true,
bool  $callAutoload = true,
array  $mockedMethods = null,
bool  $cloneArguments = true 
)

Returns a mock object for the specified trait with all abstract methods of the trait mocked. Concrete methods to mock can be specified with the $mockedMethods parameter.

Exceptions
RuntimeException

◆ getObjectForTrait()

PHPUnit\Framework\MockObject\Generator::getObjectForTrait ( string  $traitName,
string  $traitClassName = '',
bool  $callAutoload = true,
bool  $callOriginalConstructor = false,
array  $arguments = [] 
)

Returns an object for the specified trait.

Exceptions
RuntimeException

◆ mockClassMethods()

PHPUnit\Framework\MockObject\Generator::mockClassMethods ( string  $className,
bool  $callOriginalMethods,
bool  $cloneArguments 
)
Exceptions
RuntimeException
Returns
MockMethod[]

◆ mockInterfaceMethods()

PHPUnit\Framework\MockObject\Generator::mockInterfaceMethods ( string  $interfaceName,
bool  $cloneArguments 
)
Exceptions
RuntimeException
Returns
MockMethod[]

The documentation for this class was generated from the following file: