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

Public Member Functions

 __construct (TestCase $testCase, $type)
 
 getMock ()
 
 getMockForAbstractClass ()
 
 getMockForTrait ()
 
 setMethods (array $methods=null)
 
 setMethodsExcept (array $methods=[])
 
 setConstructorArgs (array $args)
 
 setMockClassName ($name)
 
 disableOriginalConstructor ()
 
 enableOriginalConstructor ()
 
 disableOriginalClone ()
 
 enableOriginalClone ()
 
 disableAutoload ()
 
 enableAutoload ()
 
 disableArgumentCloning ()
 
 enableArgumentCloning ()
 
 enableProxyingToOriginalMethods ()
 
 disableProxyingToOriginalMethods ()
 
 setProxyTarget ($object)
 
 allowMockingUnknownTypes ()
 
 disallowMockingUnknownTypes ()
 

Detailed Description

Implementation of the Builder pattern for Mock objects.

Constructor & Destructor Documentation

◆ __construct()

PHPUnit\Framework\MockObject\MockBuilder::__construct ( TestCase  $testCase,
  $type 
)
Parameters
TestCase$testCase
array | string$type

Member Function Documentation

◆ allowMockingUnknownTypes()

PHPUnit\Framework\MockObject\MockBuilder::allowMockingUnknownTypes ( )
Returns
MockBuilder

◆ disableArgumentCloning()

PHPUnit\Framework\MockObject\MockBuilder::disableArgumentCloning ( )

Disables the cloning of arguments passed to mocked methods.

Returns
MockBuilder

◆ disableAutoload()

PHPUnit\Framework\MockObject\MockBuilder::disableAutoload ( )

Disables the use of class autoloading while creating the mock object.

Returns
MockBuilder

◆ disableOriginalClone()

PHPUnit\Framework\MockObject\MockBuilder::disableOriginalClone ( )

Disables the invocation of the original clone constructor.

Returns
MockBuilder

◆ disableOriginalConstructor()

PHPUnit\Framework\MockObject\MockBuilder::disableOriginalConstructor ( )

Disables the invocation of the original constructor.

Returns
MockBuilder

◆ disableProxyingToOriginalMethods()

PHPUnit\Framework\MockObject\MockBuilder::disableProxyingToOriginalMethods ( )

Disables the invocation of the original methods.

Returns
MockBuilder

◆ disallowMockingUnknownTypes()

PHPUnit\Framework\MockObject\MockBuilder::disallowMockingUnknownTypes ( )
Returns
MockBuilder

◆ enableArgumentCloning()

PHPUnit\Framework\MockObject\MockBuilder::enableArgumentCloning ( )

Enables the cloning of arguments passed to mocked methods.

Returns
MockBuilder

◆ enableAutoload()

PHPUnit\Framework\MockObject\MockBuilder::enableAutoload ( )

Enables the use of class autoloading while creating the mock object.

Returns
MockBuilder

◆ enableOriginalClone()

PHPUnit\Framework\MockObject\MockBuilder::enableOriginalClone ( )

Enables the invocation of the original clone constructor.

Returns
MockBuilder

◆ enableOriginalConstructor()

PHPUnit\Framework\MockObject\MockBuilder::enableOriginalConstructor ( )

Enables the invocation of the original constructor.

Returns
MockBuilder

◆ enableProxyingToOriginalMethods()

PHPUnit\Framework\MockObject\MockBuilder::enableProxyingToOriginalMethods ( )

Enables the invocation of the original methods.

Returns
MockBuilder

◆ getMock()

PHPUnit\Framework\MockObject\MockBuilder::getMock ( )

Creates a mock object using a fluent interface.

Returns
MockObject

◆ getMockForAbstractClass()

PHPUnit\Framework\MockObject\MockBuilder::getMockForAbstractClass ( )

Creates a mock object for an abstract class using a fluent interface.

Returns
MockObject

◆ getMockForTrait()

PHPUnit\Framework\MockObject\MockBuilder::getMockForTrait ( )

Creates a mock object for a trait using a fluent interface.

Returns
MockObject

◆ setConstructorArgs()

PHPUnit\Framework\MockObject\MockBuilder::setConstructorArgs ( array  $args)

Specifies the arguments for the constructor.

Parameters
array$args
Returns
MockBuilder

◆ setMethods()

PHPUnit\Framework\MockObject\MockBuilder::setMethods ( array  $methods = null)

Specifies the subset of methods to mock. Default is to mock none of them.

Parameters
array | null$methods
Returns
MockBuilder

◆ setMethodsExcept()

PHPUnit\Framework\MockObject\MockBuilder::setMethodsExcept ( array  $methods = [])

Specifies the subset of methods to not mock. Default is to mock all of them.

Parameters
array$methods
Returns
MockBuilder

◆ setMockClassName()

PHPUnit\Framework\MockObject\MockBuilder::setMockClassName (   $name)

Specifies the name for the mock class.

Parameters
string$name
Returns
MockBuilder

◆ setProxyTarget()

PHPUnit\Framework\MockObject\MockBuilder::setProxyTarget (   $object)

Sets the proxy target.

Parameters
object$object
Returns
MockBuilder

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