public static function mock($namespace, $name)
    {
        $delegateBuilder = new MockDelegateFunctionBuilder();
        $delegateBuilder->build($name);
        
        $mockeryMock = Mockery::mock($delegateBuilder->getFullyQualifiedClassName());
        $mockeryMock->makePartial()->shouldReceive(MockDelegateFunctionBuilder::METHOD);

        $builder = new MockBuilder();
        $builder->setNamespace($namespace)
                ->setName($name)
                ->setFunctionProvider($mockeryMock);
        $mock = $builder->build();
        $mock->enable();
        
        $disabler = new MockDisabler($mock);
        Mockery::getContainer()->rememberMock($disabler);
        
        return new ExpectationProxy($mockeryMock);
    }
public static function mock($namespace, $name)
    {
        $delegateBuilder = new MockDelegateFunctionBuilder();
        $delegateBuilder->build($name);
        
        $mockeryMock = Mockery::mock($delegateBuilder->getFullyQualifiedClassName());
        $mockeryMock->makePartial()->shouldReceive(MockDelegateFunctionBuilder::METHOD);

        $builder = new MockBuilder();
        $builder->setNamespace($namespace)
                ->setName($name)
                ->setFunctionProvider($mockeryMock);
        $mock = $builder->build();
        $mock->enable();
        
        $disabler = new MockDisabler($mock);
        Mockery::getContainer()->rememberMock($disabler);
        
        return new ExpectationProxy($mockeryMock);
    }
public static function mock ( $ namespace , $ name ) { $ delegateBuilder = new MockDelegateFunctionBuilder ( ) ; $ delegateBuilder -> build ( $ name ) ; $ mockeryMock = Mockery :: mock ( $ delegateBuilder -> getFullyQualifiedClassName ( ) ) ; $ mockeryMock -> makePartial ( ) -> shouldReceive ( MockDelegateFunctionBuilder :: METHOD ) ; $ builder = new MockBuilder ( ) ; $ builder -> setNamespace ( $ namespace ) -> setName ( $ name ) -> setFunctionProvider ( $ mockeryMock ) ; $ mock = $ builder -> build ( ) ; $ mock -> enable ( ) ; $ disabler = new MockDisabler ( $ mock ) ; Mockery :: getContainer ( ) -> rememberMock ( $ disabler ) ; return new ExpectationProxy ( $ mockeryMock ) ; }
Builds a function mock.

Disable this mock after the test with Mockery::close().

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

@return Expectation The mockery expectation.
@SuppressWarnings(PHPMD)
Builds a function mock .