• internal This class is not covered by the backward compatibility promise for PHPUnit
CloneableFinalInstantiable
Methods
public generate( $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( $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

  • 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[]
Constants
private PHPUnit\Framework\MockObject\Generator::BLACKLISTED_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 Text_Template[]
Methods
private canMockMethod(ReflectionMethod $method) : bool
private generateClassName( $type, string $className, string $prefix) : array
 
    private generateMock( $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) : Text_Template
    private isMethodNameBlacklisted(string $name) : bool
    private userDefinedInterfaceMethods(string $interfaceName) : array
     
    • return ReflectionMethod[]
    Properties
    private static $cache
     
    • var array
    private static $templates
     
    • var Text_Template[]
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only