Lggr
Public Member Functions | List of all members
PHPUnit\Framework\MockObject\Generator Class Reference

Public Member Functions

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

Detailed Description

Mock Object Code Generator

Member Function Documentation

◆ generate()

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

◆ generateClassFromWsdl()

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

◆ getClassMethods()

PHPUnit\Framework\MockObject\Generator::getClassMethods (   $className)
Parameters
string$className
Returns
array
Exceptions

◆ getMock()

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

Returns a mock object for the specified class.

Parameters
string | string[]$type
array$methods
array$arguments
string$mockClassName
bool$callOriginalConstructor
bool$callOriginalClone
bool$callAutoload
bool$cloneArguments
bool$callOriginalMethods
object$proxyTarget
bool$allowMockingUnknownTypes
Returns
MockObject
Exceptions
Exception
RuntimeException

◆ getMockForAbstractClass()

PHPUnit\Framework\MockObject\Generator::getMockForAbstractClass (   $originalClassName,
array  $arguments = [],
  $mockClassName = '',
  $callOriginalConstructor = true,
  $callOriginalClone = true,
  $callAutoload = true,
  $mockedMethods = [],
  $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 last parameter

Parameters
string$originalClassName
array$arguments
string$mockClassName
bool$callOriginalConstructor
bool$callOriginalClone
bool$callAutoload
array$mockedMethods
bool$cloneArguments
Returns
MockObject
Exceptions

◆ getMockForTrait()

PHPUnit\Framework\MockObject\Generator::getMockForTrait (   $traitName,
array  $arguments = [],
  $mockClassName = '',
  $callOriginalConstructor = true,
  $callOriginalClone = true,
  $callAutoload = true,
  $mockedMethods = [],
  $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.

Parameters
string$traitName
array$arguments
string$mockClassName
bool$callOriginalConstructor
bool$callOriginalClone
bool$callAutoload
array$mockedMethods
bool$cloneArguments
Returns
MockObject
Exceptions

◆ getObjectForTrait()

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

Returns an object for the specified trait.

Parameters
string$traitName
array$arguments
string$traitClassName
bool$callOriginalConstructor
bool$callOriginalClone
bool$callAutoload
Returns
object
Exceptions

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