AppserverIo\Appserver\Core\Api\AbstractServiceTest::getPartialServiceMock PHP Метод

getPartialServiceMock() защищенный Метод

Returns a partially mocked mock instance of our abstract service
protected getPartialServiceMock ( array $methodsToMock ) : PHPUnit_Framework_MockObject_MockObject | AbstractService
$methodsToMock array The methods we want to mock besides 'findAll' and 'load'
Результат PHPUnit_Framework_MockObject_MockObject | AbstractService
    protected function getPartialServiceMock(array $methodsToMock)
    {
        $service = $this->getMockBuilder('\\AppserverIo\\Appserver\\Core\\Api\\AbstractService')->setMethods(array_merge(array('findAll', 'load'), $methodsToMock))->setConstructorArgs(array($this->getMockInitialContext()))->getMockForAbstractClass();
        $service->expects($this->any())->method('findAll')->will($this->returnValue(array()));
        $service->expects($this->any())->method('load')->will($this->returnValue(null));
        return $service;
    }