Copied!
  • internal This class is not covered by the backward compatibility promise for PHPUnit
Cloneable Final Instantiable
Methods
public generate ( string $type , ? array $methods = NULL , string $mockClassName = '' , bool $callOriginalClone = true , bool $callAutoload = true , bool $cloneArguments = true , bool $callOriginalMethods = false ) : PHPUnit\Framework\MockObject\MockClass
public generateClassFromWsdl ( string $wsdlFile , string $className , array $methods = [ ] , array $options = [ ] ) : string
 
  • throws RuntimeException
public getClassMethods ( string $className ) : array
 
  • throws RuntimeException
  • return string []
public getMock ( string $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 ) : PHPUnit\Framework\MockObject\MockObject
 

Returns a mock object for the specified class.

  • throws RuntimeException
public getMockForAbstractClass ( string $originalClassName , array $arguments = [ ] , string $mockClassName = '' , bool $callOriginalConstructor = true , bool $callOriginalClone = true , bool $callAutoload = true , ? array $mockedMethods = NULL , bool $cloneArguments = true ) : PHPUnit\Framework\MockObject\MockObject
 

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 $originalClassName
  • psalm-return MockObject&RealInstanceType
  • throws RuntimeException
public getMockForTrait ( string $traitName , array $arguments = [ ] , string $mockClassName = '' , bool $callOriginalConstructor = true , bool $callOriginalClone = true , bool $callAutoload = true , ? array $mockedMethods = NULL , bool $cloneArguments = true ) : PHPUnit\Framework\MockObject\MockObject
 

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.

  • throws RuntimeException
public getObjectForTrait ( string $traitName , string $traitClassName = '' , bool $callAutoload = true , bool $callOriginalConstructor = false , array $arguments = [ ] ) : object
 

Returns an object for the specified trait.

  • throws RuntimeException
public mockClassMethods ( string $className , bool $callOriginalMethods , bool $cloneArguments ) : array
 
  • throws RuntimeException
  • return MockMethod []
public mockInterfaceMethods ( string $interfaceName , bool $cloneArguments ) : array
 
  • throws RuntimeException
  • return MockMethod []
Constants
private PHPUnit\Framework\MockObject\Generator ::EXCLUDED_METHOD_NAMES = [ '__CLASS__' => true , '__DIR__' => true , '__FILE__' => true , '__FUNCTION__' => true , '__LINE__' => true , '__METHOD__' => true , '__NAMESPACE__' => true , '__TRAIT__' => true , '__clone' => true , '__halt_compiler' => true ]
 
  • var array
Properties
private static $cache
 
  • var array
private static $templates
 
  • var Template []
Methods
private canMockMethod ( ReflectionMethod $method ) : bool
private generateClassName ( string $type , string $className , string $prefix ) : array
private generateMock ( string $type , ? array $explicitMethods , string $mockClassName , bool $callOriginalClone , bool $callAutoload , bool $cloneArguments , bool $callOriginalMethods ) : PHPUnit\Framework\MockObject\MockClass
 
  • throws RuntimeException
private generateMockClassDeclaration ( array $mockClassName , bool $isInterface , array $additionalInterfaces = [ ] ) : string
private getObject ( PHPUnit\Framework\MockObject\MockType $mockClass , $type = '' , bool $callOriginalConstructor = false , bool $callAutoload = false , array $arguments = [ ] , bool $callOriginalMethods = false , ? object $proxyTarget = NULL , bool $returnValueGeneration = true )
private getTemplate ( string $template ) : SebastianBergmann\Template\Template
private isConstructor ( ReflectionMethod $method ) : bool
 
  • see https://github.com/sebastianbergmann/phpunit/issues/4139#issuecomment-605409765
private isMethodNameExcluded ( string $name ) : bool
private userDefinedInterfaceMethods ( string $interfaceName ) : array
 
  • psalm-param class-string $interfaceName
  • return ReflectionMethod []
Properties
private static $cache
 
  • var array
private static $templates
 
  • var Template []
© 2021 Bruce Wells
Search Namespaces \ Classes
Configuration