classes/PHPMock.php
public function getFunctionMock($namespace, $name)
    {
        $delegateBuilder = new MockDelegateFunctionBuilder();
        $delegateBuilder->build($name);
        
        $mock = $this->getMockBuilder($delegateBuilder->getFullyQualifiedClassName())->getMockForAbstractClass();
        
        $mock->__phpunit_getInvocationMocker()->addMatcher(new DefaultArgumentRemover());
        
        $functionMockBuilder = new MockBuilder();
        $functionMockBuilder->setNamespace($namespace)
                            ->setName($name)
                            ->setFunctionProvider($mock);
                
        $functionMock = $functionMockBuilder->build();
        $functionMock->enable();
        
        $this->registerForTearDown($functionMock);
        
        $proxy = new MockObjectProxy($mock);
        return $proxy;
    }
public function getFunctionMock($namespace, $name)
    {
        $delegateBuilder = new MockDelegateFunctionBuilder();
        $delegateBuilder->build($name);
        
        $mock = $this->getMockBuilder($delegateBuilder->getFullyQualifiedClassName())->getMockForAbstractClass();
        
        $mock->__phpunit_getInvocationMocker()->addMatcher(new DefaultArgumentRemover());
        
        $functionMockBuilder = new MockBuilder();
        $functionMockBuilder->setNamespace($namespace)
                            ->setName($name)
                            ->setFunctionProvider($mock);
                
        $functionMock = $functionMockBuilder->build();
        $functionMock->enable();
        
        $this->registerForTearDown($functionMock);
        
        $proxy = new MockObjectProxy($mock);
        return $proxy;
    }
Returns the enabled function mock.

This mock will be disabled automatically after the test run.

@param string $namespace The function namespace.
@param string $name      The function name.

@return MockObject The PHPUnit mock.