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; }